A small and efficient Forth implementation
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Clyne d76d97f608
more loop words
4 weeks ago
msp430 msp430 improvements; fix compname bug 4 weeks ago
x86 reorganize arch's 4 weeks ago
.gitignore finish colon/semic; compile native words better 1 month ago
LICENSE add licensing to source files 4 weeks ago
Makefile msp430 improvements; fix compname bug 4 weeks ago
README.md more loop words 4 weeks ago
foci.c more loop words 4 weeks ago
foci.h msp430 improvements; fix compname bug 4 weeks ago

README.md

foci

foci is a small Forth implementation that prioritizes performance and portability. This threaded Forth implementation uses CPU registers and native execution to maximize efficiency.

Register usage is the only platform-specific requirement; otherwise, foci is written in 100% portable C. There is active support for x86_64, ARM Cortex-M, and MSP430 architectures.

foci compiles to a binary object that can easily be linked into another application. Code size is generally a few kilobytes, while RAM usage is primarily set by the size of foci's two stacks and dictionary.

Available words

dup drop swap rot -rot over tuck @ ! c@ c! + +! - * / mod and or xor = < [ ] ,
cell cell+ cells base here allot latest negate invert 1- 1+ aligned align : ;
literal if then else ' ['] execute decimal hex . emit begin until again while
repeat

Build instructions

Run make with a supported architecture target:

  • make x86-64: x86_64 processors (i386 is not supported)
  • make arm-cm4: ARM Cortex-M4 microcontrollers
  • make msp430: TI MSP430 microcontrollers