Live data from Hacker News

Forth: The Hacker’s Language

hackaday.com

21–30 of 111 posts

Re: Forth: The Hacker’s Language

#22
post #21

Things you can do with forth, from the forth author: http://www.greenarraychips.com/ which is actually a truly message-passing based arch with 144 clockless "cpus". Each cpu is actually so limited that forth is one of the few languages that makes programming this tricky platform viable.

As multiple people have pointed out, GreenArray chips are basically TIS-100 IRL, but in Forth. Right down to the quirky design.

Re: Forth: The Hacker’s Language

#24
post #21

Things you can do with forth, from the forth author: http://www.greenarraychips.com/ which is actually a truly message-passing based arch with 144 clockless "cpus". Each cpu is actually so limited that forth is one of the few languages that makes programming this tricky platform viable.

As multiple people have pointed out, GreenArray chips are basically TIS-100 IRL, but in Forth. Right down to the quirky design.

Never heard of TIS-100 (you mean http://www.zachtronics.com/tis-100/ ?)

Re: Forth: The Hacker’s Language

#25

Earlier quoted context omitted.

The more likely culprit is this: > But Forth is also like a high-wire act; if C gives you enough rope to hang yourself, Forth is a flamethrower crawling with cobras. There is no type checking, no scope, and no separation of data and code. You can do horrible things like redefine 2 as a function that will return seven, and forever after your math won’t work. (But why would you?) You can easily jump off into bad sectio…

That sounds about right. I've already linked it, but yosefk's take on the subject ( http://yosefk.com/blog/my-history-with-forth-stack-machines.... ) is worth reading, assuming that you've been living under a rock, and thus haven't already.

As a matter of fact, I have been living under a rock, and thus greatly appreciate your share!

Re: Forth: The Hacker’s Language

#26

I'm a embedded software dev and write code all day in C. Sure enough forth comes up in conversations once in a while as does other ideas like Python, JS, Lua etc.. Of all the alternatives to C, Forth is the only one which groks hardware. This is particularly important for embedded development. Any realistic alternative to C must understand interrupts, memory mapped registers etc.. Forth is the only one in which this…

> Forth is the only one in which this is possible. Every other example I've seen always uses C for "low-level" access or a libraries. If you need to do that, then you won't win over embedded devs like me.

Not really.

https://www.mikroe.com/mikrobasic/

https://www.mikroe.com/mikropascal/

http://www.astrobe.com/default.htm

http://www.adacore.com/gnatpro/embedded

http://www.ptc.com/developer-tools/apexada

http://www.ghs.com/products/ada_optimizing_compilers.html

Zero lines of C.

Re: Forth: The Hacker’s Language

#27

Why do you think some of the so-called hacker languages were pretty popular at a time (perl, lisp), and not the others (forth, apl?)

There was no Internet and knowledge was shared via magazines and computer clubs.

Forth was quite popular in Europe thanks to Jupiter Ace and ZX Spectrum extensions.

https://en.wikipedia.org/wiki/Jupiter_Ace

http://www.worldofspectrum.org/infoseekid.cgi?id=0008717

Re: Forth: The Hacker’s Language

#28
post #26

I'm a embedded software dev and write code all day in C. Sure enough forth comes up in conversations once in a while as does other ideas like Python, JS, Lua etc.. Of all the alternatives to C, Forth is the only one which groks hardware. This is particularly important for embedded development. Any realistic alternative to C must understand interrupts, memory mapped registers etc.. Forth is the only one in which this…

> Forth is the only one in which this is possible. Every other example I've seen always uses C for "low-level" access or a libraries. If you need to do that, then you won't win over embedded devs like me. Not really. https://www.mikroe.com/mikrobasic/ https://www.mikroe.com/mikropascal/ http://www.astrobe.com/default.htm http://www.adacore.com/gnatpro/embedded http://www.ptc.com/developer-tools/apexada http://www.ghs…

AmiBlitz (the Amiga Blitz Basic version) is another - you can write M68k assembler anywhere in a program, as they're legal AmiBlitz syntax.

http://www.amiblitz.de/

Re: Forth: The Hacker’s Language

#29
post #7

While forth can be quite elegant at times and I have fond memories of using Mops, I wish modern forth dialects were statically type checked.

You probably want to look at Kitten, by John Purdy:

http://kittenlang.org/

https://docs.google.com/presentation/d/1SJQGow_fnMSt5PsMgESu...

Some discussion on linked slides: https://www.reddit.com/r/concatenative/comments/4bj4lu/slide...

Re: Forth: The Hacker’s Language

#30
There is a decent amount of Forth publications out there, but nothing that really takes you from A->Z in building your own Forth based off of Assembly or C. JonesForth helped me conceptually understand parts of Forth, but there is a lot missing there for me to be able to start from scratch. I would pay $ for a real book in the vein of "Land of Lisp" that shows you how to build a Forth compiler/editor and how to extend it...the pros/cons of different design decisions like direct/indirect threading.
Post reply on HN