2 ms·
>"Some of zForth's highlights: o Small dictionary: instead of relying on a fixed cell size, the dictionary is written in variable length cells: small and commo
by peter_d_sherman 6y ago
>"Some of zForth's highlights:
o Small dictionary: instead of relying on a fixed cell size, the dictionary is written in variable length cells: small and common numbers take less space then larger, resulting in 30% to 50% space saving
o Portable: zForth is written in 100% ANSI C, and runs on virtually all operating systems and all architectures. Tested on x86 Linux/Win32/MS-DOS (Turbo-C 1.0!), x86_64, ARM, ARM thumb, MIPS, Atmel AVR and the 8051.
o Small footprint: the kernel C code compiles to about 3 or 4 kB of machine code, depending on the architecture and chosen cell data types.
o Tracing: zForth is able to show a nice trace of what it is doing under the hood, see below for an example.
o VM: Implemented as a small virtual machine: not the fastest, but safe and flexible. Instead of having direct access to host memory, the forth VM memory is abstracted, allowing proper boundary checking on memory accesses and stack operations.
o Flexible data types: at compile time the user is free to choose what C data type should be used for the dictionary and the stacks. zForth supports signed integer sizes from 16 to 128 bit, but also works seamlessly with floating point types like float and double (or even the C99 'complex' type!)
o Ease interfacing: calling C code from forth is easy through a host system call primitive, and code has access to the stack for exchanging data between Forth and C. Calling forth from C is easy, just one function to evaluate forth code."