I suspect you’re one of those people who doesn’t understand the need to create something new when someone else has already created it for you. Why write new music when there’s so much out there? Why Godot when there’s Unity? Why Linux when there’s Windows? The list goes on and on. I could simply not release this project and rejoice in having fulfilled my childhood dream. But I think my project will help many people. As a developer, I spent many interesting, albeit challenging, days developing it, and now I understand how most programming languages work.
I described the reasons for this project and its goals above; please reread it.
Interesting, it looks like the perfect language for visual novels )
…or leads to prompt based programming, if you want to be perverse : ASM was high level compared to punch cards, BASIC and Pascal were to ASM what itself was to punch cards, C (C++, C#) etc.
Leads to vibe coding : the ultimate coder’s dream to just tell the machine what you want.
With that progression, we went from a text processor (like word) taking a couple megs of RAM to things like Electron needing a gig of RAM to open a blank document
There are tons of places where people just enjoy the art of code for no real purpose at all. Code Golf stack exchange is just one place. The Shakespeare Programming Language was a cool example of a silly language. There are lots of them on Esolangs Wiki (Esoteric Languages). The International Obfuscated C Code Contest (IOCCC) is another daft place full of the joy of code.
Coding is art. I am convinced of this. In fact, I think it is obvious. When you are a child learning the alphabet, writing does not feel like art. Yet before we could read or write fluently, we were absorbed by stories and our imaginations were fed by tall tales of giants, talking animals and magic beans. Nobody would deny writing is an art, surely. It is the same with code, IMHO.
I totally agree. And when you see really good code, you appreciate the art. I’ve known many engineers who were a lot more artistic than they thought they were.
There is no need to get a purpose here. It’s way sufficient to do this for the sake of the challenge and learning ! It is art.
Also it could be interesting to make a sub language in a game if you desire to give the possibility to make simple programs in your game.
I would be doing that as I planned to make a sub language. Even if it’s a DSL, I think it’s better to have full control over what happens rather than running a compiler you don’t have full control over. The latter option would suggest that players could find workarounds and execute code you did not expect. A custom compiler lets you completely control what is and is not possible.
I’ve actually thought about a kind of visual scripting sub language similar to electrical flow diagrams for crafting and specifically enchanting weapons and armor with various elemental effects. The idea being that players will create combinations I would not have thought of.
I can assure you that after reviewing the DinoSource source code, it is quite easy to change the syntax, creating your own mini programming language based on it. This is one of the priority future features - the ability to quickly and easily create your own language, without in-depth study of the source code.
This would’ve been so useful to me a few months ago! I was writing a space probe game where the player can control the space probes by coding them and I had to write my own programming language for it.
As a recreational coder myself, blaringly obvious! Code can be beautiful, expressive, silly or fun. Once you realize this, the world opens up a little more :). I think it’s something I’ve only truly realized up until a few days ago…
If you ran the DinoSource interpreter in a separate thread, the main thread would be free to execute and the game wouldn’t freeze, here’s the Godot docs: Using multiple threads.
You can easily do this in a while loop, I’ve written many assembly language engines in Godot for fun and work.
The simplest way and the way I use is to keep a count of the instructions processed, then given a yield_frequency value you set do the following. Your main execute function doesn’t need to be in the _process or _physics_process functions, and is best not to be. I usually just create an execute function which I call deferred. The yield frequency is not to be confused with the number of instructions per-second, I allow a yield frequency from 100 (very slow) to 30000 (very fast) instructions between yields. At the max setting I can easily achieve greater than 5000000 assembly instructions per-second. My default is 1000 which equates to good performance and low CPU load. Frame updates as well are fluid and I can’t tell the difference from normal. Just an addendum.
await get_tree().process_frame
A part of my latest, assembly core loop is below, I have no lock ups or interface issues and CPU usage is also low. Another thing to do is set Godot to low processor mode as your yield process will be doing the frame updates.
yield_count = 0
while runable:
if yield_count < yield_frequency:
opCodeNames[pc].call()
pc += 1
yield_count += 1
continue
await get_tree().process_frame
yield_count = 0
You could check out my thread on using Assembly in Godot, for business for more info, linked in my info.
I love people experimenting and trying new a different things like this. Pushing the boundaries of a given language or system, even with something that most would never consider or in some cases think inappropriate, is how we learn what is truly possible along with new and different ways of doing things. It’s why I write the systems I do…
DinoSource is available on GitHub!, so you can check it out and test it out. There’s still a lot to fix and add, but if you stick to the syntax, it should work.