]> code.bitgloo.com Git - bitgloo/alee-forth.git/summary
 
descriptionA portable and concise Forth implementation in modern C++
ownerbitgloo
last changeFri, 23 Feb 2024 14:14:18 +0000 (09:14 -0500)

Alee Forth

Alee Forth is a concise Forth implementation written in modern C++ that aims for portability, minimal memory footprint, and execution efficiency.

Cross-platform compatibility

Alee Forth relies on the C++20 standard. It does not rely on any operating system. As a result, portability extends down to microcontroller targets with < 16kB flash and < 1 kB of RAM. See the msp430 folder for an example of such a port.

System-specific functionality is achieved through a sys Forth word. This word calls a user-supplied C++ function that implements whatever functionality is needed.

Forth compatibility

Alee Forth uses the Forth 2012 test suite to ensure standards compliance. The entire "core" word-set is implemented as well as most of the "core extension" word-set. The compiled program contains a minimal set of fundamental words with libraries in the forth directory supplying these larger word-sets. The "core" word-set can be compiled into the program by building the standalone target.

Missing core extension words:

PARSE-NAME REFILL RESTORE-INPUT S\" SAVE-INPUT

Building

Alee requires make and a compiler that supports C++20. Simply running make will produce the libalee.a library and a REPL binary named alee. The core word-sets can be passed into alee via the command line: ./alee forth/core.fth forth/core-ext.fth.

Other available build targets:

If building for a new platform, review these files: Makefile, libalee/types.hpp, and libalee/state.hpp. It is possible to modify the implementation to use 32-bit words, but this will require re-writing the core word-sets.

shortlog
2024-02-23 Clyne Sullivanadd .gitattributes master
2023-11-16 Clyne Sullivanadd dict impl to libalee section
2023-11-14 Clyne SullivanMerge branch 'documentation'
2023-11-13 Clyne Sullivanmsp430: add spi, update uart examples
2023-11-13 Clyne Sullivanadd LIBALEE_SECTION; minor fixes
2023-11-13 Clyne SullivanCHAR return zero on no input
2023-11-13 Clyne Sullivanmsp430: add rtc, analog, button support
2023-11-12 Clyne Sullivanno more cstring; 16mhz/115200 msp430; fix dict init
2023-11-12 Clyne Sullivanmsp430: reduce excess memory usage; trim linker script
2023-11-11 Clyne Sullivanmsp430: add uart example
2023-11-11 Clyne Sullivanmsp430: build reg data with bash, not make
2023-11-11 Clyne Sullivanmsp430: more dict space; prepare for hal impl
2023-11-10 Clyne Sullivanmsp430: lpm support; . uses base; expand dict size
2023-11-09 Clyne SullivanMaxDistance constant; some .cpp comments
2023-11-09 Clyne Sullivancoreword opcodes via token(); calculated WordCount
2023-11-08 Clyne Sullivanprecalculate some literals
...
heads
18 months ago master
19 months ago native
21 months ago optimize
2 years ago llvm