Let's Begin Toy Version 2! #123
Replies: 6 comments 1 reply
-
I've fiddled with this code tonight, and fixed the CI issue for the main branch. Irritatingly, I'm now having trouble with the CI for the dev branch. I've also fixed the preview image for the docs website, so yay! It's been a big few months - I finally completed the sale of a major project, so I no longer have that hanging over me. I've also given up trying to replace my laptops - I'm now using a raspberry pi as a desktop machine, out of pure spite. The pi has found an error that seems to only exist on ARM, but I can's seem to isolate it. Since it's a v1 issue for a small platform, I won't worry for now. I want to make progress in something, and I'm feeling like this is something I could enjoy again. I do need to review some homework, but it will be fine in the long run. |
Beta Was this translation helpful? Give feedback.
-
I'm currently working on the core pipeline of the language: lexer -> parser, compiler, virtual machine. I wrote the parser last night, but I still need to flesh out the tests for it. I'm not implementing the entire language in one hit, instead, it's easier to implement just a "calculator" kind of program, and then flesh that out into a full lang. |
Beta Was this translation helpful? Give feedback.
-
Official platform support has been expanded:
Each of these are defined here as the latest options provided by github. Currently, the test cases run on each platform, both normally and under GDB (except macos, which lacks GDB support). A few predefined macros, such as |
Beta Was this translation helpful? Give feedback.
-
Working on the building blocks of the lang without seeing direct results can take a toll. Thankfully, I think variables are the next step. The name strings have the type embedded within the structure, which is an interesting choice that I really had to think about. |
Beta Was this translation helpful? Give feedback.
-
Development is going well, even if it's a bit slower than I'd like. My health should always come first, so pacing myself is a good idea. I wrote about my plans for using Toy on my website here: Game Plan. It's always a pain to keep the documentation up to date, don't you think? That includes the issues and discussions here. Edit: I just found some notes about jump opcodes at #9 , could be useful soon. |
Beta Was this translation helpful? Give feedback.
-
I've added valgrind to the CI today, and found and fixed issues. The language technically isn't turing complete yet, which is starting to get very irritating. However, I want to get Toy to a workable state before the beginning of Advent of Code, since that would be a great test. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, and welcome back to the Toy Programming Language!
It's been a while since this project was in full swing, and I've been thinking hard about the problems and mistakes I made in version 1.x. Starting now, I'm officially working on version 2.x in the
dev
branch. The code will be new, although I'll try to salvage as much of the original code and logic as I reasonably can. In addition, the existing syntax and grammar of Toy will remain largely unchanged, but that's not a hard and fast requirement.The ultimate goal for Toy is to be embedded into a game engine, and to produce a real commercial-quality game that supports modding via this language. As such, I want to keep this language as simple as I can, while also allowing for extensibility where needed. All existing v1 bytecode will become invalid from this point forward, and any existing scripts may need to be adjusted. Still, I do believe that updating to the newer version will benefit users greatly, as my main motivation for the rewrite is to replace the heap-only memory allocation with a much more efficient stack-and-heap combo. This means that the language as a whole will become garbage collected, however at the time of writing I'm still digging into the possible ways to implement this.
Removed Features
One major feature that may be lost in the transition is slice notation - the ability to manipulate elements within a compound when indexing. For example:
While I'm happy I managed to get it working in 1.x, it was a massive challenge that resulted in ugly, bloated code tucked away in the
toy_builtin
source files. Since I found that this feature was practically never used, I've decided to drop it for the time being. It may return at some point, but only if there's a need.Additional Features
Garbage Collection! While some people may dislike the stop-the-world aspects of GC, I believe that the benefits outweigh the drawbacks. I will be including some ways to control the GC to some extent. The explicit support of first-class functions will make this an interesting challenge.
As stated above, I'll also be including an internal stack-based memory system - this will speed up the processes immensely, but will also completely destroy the previous bytecode format, which was geared for different priorities.
Documentation
For the time being, the docs website will maintain the 1.x docs, until I'm satisfied that v2 is ready for testing.
Feedback and Contributions
While I'm definitely open to feedback and criticism, direct pull requests may not be accepted during early development without a good reason. I want to lay down a solid foundation that others can build on, but I will try to be open minded.Update: The building blocks are in place, and I just need to hook up the new keywords - so I will be accepting pull requests from this point forward.
If you want to talk to me directly, or listen to my personal gripes regarding daily life and the video game industry, you're more than welcome to join my discord here - https://discord.gg/Je4hu3DeuT
Shoutouts
Everyone who contributed to v1 will still be credited in v2 and onwards, with special mention for @hiperiondev who has been active in my discord recently, contributing his thoughts regarding both the lang and his own projects.
Thanks to @munificent for essentially getting me interested in langdev, and who occasionally answers my (surely irritating) questions. In fact, I'm probably going to reference his work when developing the GC.
Beta Was this translation helpful? Give feedback.
All reactions