News for hackers. Stuff that matters.
Re:Historical recreation/restoration of original Forth on th... by s-macke on Sunday March 18, 2018 @11:27AM (#16612366)
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()".

Re:Historical recreation/restoration of original Forth on th... by FractalLP on Sunday March 18, 2018 @12:38PM (#16612753)
People 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++?
Re:Historical recreation/restoration of original Forth on th... by exikyut on Sunday March 18, 2018 @09:18PM (#16615545)
...Storage?

Nice.

Re:Historical recreation/restoration of original Forth on th... by emptybits on Sunday March 18, 2018 @03:12PM (#16613674)
The 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)

[2] https://www.intersil.com/content/dam/Intersil/documents/hs-r...

Re:Historical recreation/restoration of original Forth on th... by agapon on Sunday March 18, 2018 @11:29AM (#16612380)
FreeBSD uses Forth as a scripting language of its boot chain. illumos had recently started using the same boot chain.
Re:Historical recreation/restoration of original Forth on th... by sedachv on Sunday March 18, 2018 @07:44PM (#16615212)
They are replacing it with a Lua-scripted bootloader: 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.

Re:Historical recreation/restoration of original Forth on th... by krallja on Sunday March 18, 2018 @11:34AM (#16612401)
I remember PowerPC Macs using Open Firmware, which had a Forth REPL. https://en.wikipedia.org/wiki/Open_Firmware
Re:Historical recreation/restoration of original Forth on th... by richard_shelton on Sunday March 18, 2018 @03:41PM (#16613849)
if 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

Re:Historical recreation/restoration of original Forth on th... by s-macke on Sunday March 18, 2018 @06:20PM (#16614817)
Yes, 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 :-)

Re:Historical recreation/restoration of original Forth on th... by s-macke on Sunday March 18, 2018 @06:31PM (#16614867)
I 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.