News for hackers. Stuff that matters.
Re:Forth: The Hacker’s Language by s-macke on Saturday January 28, 2017 @11:02AM (#13506903)
One of the most complex games Starflight of the 80th's is written in Forth. I had a lot of fun decompiling it.

https://github.com/s-macke/starflight-reverse

It turns out to be very portable because the assembler code is only about 1000-2000 lines. The rest is implemented in Forth itself. They use indirect threading to produce very dense code. They kept even most of the debugging symbols inside the code and kept the forth interpreter itself in the code.

Re:Forth: The Hacker’s Language by dzdt on Saturday January 28, 2017 @12:50PM (#13507678)
At one point 10ish years ago the starflight source code was posted online by one of the authors, but it went back down pretty quickly. Someone might have a copy though. A few of the files are on archive.org, but not the main body.

http://web.archive.org/web/20030214111810/http://www.sonic.n...

Re:Forth: The Hacker’s Language by s-macke on Saturday January 28, 2017 @01:19PM (#13507828)
Thanks for posting the link. I found the archive a few month ago and downloaded the few documents that were left. The table here

https://github.com/s-macke/starflight-reverse/blob/master/sr...

is based on these documents and I filled some gaps of the symbol table. To start the game they used the word "LET-THERE-BE-STARFLIGHT", in the binary you see only part of it: "LET-TH".

I wish this "someone" would provide a full copy of the archive :)

Re:Forth: The Hacker’s Language by qwertyuiop924 on Saturday January 28, 2017 @11:55AM (#13507336)
Neat. Rather akin to Infocom's Z-machine (or to the newer Glulx), although less task-specific.
Re:Forth: The Hacker’s Language by s-macke on Saturday January 28, 2017 @12:23PM (#13507515)
It is similar, but the compiled code here is not fully architecture independent like for the Z-machine. Each word in Forth is compiled to a function pointer. So the Forth code vary for another architecture or when you recompile. But thanks to debugging symbols this is easily reverse engineered and you can easily figure out what is "+" or "-" for example.