4 ms·
I wonder if Forth is still used today for some applications of if anyone has stumbled over some production Forth code lately. For me, Forth is a language in wh
by s-macke 9y ago
I wonder if Forth is still used today for some applications of if anyone has stumbled over some production Forth code lately.
For me, Forth is a language in which you can easily shoot yourself in the foot. One element more or less on the stack and you run into strange problems ten functions later in your code.
But what I especially like is the enhanced naming of "words". You can choose "variable" or "function" names such as "a->b" instead of "a2b()" or "a_to_b()". Or "@X" for "GetX()" and "!X" for "PutX()".
- agapon 9y agoFreeBSD uses Forth as a scripting language of its boot chain. illumos had recently started using the same boot chain.
- krallja 9y agoI remember PowerPC Macs using Open Firmware, which had a Forth REPL. https://en.wikipedia.org/wiki/Open_Firmware https://en.wikipedia.org/wiki/Open_Firmware
- sedachv 9y agoThey are replacing it with a Lua-scripted bootloader: https://readlist.com/lists/freebsd.org/freebsd-current/25/125211.html https://readlist.com/lists/freebsd.org/freebsd-current/25/12... Apparently one of the "features" motivating the decision to use Lua is "it's interpreter is very small (~240 KB)," which sounds like a dumb joke when you consider Forth's footprint.
- FractalLP 9y agoPeople still use Forth for embedded work (there are two major Forth vendors with a definite customer base). I'd say it's quite rare in the server realm, but I know of one company doing storage stuff that has a Forth written on top of C running on FreeBSD and their engineers really like it as they understand the full system outside of the C compiler. Who understands even 25% of C++?
- exikyut 9y ago...Storage? Nice.
- emptybits 9y agoThe Philae spacecraft [1] (2014, first craft to "land" on a comet) was controlled by a couple of Harris RTX2010 CPUs, which are radiation-hardened CPUs that execute Forth words natively.[2] [1] https://en.wikipedia.org/wiki/Philae_(spacecraft) https://en.wikipedia.org/wiki/Philae_(spacecraft) [2] https://www.intersil.com/content/dam/Intersil/documents/hs-r/hs-rtx2010rh.pdf https://www.intersil.com/content/dam/Intersil/documents/hs-r...
- richard_shelton 9y agoif I understand correctly, you're the author of decompiler for StarFlight game. The most famous game written in Forth. And maybe most popular piece of Forth software of all times. So I think you surely know more about Forth than many modern Forthers do :) Sorry, if I reveal this link too early, but this is very impressive work of you and StarFlight game/engine really deserves more popularity! https://github.com/s-macke/starflight-reverse https://github.com/s-macke/starflight-reverse
- s-macke 9y agoYes, that's me. I decompiled it. And it is the most fun reverse engineering project you can imagine. Expect the unexpected. There is a Forth interpreter hidden in the code and some of word names are still in the code. So you can produce almost readable code. When I started I had not even a clue what Forth is about. I read the first articles about Forth long after I started the decompilation project. I still have to write a long text in the README, why the code of Starflight is almost as awesome as the game itself. Then it is ready for publish :-)
- s-macke 9y agoI would say, that I know about this special dialect more than most of the other Forthers. I have not written more than a few lines of Forth myself. But I have read a lot of Forth code.