Live data from Hacker News

Thinking Forth (1984)

thinking-forth.sourceforge.net

11–20 of 51 posts

Re: Thinking Forth (1984)

#12
post #4

Beside embedded system or firmware, what are Forth's popular use cases these days? Personally I never see backend development or mobile frontend job vacancies that require Forth skill, for example.

IIRC WebAssembly is at least partially inspired by Forth — both in syntax and being stack-based.

Python too, and of course PostScript.

Re: Thinking Forth (1984)

#13
post #4

Beside embedded system or firmware, what are Forth's popular use cases these days? Personally I never see backend development or mobile frontend job vacancies that require Forth skill, for example.

You are correct, Forth is not a institutional tool, more of a individual choice. IMO, one that allows you to prototype and debug interactively as you write your code and has been like that since the beginning. It allows you to train yourself to have a complete control and command of your code making for tighter, simpler solutions for complex problems ( In my personal experience and comments for those that have been i…

> IMO, you get better at programing understanding FORTH.

Modern cars don't have a magneto or carburettor, but you'll have a far better ability to fix your Jag if you also know how to fix your lawnmower.

Re: Thinking Forth (1984)

#14

Earlier quoted context omitted.

You are correct, Forth is not a institutional tool, more of a individual choice. IMO, one that allows you to prototype and debug interactively as you write your code and has been like that since the beginning. It allows you to train yourself to have a complete control and command of your code making for tighter, simpler solutions for complex problems ( In my personal experience and comments for those that have been i…

> IMO, you get better at programing understanding FORTH. Modern cars don't have a magneto or carburettor, but you'll have a far better ability to fix your Jag if you also know how to fix your lawnmower.

In the car analogy, it's more like learning and understanding the limitations of the Otto Engine so that you can build a better one... IMO. :) BTW, in aviation, where reliability, constancy, and longevity, they still use magnetos and carbs... :D :;

Re: Thinking Forth (1984)

#15

My introduction to Forth was tinkering first with Sun SPARC machines in the late 90s and then PowerMacs in the early 00s. At the time, I had no idea that it was a discrete programming language; it only registered in my mind as part of the OpenBoot/OpenFirmware environments. Then I ran into the FreeBSD bootloader and things finally clicked. "Aha," I thought, "this is an actual programming language." But what made it s…

> But what made it so popular for the early boot process, and where else was it used? Probably simplicity. You can get a very basic Forth system going in a few dozen assembly instructions. Then, you write some Forth "primitives", words written in assembly, to do things like basic arithmetic, branching, stack manipulation, and memory manipulation. There are endless debates about how many primitives you really need, bu…

Sectorforth and sectorlisp are interesting studies in minimalism. One of the goals of sectorforth’s author was to know whether

> if you have an interactive terminal, a dictionary, and the colon compiler, can you really build everything else based on just eight primitives?

> Turns out the answer is yes

The eight primitives come from an old usenet thread: https://groups.google.com/g/comp.lang.forth/c/NS2icrCj1jQ

Re: Thinking Forth (1984)

#17
post #4

Beside embedded system or firmware, what are Forth's popular use cases these days? Personally I never see backend development or mobile frontend job vacancies that require Forth skill, for example.

You are correct, Forth is not a institutional tool, more of a individual choice. IMO, one that allows you to prototype and debug interactively as you write your code and has been like that since the beginning. It allows you to train yourself to have a complete control and command of your code making for tighter, simpler solutions for complex problems ( In my personal experience and comments for those that have been i…

>> IMO, you get better at programing understanding FORTH

Isn't assembly fit the place better?

:)

Re: Thinking Forth (1984)

#18

I'd love to learn (a) Forth. As a beginner, where do you begin? Like Lisp there seems to be different variants. I always struggle with where to start.

I'd recommend gforth. It runs on lots of systems and is well maintained.

https://gforth.org/

Eventually you'll build your own forth (seems to be a right of passage!)

Re: Thinking Forth (1984)

#19

My introduction to Forth was tinkering first with Sun SPARC machines in the late 90s and then PowerMacs in the early 00s. At the time, I had no idea that it was a discrete programming language; it only registered in my mind as part of the OpenBoot/OpenFirmware environments. Then I ran into the FreeBSD bootloader and things finally clicked. "Aha," I thought, "this is an actual programming language." But what made it s…

I've frequently written about Mitch Bradley's Forthmacs / Sun Forth / CForth / OpenBoot / OpenFirmware on HN. I was his summer intern at Sun in 1987, and used his Forth systems in many projects!

https://github.com/openbios

https://wiki.laptop.org/go/FORTH

https://news.ycombinator.com/item?id=29261810

Speaking of Forth experts -- there's Mitch Bradley, who created OpenFirmware:

https://news.ycombinator.com/item?id=21822840

Here's the interview with Mitch Bradley saved on archive.org:

https://web.archive.org/web/20120118132847/http://howsoftwar...

[...]

https://news.ycombinator.com/item?id=27484426

I wrote malloc.fth for Mitch Bradley's ForthMacs, which ended up in OpenFirmware:

https://github.com/openbios/openfirmware/blob/master/ofw/cor...

[...]

https://news.ycombinator.com/item?id=26892629

In a lot of FORTH implementations, constant numbers like 0, 1, -1 and others are hard coded, not just for speed but also for space: a call to a code word only takes one cell, instead of using two cells with a LIT [value].

Here's some Breshenham line code I first wrote in FORTH (Mitch Bradley's SunForth on a 68k Sun-2 with cg2 graphics board), then translated to 68k code (using the rpn FORTH assembler) -- the FORTH code is commented out before the corresponding assembly code:

https://donhopkins.com/home/archive/forth/cg/line.f

[...]

https://news.ycombinator.com/item?id=17480298

Cool! Does it include a FORTH 6502 assembler written in FORTH? I love writing assembly code in RPN with Forth macros!

You can write FORTH code with loops and conditionals and any kind of logic and parameters, that dynamically assembles machine code! Much better than your typical macro assembler.

Here's some 6502 assembler for an Apple ][ SUPDUP terminal emulator that does ram card bank switching:

http://www.donhopkins.com/home/archive/forth/supdup.f

[...]

https://news.ycombinator.com/item?id=22456471

In what way is PostScript worse than Forth? Please answer with specific details, and provide links to code if you can. I programmed a lot of Forth code before learning and moving on to programming a lot of PostScript code, so I've used each of them extensively, and much prefer PostScript, and I'm happy to show you why and explain by showing you code.

[...]

https://news.ycombinator.com/item?id=21968175

Kragen is right that PostScript is a lot more like Lisp or Smalltalk than Forth, especially when you use Owen Densmore's object oriented PostScript programming system (which NeWS was based on). PostScript is semantically very different and much higher level that Forth, and syntactically similar to Forth but uses totally different names (exch instead of swap, pop instead of drop, etc).

[...]

Re: Thinking Forth (1984)

#20
post #6
post #4

Beside embedded system or firmware, what are Forth's popular use cases these days? Personally I never see backend development or mobile frontend job vacancies that require Forth skill, for example.

Forth has not won any popularity awards since the end of the '90s but it is still used by a small group of engineers around the world to solve their custom needs. This can be for embedded projects or firmware yes, but it has crept into larger projects. IMHO opinion Forth is hard to learn, takes more effort to bootstrap your project (more like Assembler) and more importantly it is hard to switch gears to think with Ch…

YES! I worked on the FedEx Enhanced SuperTracker software from 1999-2006, which I believe is the "Version II" you're referencing. The core software was still written in Forth, but we rebuilt the package routing logic in in C, which might be what you're referring to. Very curious to know how you are familiar with all the history, did you work there or at Forth, Inc?
Post reply on HN