Commit | Line | Data |
---|---|---|
e7f85ce1 IA |
1 | * Implementation of MAL in Common Lisp |
2 | ||
3 | ** Introduction | |
4 | ||
5 | This is a reasonably portable implementation of MAL in Common Lisp. It has been | |
6 | tested to work with following Common Lisp implementations | |
7 | ||
96b93a97 IA |
8 | - Steel Bank Common Lisp [[http://sbcl.org/]] |
9 | - Clozure Common Lisp [[http://ccl.clozure.com/]] | |
10 | - CMU Common Lisp [[https://www.cons.org/cmucl/]] | |
11 | - GNU CLISP [[http://www.clisp.org/]] | |
12 | - Embeddable Common Lisp [[https://common-lisp.net/project/ecl/]] | |
13 | - Allegro CL [[http://franz.com/products/allegro-common-lisp/]] | |
14 | - Armed Bear Common Lisp [[http://abcl.org/]] | |
15 | ||
16 | [[http://www.cliki.net/cl-launch][cl-launch]] to build command line runnable scripts/images for most of the above | |
e7f85ce1 IA |
17 | implementations. |
18 | ||
19 | ** Dependencies | |
20 | ||
96b93a97 IA |
21 | - cl-launch |
22 | For building command line executable scripts. See [[http://www.cliki.net/cl-launch][cl-launch]] | |
e7f85ce1 | 23 | |
96b93a97 IA |
24 | - quicklisp |
25 | For installing dependencies. See [[https://www.quicklisp.org/beta/][quicklisp]] | |
e7f85ce1 | 26 | |
96b93a97 IA |
27 | - readline |
28 | For readline integration. You can install it on Ubuntu using apt the package | |
29 | is ~libreadline-dev~. If you wish to run the implementation using Allegro CL, | |
30 | you will also have to install the 32 bit version of readline | |
31 | (~lib32readline-dev~ on Ubuntu) | |
32 | ||
33 | - (Optional) asdf | |
34 | This is needed if you want to run the implementation using GNU CLISP, since | |
35 | GNU CLISP does not ship with ~asdf~ and ~cl-launch~ depends on it. You can | |
36 | install it on Ubuntu using apt the package is ~cl-asdf~ | |
e7f85ce1 IA |
37 | |
38 | ** Running using different implementations | |
39 | ||
40 | By default the MAL is built using ~sbcl~, you can control this using ~LISP~ | |
41 | environment variable. The variable should be set to the cl-launch "nickname" for | |
42 | implementation. The nicknames that work currently are | |
43 | ||
44 | |------------------------+----------| | |
45 | | Implementation | Nickname | | |
46 | |------------------------+----------| | |
47 | | Steel Bank Common Lisp | sbcl | | |
48 | | Clozure Common Lisp | ccl | | |
49 | | CMU Common Lisp | cmucl | | |
50 | | GNU CLISP | clisp | | |
51 | | Embeddable Common Lisp | ecl | | |
52 | | Allegro CL | allegro | | |
96b93a97 | 53 | | Armed Bear Common Lisp | abcl | |
e7f85ce1 IA |
54 | |------------------------+----------| |
55 | ||
56 | For example to build with GNU CLISP, you need to do the following | |
57 | ||
58 | #+BEGIN_SRC sh | |
59 | cd common-lisp ; LISP=clisp make | |
60 | #+END_SRC | |
61 | ||
62 | You can control the implementation binary used for the build using environment | |
63 | variables. For a given implementation nickname, the environment variable will | |
64 | be the capitalization of the given nickname. | |
65 | ||
66 | |------------------------+-------------| | |
67 | | Implementation | Binary Path | | |
68 | |------------------------+-------------| | |
69 | | Steel Bank Common Lisp | SBCL | | |
70 | | Clozure Common Lisp | CCL | | |
71 | | CMU Common Lisp | CMUCL | | |
72 | | GNU CLISP | CLISP | | |
73 | | Embeddable Common Lisp | ECL | | |
74 | | Allegro CL | ALLEGRO | | |
96b93a97 | 75 | | Armed Bear Common Lisp | ABCL | |
e7f85ce1 IA |
76 | |------------------------+-------------| |
77 | ||
78 | For example to build MAL with Clozure CL installed in | |
79 | ~\~/.roswell/impls/x86-64/linux/ccl-bin/1.11/lx86cl64~, you need to do the | |
80 | following | |
81 | ||
82 | #+BEGIN_SRC sh | |
83 | cd common-lisp ; LISP=ccl CCL=~/.roswell/impls/x86-64/linux/ccl-bin/1.11/lx86cl64 make | |
84 | #+END_SRC | |
85 | ||
86 | You can use the variables ~*cl-implementation*~ and ~*cl-version*~ can be used | |
87 | to in MAL REPL to check the Common Lisp implementation and the version used for | |
88 | building it. | |
89 | ||
90 | ** Interop | |
91 | ||
96b93a97 | 92 | There is some basic interop in the form ~cl-eval~ which takes a string and |
e7f85ce1 | 93 | evaluates it as Common Lisp code, the result is returned in form of a MAL value, |
96b93a97 | 94 | as such you are limited to code that produces values that have MAL counterparts. |