Live data from Hacker News

Forth: The Hacker’s Language

hackaday.com

1–10 of 111 posts

Re: Forth: The Hacker’s Language

#2
I quite like Forth. It feels like a blend of lisp and apl. And even ml if you squint a bit at it as an applicative as composition system.

People on reddit seems to hint at the fact that Forth people stay under the radar because it allow them to design and solve problems in better ways.

I wonder how true it is ..

Re: Forth: The Hacker’s Language

#3
I like Factor, but staying small and innovative, I really like what Charles Childers has done with Retroforth. He has implemented a newer version running on a smaller VM Nga (the older was Ngaro) called Retro 12 [1]. Very cool stuff.

  [1]  http://forthworks.com/retro/

Re: Forth: The Hacker’s Language

#4
I came to Forth-like languages via PostScript, which has the advantage of a huge built-in graphics library. It very naturally introduces concepts like higher order operations, code as data and data as code.

Re: Forth: The Hacker’s Language

#5

I quite like Forth. It feels like a blend of lisp and apl. And even ml if you squint a bit at it as an applicative as composition system. People on reddit seems to hint at the fact that Forth people stay under the radar because it allow them to design and solve problems in better ways. I wonder how true it is ..

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 sections of memory and crash the system. You will develop a good mental model of what data is on the stack at any given time, or you will suffer. If you want a compiler to worry about code safety for you, go see Rust, Ada, or Java. You will not find it here. Forth is about simplicity and flexibility.

When it comes to working on a large project in a team, I suspect Forth doesn't scale.

Think of why Go works so well for Google: it's designed for code bases that are maintained by many people. And almost every design decision that was made for that goes against the spirit of Forth.

It's too flexible; you can change anything about the system so any Forth code ends up deeply personal, and specific to the current task. It's a language for individual artisans, which is another reason why it works well in the embedded space. But it's not hard to see how it all goes up in flames when you're in a large team.

Re: Forth: The Hacker’s Language

#6

I quite like Forth. It feels like a blend of lisp and apl. And even ml if you squint a bit at it as an applicative as composition system. People on reddit seems to hint at the fact that Forth people stay under the radar because it allow them to design and solve problems in better ways. I wonder how true it is ..

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…

I kinda guessed that forth was an amplifier for one mind rather than a team building exercise.

But I'm still curious about which company is using Forth, who are the devs, etc etc

Re: Forth: The Hacker’s Language

#8
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 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. It's much easier to write good embedded C code (no mallocs etc) than having to debug FFI.

Having said all that, my mind doesn't understand Forth. I'm too used to seeing code in C or even assembly to fully understand Forth. Nevertheless things like https://github.com/jeelabs/mecrisp-stellaris are really cool and are a realistic alternative to C.

Re: Forth: The Hacker’s Language

#9
This is a how-to-write-a-FORTH tutorial that I wrote a few years ago. It's particularly nice that you get to see how various control structures are implemented, like IF, CASE and even comments!

Part 1: http://git.annexia.org/?p=jonesforth.git;a=blob;f=jonesforth...

Part 2: http://git.annexia.org/?p=jonesforth.git;a=blob;f=jonesforth...

(github mirror: https://github.com/AlexandreAbreu/jonesforth/blob/master/jon... https://github.com/AlexandreAbreu/jonesforth/blob/master/jon...)

Previous HN comments: https://news.ycombinator.com/item?id=10187248

Re: Forth: The Hacker’s Language

#10

I quite like Forth. It feels like a blend of lisp and apl. And even ml if you squint a bit at it as an applicative as composition system. People on reddit seems to hint at the fact that Forth people stay under the radar because it allow them to design and solve problems in better ways. I wonder how true it is ..

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…

> Forth code ends up deeply personal, and specific to the current task.

That's the point though. You create a domain specific language using Forth and solve your domain specific problems with it.

Post reply on HN