News for hackers. Stuff that matters.
Re:Forth vs Lisp by zerr on Wednesday November 17, 2021 @04:09PM (#29258875)
Any reasons to code in Forth these days, besides intellectual exercise?
Re:Forth vs Lisp by int_19h on Wednesday November 17, 2021 @07:44PM (#29260832)
Bootstrapping a development environment on an exotic and/or very resource-constrained platform.

The neat thing about Forth is that, once you have the kernel running, and can hook some simple I/O to it (e.g serial), you basically have a remote REPL. And this can be made to work on devices where RAM is measured in kilobytes.

Re:Forth vs Lisp by qsort on Wednesday November 17, 2021 @04:12PM (#29258894)
It's very easy to bootstrap and can be made Turing-incomplete if needed. Bitcoin script is a Forth IIRC.
Re:Forth vs Lisp by whartung on Wednesday November 17, 2021 @04:41PM (#29259202)
Speaking of this, I've always loved this paper [1] about Forth. And it's a real eye opener. It's a real eye opener when you understand that primitives such as assignment and variable references are, indeed, in Forth, actual primitives. Primitives that can be readily changed.

Combine this with a venerable Forth (cross)assembler and it's pretty powerful for all of its simplicity. This is bootstrapping without even a boot, just need a sniglet.

[1] https://pygmy.utoh.org/3ins4th.html

Re:Forth vs Lisp by rbanffy on Wednesday November 17, 2021 @07:06PM (#29260563)
> It's very easy to bootstrap

Indeed. In college, I designed a stack based CPU that made it trivially easy to build a Forth compiler for it. It also had registers, because I started with a register based design, but the microcode fleshed out stack based instructions and the registers were mostly for storing data outside the stack.

Re:Forth vs Lisp by RodgerTheGreat on Wednesday November 17, 2021 @10:31PM (#29261697)
Chuck is quite fond of indexing registers on his forth machines; they make operations like memory copies much less messy than exclusively keeping state on the parameter stack.
Re:Forth vs Lisp by rbanffy on Thursday November 18, 2021 @08:35AM (#29265170)
It's a shame it was never built as real hardware (or a relief, as it'd probably have all sort of analog and timing issues), but it was really sweet to program.
Re:Forth vs Lisp by ngcc_hk on Saturday November 20, 2021 @09:58PM (#29293803)
Not even fpga?
Re:Forth vs Lisp by nmz on Wednesday November 17, 2021 @06:20PM (#29260170)
This?

https://youtu.be/55234oZ0EDU

factor[1] also looks like a nice language.

In reality though? we should only code in CPP/C/JS

[1] https://factorcode.org/