Skip to content

Commit f272502

Browse files
committed
Expand README.md
1 parent da30ac6 commit f272502

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,21 @@
33

44
Derived from FreeForth by Christophe Lavarenne (1956-2011)
55

6+
FreeForth2 offers a novel, lightweight Forth for x86 Linux that deftly blends assembly and Forth.
7+
8+
## Features
9+
FreeForth2 inherits its most distinctive features from FreeForth.
10+
* interactivity through compiled anonymous functions (no separate interpret mode)
11+
* macros generate inline x86 code
12+
* top two stack elements use registers
13+
* register renaming means zero-cost swap
14+
* tail-call optimized to jump
15+
* allows multiple entry-points to a function
16+
* built-in help system
17+
618
## New Features
19+
FreeForth2 improves usability, Linux integration, and quality controls.
20+
* stat, mmap, getenv, getpid, getppid, system
721
* turnkey support
822
* simple locals
923
* segfault handler
@@ -12,16 +26,18 @@ Derived from FreeForth by Christophe Lavarenne (1956-2011)
1226
* library search path
1327
* debug compiler makes verbose words
1428
* alternate versions of conditionals use Booleans on the stack
29+
* pictured numeric output
1530
* unit tests
1631
* with optional `compat.ff`, passes 90% of the core words tests from the Forth 2012 test suite
1732

18-
## Changes
19-
* interactive input automatically terminated
33+
## Changes from FreeForth
34+
* interactive input automatically terminated (closing `;` assumed)
2035
* quoted literals may contain spaces
2136
* abandoned windows support
22-
* require explicit conditions before IF
37+
* requires explicit conditions before `IF`
38+
* avoids source of faulty assumptions (see criticism below)
2339
* features separated into files in lib
24-
* leading backquote for hiding headers replaced with :. pvt and hidepvt
40+
* leading backquote for hiding headers replaced with `:.` `pvt` and `hidepvt`
2541

2642
## Docs
2743
* Christophe Lavarenne's writings about the original FreeForth with some notes
@@ -68,8 +84,8 @@ Derived from FreeForth by Christophe Lavarenne (1956-2011)
6884
$ cat cat.ff
6985
needs mmap.ff
7086
mkmm m
71-
: ok? dup $FF | -1 = 2drop IF strerror rdrop ELSE drop THEN ;
72-
: cat m mmapr ok? m @ m mm.sz @ type m munmap 2drop ;
87+
: ok? dup $FF | 1+ drop 0= IF strerror rdrop ;THEN drop ;
88+
: cat m mmapr ok? m @ m mm.sz+ @ type m munmap 2drop ;
7389
: main 0 argc 1- TIMES 1+ dup argv cat REPEAT ;
7490
$ ./ff -f cat.ff -f mkimage.ff
7591
$ make fftk
@@ -81,7 +97,7 @@ $ mv fftk ffcat
8197
$ ./ffcat cat.ff
8298
needs mmap.ff
8399
mkmm m
84-
: ok? dup $FF | -1 = 2drop IF strerror rdrop ELSE drop THEN ;
85-
: cat m mmapr ok? m @ m mm.sz @ type m munmap 2drop ;
100+
: ok? dup $FF | 1+ drop 0= IF strerror rdrop ;THEN drop ;
101+
: cat m mmapr ok? m @ m mm.sz+ @ type m munmap 2drop ;
86102
: main 0 argc 1- TIMES 1+ dup argv cat REPEAT ;
87103
```

0 commit comments

Comments
 (0)