17 KiB
lbForth
Source: https://github.com/larsbrinkhoff/lbForth
GitHub - larsbrinkhoff/lbForth: Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
Navigation Menu
Toggle navigation
Appearance settings
-
Platform
- AI CODE CREATION
- DEVELOPER WORKFLOWS
- APPLICATION SECURITY
- EXPLORE
-
Solutions
- BY COMPANY SIZE
- BY USE CASE
- BY INDUSTRY
-
Resources
- EXPLORE BY TOPIC
- EXPLORE BY TYPE
- SUPPORT & SERVICES
-
Open Source
- COMMUNITY
- PROGRAMS
- REPOSITORIES
-
Enterprise
Search or jump to...
Search code, repositories, users, issues, pull requests...
Search
Clear
Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel Submit feedback
Saved searches
Use saved searches to filter your results more quickly
Name
Query
To see all available qualifiers, see our documentation.
Cancel Create saved search
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
larsbrinkhoff / lbForth Public
- Notifications You must be signed in to change notification settings
- Fork 112
- Star 475
Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
License
475 stars 112 forks Branches Tags Activity
Notifications You must be signed in to change notification settings
Additional navigation options
larsbrinkhoff/lbForth
master
Go to file
Code
Open more actions menu
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
| Latest commit History815 Commits 815 Commits | ||||
| contrib | contrib | |||
| doc | doc | |||
| experiments | experiments | |||
| lib | lib | |||
| lisp @ 40b99c0 | lisp @ 40b99c0 | |||
| src | src | |||
| targets | targets | |||
| test | test | |||
| .gdbinit | .gdbinit | |||
| .gitattributes | .gitattributes | |||
| .gitignore | .gitignore | |||
| .gitlab-ci.yml | .gitlab-ci.yml | |||
| .gitmodules | .gitmodules | |||
| .scrutinizer.yml | .scrutinizer.yml | |||
| .travis.yml | .travis.yml | |||
| INSTALL | INSTALL | |||
| LICENSE | LICENSE | |||
| Makefile | Makefile | |||
| PITCHME.md | PITCHME.md | |||
| README.md | README.md | |||
| appharbor.sln | appharbor.sln | |||
| appveyor.yml | appveyor.yml | |||
| bitrise.yml | bitrise.yml | |||
| build.md | build.md | |||
| build.vcxproj | build.vcxproj | |||
| circle.yml | circle.yml | |||
| configure | configure | |||
| packages.config | packages.config | |||
| View all files |
Repository files navigation
( Subset of Forth94 )
This is a self-hosted implementation of Forth, which can regenerate itself from Forth source code. The bootstrapping process uses a metacompiler written in Lisp to target a small inner interpreter and a handful of code words written in C. A new metacompiler written in Forth generates an x86 executable using using assembly language code words.
There are also ARM, RISC-V, Motorola 68000, PDP-11, and asm.js targets. There is a cross compiler for 6502, 8051, AVR, Cortex-M, MSP430, PDP-8, PIC, and STM8.
( Continuous integration )
The code is continuously built and tested in Linux, MacOS X, and Windows using several cloud-based continuous integration services. This is documented in build.md.
( Further reading )
INSTALL \ How to build.
doc \ Classic (and recent) texts not related to this project.
lib/README \ Information about libraries.
targets/README.md \ Information about current and possibly future targets.
( Implementation guide )
The Forth kernel contains everything needed to read and compile the rest of the system from source code, and not much else. It's composed of two parts: a target-specific file nucleus.fth containing all primitive CODE words, and a target-independent kernel.fth. These two are compiled by the metacompiler.
The C target nucleus used for bootstrapping has only twelve proper primitives. There is also the COLD word which compiles to main(), and four I/O words.
When the kernel starts, it jumps to the word called WARM. This is responsible for loading the rest of the system and entering the text interpreter. The first file loaded by WARM is core.fth, which implements the CORE wordset. Because the kernel only has a bare minimum of words, the start of core.fth looks a little strange.
About
Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
Topics
linux programming-language avr arm interpreter cortex-m compiler self-hosted riscv forth x86 msp430 pdp11 metacompiler m68k asmjs 6502 risc-v 8051
Resources
License
Uh oh!
There was an error while loading. Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Uh oh!
There was an error while loading. Please reload this page.
Contributors 4
Uh oh!
There was an error while loading. Please reload this page.
Languages
- Forth 96.7%
- Makefile 1.0%
- Emacs Lisp 0.8%
- Shell 0.7%
- C 0.4%
- HTML 0.2%
- Other 0.2%
Footer
© 2026 GitHub, Inc.
Footer navigation
- Terms
- Privacy
- Security
- Status
- Community
- Docs
- Contact
- Manage cookies
- Do not share my personal information
You can’t perform that action at this time.