1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00
mal/impls/common-lisp
Joel Martin 062fb6f66e common-lisp: fix build with sbcl 2.0.1.debian
The update from ubuntu:vivid to ubuntu:20.04 update the version of sbcl
from 1.2.4.debian to 2.0.1.debian. This resulted in the cl-launch based
build process no longer working: dependencies were not resolved (but
running it several times would eventually resolve them. So use an sbcl
build command directly when building for sbcl.

Note: updating the image to ubuntu:24.04 upgrades the version of sbcl to
2.2.9.debian. Something about that version breaks how we do hash-maps.
They become temperamental: hash-map creation often results in a nil
object returned and doing (get hm key) usually results in nil returned
even if the key shows as being present.
2024-08-06 12:08:31 -05:00
..
hist Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
src Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
tests Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Dockerfile common-lisp: fix build with sbcl 2.0.1.debian 2024-08-06 12:08:31 -05:00
fake-readline.lisp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Makefile common-lisp: fix build with sbcl 2.0.1.debian 2024-08-06 12:08:31 -05:00
README.org Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
run Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
run-abcl.lisp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
run-mkcl.lisp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step0_repl.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step1_read_print.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step2_eval.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step3_env.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step4_if_fn_do.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step5_tco.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step6_file.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step7_quote.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step8_macros.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step9_try.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
stepA_mal.asd Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00

Implementation of MAL in Common Lisp

Introduction

This is a portable implementation of MAL in Common Lisp. It has been tested to work with following Common Lisp implementations

cl-launch to build executable/wrapper scripts for most of the above implementations.

Dependencies

  • cl-launch For building command line executable scripts. See cl-launch
  • quicklisp For installing dependencies. See quicklisp
  • readline For readline integration. You can install it on Ubuntu using apt the package is libreadline-dev. If you wish to run the implementation using Allegro CL, you will also have to install the 32 bit version of readline (lib32readline-dev on Ubuntu)
  • (Optional) asdf This is needed if you want to run the implementation using GNU CLISP, since GNU CLISP does not ship with asdf and cl-launch depends on it. You can install it on Ubuntu using apt the package is cl-asdf

Running using different implementations

By default the MAL is built using sbcl, you can control this using LISP environment variable. The variable should be set to the cl-launch "nickname" for implementation. The nicknames that work currently are

Implementation Nickname
Steel Bank Common Lisp sbcl
Clozure Common Lisp ccl
CMU Common Lisp cmucl
GNU CLISP clisp
Embeddable Common Lisp ecl
ManKai Common Lisp mkcl
Allegro CL allegro
Armed Bear Common Lisp abcl

For example to build with GNU CLISP, you need to do the following

  cd common-lisp ; LISP=clisp make

You can control the implementation binary used for the build using environment variables. For a given implementation nickname, the environment variable will be the capitalization of the given nickname.

Implementation Binary Path
Steel Bank Common Lisp SBCL
Clozure Common Lisp CCL
CMU Common Lisp CMUCL
GNU CLISP CLISP
Embeddable Common Lisp ECL
ManKai Common Lisp MKCL
Allegro CL ALLEGRO
Armed Bear Common Lisp ABCL

For example to build MAL with Clozure CL installed in \~/.roswell/impls/x86-64/linux/ccl-bin/1.11/lx86cl64, you need to do the following

  cd common-lisp ; LISP=ccl CCL=~/.roswell/impls/x86-64/linux/ccl-bin/1.11/lx86cl64 make

You can use the variables *cl-implementation* and *cl-version* can be used to in MAL REPL to check the Common Lisp implementation and the version used for building it.

Interop

There is some basic interop in the form cl-eval which takes a string and evaluates it as Common Lisp code, the result is returned in form of a MAL value, as such you are limited to code that produces values that have MAL counterparts.

Known Issues

ABCL takes a long to boot as such it needs to be run with TEST_OPTS set to --start-timeout 120