mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
Update README and example
This commit is contained in:
parent
56cf2ede18
commit
c3471ede08
2 changed files with 7 additions and 11 deletions
16
README.md
16
README.md
|
@ -29,24 +29,20 @@ kHtketkltkltkotk tkWtkotkrtkltkdtk!tk:k0-tQ
|
||||||
After bootstrapping by `bootstrap.fs`, it looks like this.
|
After bootstrapping by `bootstrap.fs`, it looks like this.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./planck < bootstrap.fs --i386-linux
|
$ ./planck < bootstrap.fs
|
||||||
|
PlanckForth (implementation: hand-written i386-linux)
|
||||||
Ready.
|
Ready.
|
||||||
." Hello World!" cr
|
." Hello World!" cr
|
||||||
```
|
```
|
||||||
|
|
||||||
The option `--i386-linux` is to specify OS and hardware for dynamic
|
`bootstrap.fs` can also takes a file as an input program like this.
|
||||||
code generation by `bootstrap.fs`.
|
|
||||||
It is not necessay in case of implementations by other languages.
|
|
||||||
|
|
||||||
|
|
||||||
`bootstrap.fs` also takes a file as an input like this.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cat example/fib.fs
|
$ cat example/fib.fs
|
||||||
: fib dup 2 < unless 1- dup recurse swap 1- recurse + then ;
|
: fib dup 2 < unless 1- dup recurse swap 1- recurse + then ;
|
||||||
38 fib . cr
|
20 fib . cr
|
||||||
$ ./planck < bootstrap.fs --i386-linux example/fib.fs
|
$ ./planck < bootstrap.fs example/fib.fs
|
||||||
39088169
|
6765
|
||||||
```
|
```
|
||||||
|
|
||||||
# Builtin Words
|
# Builtin Words
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
: fib dup 2 < unless 1- dup recurse swap 1- recurse + then ;
|
: fib dup 2 < unless 1- dup recurse swap 1- recurse + then ;
|
||||||
10 fib . cr
|
20 fib . cr
|
||||||
|
|
Loading…
Reference in a new issue