News for hackers. Stuff that matters.
Re:Forth – is it still relevant? by tdeck on Sunday November 09, 2025 @08:06AM (#45865309)
This kind of illustrates the biggest problem with the FORTH ecosystem, in my opinion. Approximately 80% of open source development effort seems to go toward building new, slightly incompatible FORTH interpreters to suit the author's own tastes.

Sure, gForth still doesn't have a decent way to make HTTP requests or match a regular expression, but writing libraries like that doesn't seem to be fun for the average FORTH developer, who would rather reimplement a very barebones language environment to address the gap left by the other 1200 FORTHs.

It's not that these projects aren't cool, but if you actually want the language to become popular why not look at things every other popular language has?

Re:Forth – is it still relevant? by binary132 on Sunday November 09, 2025 @08:17AM (#45865374)
You seem to be presuming here that wanting FORTH to be popular even crossed the minds of the 1201 FORTH developers in question. :')
Re:Forth – is it still relevant? by tdeck on Sunday November 09, 2025 @08:23AM (#45865413)
At least this author wrote the following:

> So, the question is, how to encourage today's world of C programmers to take a look at Forth. How do we convince them that Forth can be 10 times more productive?

So they are clearly interested in getting people to view FORTH as a productive choice.

Re:Forth – is it still relevant? by binary132 on Sunday November 09, 2025 @08:41AM (#45865556)
I’ll amend my first comment to say 1200, then.
Re:Forth – is it still relevant? by ErroneousBosh on Sunday November 09, 2025 @08:26AM (#45865440)
> but if you actually want the language to become popular why not look at things every other popular language has?

Because that is completely missing the point of what Forth is.

It's meant to be a simple high-level language that stays quite close to the underlying machine and can be implemented in a few dozen lines of assembler to solve a specific problem you have.

It doesn't need to be some massive bloated ball of mud and straw like ultra-high level languages such as C, where every aspect of the underlying machine is abstracted away in library after library.

Re:Forth – is it still relevant? by tdeck on Sunday November 09, 2025 @08:41AM (#45865555)
The whole context of this article is "how can we get C programmers to understand that they would be more productive in FORTH". My thesis is that maybe the attitude of "you should be writing everything from scratch, including (often) the FORTH environment itself" might just possibly have something to do with why people aren't jumping on the FORTH productivity bandwagon.

The number of C programmers whose use case is "I need to bring up this CPU with a never-before-seen instruction set" is a rounding error. The number who need to fit their complex logic into 1K of memory is small and dwindling every year. I can buy an ESP32 for less than a dollar.

Moreover, there's no technical reason why FORTH programmers can't write, share, and use libraries (except maybe the aforesaid plethora of incompatible language implementations). FORTH is great for creating neat little DSLs that solve a specific problem. Stacking these can be powerful, but if you personally don't want to use them, or it doesn't fit your use case, that's fine.

Re:Forth – is it still relevant? by andsoitis on Sunday November 09, 2025 @09:32AM (#45865846)
> "how can we get C programmers to understand that they would be more productive in FORTH"

It could also be that they wouldn’t be more productive (given the kinds of software the typical C programmer writes).

It could also be that that is the wrong question.

Re:Forth – is it still relevant? by saulpw on Sunday November 09, 2025 @05:51PM (#45870028)
The reason C beats Forth is code-sharing. Forth is a better language and system on its own, but it's difficult to standardize for reasons both technical and cultural. So if you write some really wonderful code in Forth to, say, decompress a bytestream, another Forth programmer is unlikely to be able to use that code without substantial modification. So Forth becomes either a single-person or a small-team system at best. Larger teams can't grow (in part because onboarding to your particular Forth system is a non-standard process), and especially cross-pollination between teams and companies is not possible.
Re:Forth – is it still relevant? by ErroneousBosh on Sunday November 09, 2025 @12:23PM (#45867233)
> The whole context of this article is "how can we get C programmers to understand that they would be more productive in FORTH".

They absolutely would not be more productive in Forth. If they're writing in an ultra-high-level language like C, they're unlikely to be targetting something where Forth would make sense.

You need ridiculously powerful processors to run a C compiler, and your code is likely targeting some massive processor with possibly hundreds of kilobytes of code space.

Forth and C inhabit entirely different conceptual spaces.

> Moreover, there's no technical reason why FORTH programmers can't write, share, and use libraries

None of the libraries you write will be of any use to me, and vice-versa.

Re:Forth – is it still relevant? by lioeters on Sunday November 09, 2025 @01:21PM (#45867751)
> ultra-high-level language like C

LOL, thanks for the reminder that most of my career has been spent up in the stratosphere, towers upon towers of abstractions. Started re-learning C during pandemia for embedded systems and microcontrollers, feeling freer as I go deeper down the stack. Got into Lisp interpreter, then compiler and assembler. Had a chance to study eForth in this post, and it can get real close to the metal.

> need ridiculously powerful processors to run a C compiler

That's one thing I noticed while getting familiar with C, that it's a huge effort to write a compiler in itself. Whereas Lisp and Forth even more, creating a variant/subset of the language from scratch is an exercise for every student. These languages are hidden gems, even though they play such important roles in the history of computer science. They are relevant, perhaps now more than ever when people are losing touch with the ground, the basics of code and computation.

Re:Forth – is it still relevant? by tdeck on Sunday November 09, 2025 @11:16PM (#45872368)
> You need ridiculously powerful processors to run a C compiler

It's not 1982 anymore. I can compile C just fine on SoC that costs $5. Of course it's true that these things are ridiculously powerful, but that doesn't really matter. The amount of silicon used is roughly the same as an 8051 from 20 years ago.

I'm all about cool projects like building your own CPU out of 7400 logic gates or writing your own OS in assembler or whatever. But I personally feel that FORTH doesn't need to be limited to these kinds of toy projects where you're intentionally making things harder on yourself. However when I see discussions related to FORTH it seems like most projects fit into this category and there is little diversity.

Re:Forth – is it still relevant? by tov_objorkin on Sunday November 09, 2025 @10:34AM (#45866271)
Forth is pretty lowlevel, i don't think it can compete with the highlevel languages. Postfix notation and stack juggling is just boring.
Re:Forth – is it still relevant? by NetMageSCW on Sunday November 09, 2025 @11:24AM (#45866683)
C is pretty low level… and yet.
Re:Forth – is it still relevant? by tov_objorkin on Monday November 10, 2025 @03:43AM (#45873858)
Disagree, there is no types in Forth, only cells. User is acting as a compiler. Comparing to C, imagine that every keyword like for/while/break is implemented as a macros using setjmp/longjmp. And this is a strong part of the language, flexibility but without any guarantees.
Re:Forth – is it still relevant? by vdupras on Sunday November 09, 2025 @10:40AM (#45866312)
That's what I would call the "Forth challenge", that is to grow out of stack juggling.

When you look at the Forth code of a beginner, yes it's full of stack juggling, of "@" and of "!". When you look at code from more experienced Forth programmers, there's much less of it.

The challenge is to build your way out. There's no fixed way to do this, because the best path to do so is generally dependent on the task at hand.

Needless to say, most programmers fail this challenge.

Re:Forth – is it still relevant? by jrochkind1 on Sunday November 09, 2025 @10:55AM (#45866451)
You are definitely not making it sound attractive for real projects where the outcome matters.

Sounds like a fun game maybe.

Re:Forth – is it still relevant? by vdupras on Sunday November 09, 2025 @11:33AM (#45866762)
This challenge comes with rewards. Forth has superpowers that can't be found elsewhere.

But its definitely not for everyone. I'd say that the status quo of Forth being an obscur niche is fine, just fine. If you need convincing, if you aren't spontaneously curious about Forth, then it's likely not for you.

Re:Forth – is it still relevant? by jrochkind1 on Sunday November 09, 2025 @02:09PM (#45868200)
I'm in favor of everyone having fun however they want, and you have piqued my interest a bit that it might be fun.

But if even the proponents of the language say that ("needless to say"!) most programmers will be incapable of the challenge of writing good code in it... definitely doesn't sound like anything I'd want in anything I wanted to be maintainable or long-lasting. If this is the outcome you desire, then your, uh, anti-evangelism is working!

Re:Forth – is it still relevant? by vdupras on Sunday November 09, 2025 @02:50PM (#45868555)
I've never written Forth as part of a team. I suppose it's difficult with an average team. But then I try to imagine what a small team of good Forth programmers could do and I'm thinking it would be a quite powerful team.

If I piqued your interest, might I interest you in the introductory series I wrote: https://tumbleforth.hardcoded.net/

Re:Forth – is it still relevant? by tov_objorkin on Sunday November 09, 2025 @11:09AM (#45866562)
Factoring is good way to reduce the complexity but writing math is painfull experience. To be fair, the infix version of Forth exists as an extension library.
Re:Forth – is it still relevant? by Mmrnmhrm on Sunday November 09, 2025 @01:15PM (#45867690)
The power of FORTH is that creating a variation tailored to your specific problem is almost effortless.

In most languages, building a compiler or interpreter is a major project. With FORTH, if you’re the only user, you can have something working in minutes.

I’ve lost count of how many times I’ve thrown together a simple stack-based interpreter. Whenever I need to encode non-trivial behavior in an app, I know I can spin up a quick FORTH and get it done.

Re:Forth – is it still relevant? by tdeck on Sunday November 09, 2025 @11:03PM (#45872301)
Let's imagine for the sake of argument that I don't need to write a compiler or interpreter. What else is FORTH well suited for?
Re:Forth – is it still relevant? by cmrdporcupine on Sunday November 09, 2025 @11:57PM (#45872577)
It's often used in bootloader/firmware type stuff (or was) because it can be a bit higher level than assembly and not subject to the same types of vulnerabilities and crashes... but written in a few KB and even easily hand written in assembly. And often run pretty fast, depending on the architecture.