Implementing a Forth

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. lfsr

    A VM that uses LFSR instead of a normal program counter that runs Forth (by howerj)

    Wow! What an amazing story!

    I started writing forth few months ago, wrote few interpreters, with jit or with types etc, and its just amazing, I think anyone should do it. TBH I don't think any other exercise has thought me as much about programming as this.

    I also notice the "return" of Forth, as it is probably the easiest high level language to make for computers with addressable memory and fetch execute cycle. The parser is just few lines of assembly and of course you can write the parser in the inner interpreter's bytecode, you don't even need assembly :) So hobbyists can just "make it" and make their own tiny operating systems with it. Of course everyone makes their own dialect, but I think thats OK. Things like https://github.com/howerj/lfsr LFSR CPU/VM running Forth, or UXN or duskos/collapseos.

    Now you can also use language models to help you onboard into the language, it do some practice programs and rewrite one program in many ways.

    So if you are young or old and never tried to Forth, don't miss out, its super fun.

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. MES-replacement

    Investigation into replacing the MES compiler

    I am currently implementing a stack based language as an intermediate language for a C compiler that I am developing. I have developed a relatively straight forward compiler for the stack language to the M1 assembler from live-bootstrap. This stack language has local variables. It actually makes use of two stacks: One in the traditional sense and one for the local variables (and the return address for calls). It reads as a kind of very primitive post-fix C kind of language. See: https://github.com/FransFaase/MES-replacement and https://www.iwriteiam.nl/D2506.html#2b

  4. shi

    a Simple Hackable Interpreter (by codr7)

    My first interpreters were Forth-derivatives, it's a great way to start designing your own languages.

    I've recently been working on a project to lower the barrier to entry for budding language designers. The language is strictly prefix, but could easily be turned into postfix with minor changes.

    https://github.com/codr7/shi

  5. lwan

    Experimental, scalable, high performance HTTP server

    I recently implemented a Forth, compatible with the Forth Haiku dialect used by https://forthsalon.appspot.com/ -- it uses a tail call/continuation-passing dispatching method, and performs some rudimentary optimizations. At some point it also spit out some C but I decided to give this feature the axe until it has a better infrastructure for optimizations and codegen.

    The idea is to use it to drive an LED matrix and have a simple web UI to develop "fragment shaders" in Forth. It's developed as part of the Lwan project, although currently it generates GIF files on the fly rather than drive a LED matrix.

    The source code is here for those that want to play with it: https://github.com/lpereira/lwan/tree/master/src/samples/for...

  6. foth

    Discontinued Tutorial-style FORTH implementation written in golang

    You can start way simpler than that, as forth won't need an AST or a complex parser.

    See this repository for a tutorial-approach to building a minimal forth-like language, in golang:

    https://github.com/skx/foth

  7. zeptoforth

    A not-so-small Forth for Cortex-M

    I went a completely different route when implementing zeptoforth (https://github.com/tabemann/zeptoforth) -- I went right for implementing a fully-featured system rather than focusing on minimalism, and came out with something that I am extremely comfortable writing non-trivial code with rather than a toy that shows how small of an implementation I can make without regard to being a practical tool. And yes, zeptoforth is very big as Forths (especially microcontroller Forths) go -- because the goal is to make something that can be used to program real systems out of the box with minimal effort on the user's part.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

Did you know that C is
the 6th most popular programming language
based on number of references?