Looking for a simple forth compiler (producing asm/executables, not compiling forth words) to learn from, preferably in C family language

This page summarizes the projects mentioned and recommended in the original post on /r/Forth

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • stoneknifeforth

    a tiny self-hosted Forth implementation

  • Title effectively says it all. The only thing I have found is StoneKnife Forth (implementation is in tinyboot1.tbf1) but this file is implemented in the same dialect of forth it implements, which due to being minimal makes it difficult to read and comprehend efficiently (I also can't find the origin of some words such as 'byte' used in the code but not implemented by the interpreter). I would prefer something in the C family to look at but anything should do as long as it's clean enough that I could use it as a reference to reimplement the compiler without much difficulty. Thank you in advance for any help with what is seemingly quite a narrow request.

  • r4

    :r4 concatenative programming language with ideas from ColorForth.

  • I have a vm in c for my forth, I have a compiler to asm (generate FASM output) but in the same lenguage, really a forth compiler is a simple program, there are a 1:1 correspondence in code genaration and words. here the 32bits source https://github.com/phreda4/r4/blob/master/r4/System/r4i86.txt here the 64bits with some optimizations: https://github.com/phreda4/r3d4/blob/master/r3/sys/r3asm0.r3 I hope this help

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • r3d4

    r3 programing language for 64 bits Windows/Linux/Mac/Rasberry Pi 4

  • I have a vm in c for my forth, I have a compiler to asm (generate FASM output) but in the same lenguage, really a forth compiler is a simple program, there are a 1:1 correspondence in code genaration and words. here the 32bits source https://github.com/phreda4/r4/blob/master/r4/System/r4i86.txt here the 64bits with some optimizations: https://github.com/phreda4/r3d4/blob/master/r3/sys/r3asm0.r3 I hope this help

  • jonesforth

    Mirror of JONESFORTH

  • JonesForth which is a very well documented forth written directly in x86 assembly. It contains very clear descriptions about the inner and outer interpreter and related functionality. Even though itnis not C, the techniques shown here can easily be transferred to a C program.

  • able-forth

    A Forth-like programming language that targets the AbleVM

  • I would consider adding Able Forth to the list. The Able Forth compiler targets the AbleVM, but in every other respect, it's a native code compiler (there's no reason Able Forth couldn't be made to emit native code for a physical machine). The default AbleVM core was designed to make the Able Forth compiler simple; it implements a 0-operand dual-stack virtual machine with ample general-purpose and base+offset address registers. Able is open source, in production use and under active development. If you decide it's interesting and you have any questions we're here to help.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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