4 ms·
I have been working on Forth for a long time, way before it got popular again as can be attested by the linked GitHub repository (I started in 2014, and publish
by logiqub 11mo ago
I have been working on Forth for a long time, way before it got popular again as can be attested by the linked GitHub repository (I started in 2014, and published my compiler in 2018). To be honest, for me, it's the best programming language, especially for working solo, or a very small team.
But the problem with Forth is that it's an evolving language. You design the language to describe your problem. As a result you need to be a good enough programmer to design a programming language, and make use of Forth's strengths. The other problem is the lack of object oriented features, if they are needed for your project. Because you invent the features as you go, and because you are free to redefine keywords, the final language might be anything. The lack of standardization hurts when it comes down to working on a large team.
The biggest problem however, is that you need to discard everything you thought you knew about programming to really do Forth. Real Forth does away with the abstractions common in mainstream languages. Forth is small, fast, portable.
I am now working on building my own game engine to prove that Forth is the "ultimate" language (for my needs). Imagine not having to read "The dragon book" to make your own compiler, that's a game changer. And let's not forget we are in the age of "IOT". Changing the syntax on the fly, not having to deal with a compiler that insults (looking at you C++), it's a pleasure.
I rewrote my compiler at least 20 times, and I took no shortcut. C was never used, it's just assembly code, and then adding features, based on a solid core. My own innovation is dot notation because I need objects, hooks in the compiler, so you can compiler alter the parser, error handler, etc. if needed.
In the future I will release the new virtual machine, with a few applications, and build a game library over time. If lucky, I may fund my retirement. We will see how it goes.
- logiqub 11mo agoI realized I forgot to explain why I needed a new language in the first place. So, imagine you work with Python, but you want to work with graphics, and make a game. Python is slow (even with Cython). You find LuaJIT, and it's a blast. Then LuaJIT is no longer maintained, and the official Lua goes in another direction (fractured ecosystem). You lament and despair, you search for a C interpreter. You find Tiny C compiler from Fabrice Bellard, but you don't have his skills. Only hope ? Make your own Python-like language that runs as fast as LuaJIT. That's what a custom Forth implementation can do for you. Honestly if Charles Moore didn't invent Forth, and I hadn't found it about it when I did... I don't know what I would do today. The freedom to express your thoughts exactly the way you want, and not how the compiler tells you to, is liberating. My website has been down for a while, but there are still some snapshots of my previous work. I didn't want to upload to GitHub and be pressured by users, when my design isn't polished yet. https://web.archive.org/web/20220818170224/http://logiqub.com https://web.archive.org/web/20220818170224/http://logiqub.co... https://web.archive.org/web/20240226001954/http://logiqub.com/learn https://web.archive.org/web/20240226001954/http://logiqub.co...