-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.txt
95 lines (65 loc) · 2.72 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Owl Lisp -- yet another pet lisp
Copyright (c) 2008-2011 Aki Helin
OVERVIEW
Owl Lisp is a simple purely functional Lisp system. It is mainly
an implementation of the purely functional subset of R5RS Scheme,
has some extra support for purely functional data structures (like a
complete order for objects), and an implementation which can be used
to run and compile programs fairly portably and efficiently without
needing nonstandard support libraries.
REQUIREMENTS
You should have make and gcc installed.
INSTALLATION
Short version:
$ make install
Altervative version:
$ make
[...]
$ cp bin/ol $HOME/bin/ol
$ ol
You see a prompt.
> (+ 1 2)
3
> ^D
bye bye _o/~
Ol is the standalone owl read-eval-print loop and compiler. It can be
used to rebuild owl, interpret files, evaluate terms interactively or
compile programs to fasl images or C files, which can then be compiled
with a C-compiler to standalone programs.
FILES
c/ovm.c - the virtual machine / shared owl lisp runtime
lib/*.scm - some libraries required to build owl
bench/*.scm - some benchmarks
bin/ol - the owl interpreter
USAGE
Owl can be used either interactively, or interpret code from files,
or compile programs to fasl-images or c-files. The difference between
an owl program and a plain script is that the program should just have
a function of one argument as the last value, which will be called with
the command line argument list when the program is executed.
In addition to being a regular interpreter, owl also tries to make it
easy to compile programs for different platforms. Owl programs can be
compiled with ol to C-files, which can be compiled to standalone binaries
without needing any owl-specific support files or libraries. The C files
also work on 32- and 64-bit systems, and compile as such at least on
Linux, OpenBSD, OSX and can be crosscompiled to Windows executables with
MinGW.
For example, to build a hello world program:
$ echo '(lambda (args) (print "Hello, world!"))' > hello.scm
$ ol -o hello.c hello.scm
$ gcc -o hello hello.c
$ ./hello
Hello, world!
Or simply:
$ echo '(λ (args) (print "Hello, world!"))' \
| ol -x c | gcc -x c -o hello - && ./hello
Parts of the compiled programs can be translated to C, instead of being
simply fasl-encoded, to increase speed. Using the --native flag compiles
most of the bytecode to C, and --usual-suspects compiles typically used
functions. To make programs run faster, one can use for example:
$ ol --native -o test.c test.scm && gcc -O2 -o test test.c
DOCUMENTATION
For further documentation, see:
http://code.google.com/p/owl-lisp/wiki/OwlManual
The source code repository is at:
https://github.com/aoh/owl-lisp