Forth – is it still relevant?

(github.com)

23 points | by lioeters 4 hours ago ago

8 comments

  • iberator 4 minutes ago

    I just wrote assembler for my custom virtual cpu. Now i plan to write Forth interpreter or compiler...

    IMO Forth is easiest language to implement from scratch, especially on stack based CPUs :)

  • Someone an hour ago

    The article doesn’t mention performance. Because Forth programs basically chain subroutine calls together, it’s a safe bet it is bad on modern hardware with its multitude of caches.

    That’s something you could prevent with an advanced compiler that inlines lots of code and carefully tries to put functions often called together in cache lines, but this code doesn’t do that, and if you did, why spend that effort on your compiler if a simple traditional language makes that inlining easier?

  • fjfaase 24 minutes ago

    I am using a stack based language as an intermediate language for a C compiler I am writing. The language can be mapped to assembly and I wrote a memory safe interpreter for it. Both are not geared to performance as that is not a primary concern for the compiler and tool chain.

  • tombert an hour ago

    I still feel like I need to learn Forth.

    It has always fascinates me how Forth has been historically used for low level embedded programming, but also can be as high level as you’d like. I feel like this isn’t a concept that has really gone away.

  • Animats 2 hours ago

    > With all the advantages, it is unfortunate that Forth lost out to C language over the years and have been reduced to a niche. Per ChatGPT: due to C's broader appeal, standardization, and support ecosystem likely contributed to its greater adoption and use in mainstream computing.

    Oh, please. I've written in Forth. It's useful when you have to do a cram job to fit in a really tiny machine. Otherwise, no.

  • jng 2 hours ago
    • astrobe_ 39 minutes ago

      Not really. The article was written 10+ years ago, saying that one cannot use Forth in commercial products, yet Forth Inc. and MPE are still in business.

  • xyzal 2 hours ago

    I don't know about now but it soon may be :)

    An interesting project chose it as its lang: https://collapseos.org/