Forth implemented in Rust, designed for real-time applications.
Documentation in traditional Chinese at rtForth 入門.
cargo install --path ./rtf
rtf --help # Display help information.
rtf <file> # Load forth commands in <file>.
rtf lib.fs <file> # Load lib.fs before <file>.
$ rtf # Execute debug version of rtForth.
rtForth v0.6.0, Copyright (C) 2018 Mapacode Inc.
Type 'bye' or press Ctrl-D to exit.
rf> : star 42 emit ;
ok
rf> star
* ok
rf> star star star
*** ok
rf> bye
SwiftForth vs gforth vs rtForth:
benchmark | SwiftForth | gforth-fast | gforth | stc-x86 ------------|:-----------|:--------------|:--------------|:---------------- bubble-sort | 1 | x | x | x fib | 1 (0.191s) | 6.5 (1.252s) | 10.1 (1.929s) | 13.6 (2.134s) matrix-mult | 1 | x | x | x mm-rtcg | 1 | x | x | x sieve | 1 (0.402s) | 1.55 (0.625s) | 3.4 (1.367s) | 8.77 (3.525s) ssieve-a | 1 | x | x | x repeat | 1 (0.218s) | 9.56 (2.084s) | 17.2 (3.755s) | 30.9 (6.738s)
rtForth subroutine-threading vs token-threading:
threading | stc-x86 | token-x86 | stc-x86-old | token-x86-old ----------|:-----------|:---------------|:--------------|:-------------- fib | 1 (2.596s) | 4.38 (11.372s) | 0.86 (2.242s) | 6.30 (16.357s) sieve | 1 (3.525s) | 3.22 (11.361s) | x | x repeat | 1 (6.738s) | 5.08 (34.273s) | 0.96 (6.489s) | 6.28 (42.359s)