Pachuco currently targets the i386 and x86-64 instruction set architectures, and builds and runs under Linux. It requires basic development tools to be installed, such as gcc, binutils, and make. It also uses the sbcl implementation of Common Lisp to bootstrap itself. This is available as the sbcl package on Debian, Ubuntu and Fedora, or see www.sbcl.org.
make all bootstraps the compiler and runs some
tests. The resulting compiler executable is
build/stage2, but it is normally invoked via the shell
scripts/compile. Among other things, this script
includes the standard runtime files into the compilation, and invokes
gcc to assemble the compiler output into a working executable.
There is a simple example program to generate the Fibonacci
examples/fib.pco. Compile it with:
$ scripts/compile examples/fib.pco -o build/fib
-o option specifies the name of the destination
The result is a stand-alone executable that you can run from the command line:
$ build/fib 10 89
To start the interpreter-based REPL, do
$ make repl build/repl runtime/runtime.pco runtime/runtime2.pco runtime/gc.pco Reading runtime/runtime.pco Reading runtime/runtime2.pco Reading runtime/gc.pco >>>
You can type Pachuco expressions and programs at
>>> (define (fact n) (if (= n 0) 1 (* n (fact (- n 1))))) #<function> >>> (fact 10) 3628800
Type control-D to quit the REPL.