LISP programming in Haiku and OS development with lisp

I fear a proper recipe should looks like this: https://github.com/haikuports/haikuports/blob/8352a12972702a06c49893267a5f5eb013fc1f5e/sys-apps/diskus/diskus-0.5.0.recipe
Notice the one million dependencies.

Ideally, yes, ā€œcabal installā€ would do the right thing (adding the usual boilerplate of recipes: dependencies, provides, description, license, etc). There may be a need to configure some paths so cabal install things in the places where haikuports expects them.

I always thought Common Lisp was a little crazy and over the top. Lisp was being programmed in the 60ā€™s on minimal hardware. There are Lisp implementations that run on 8-bit architectures. Maybe a version of Lisp like Scheme is the way to go. I expect that would be much more portable.
https://www.gnu.org/software/mit-scheme/
https://www.scheme.com/tspl4/

Eh, the whole point is common lisp is at least standardā€¦ if you go to some subset you can write your own stuff but it less likely youā€™ll be able to collaborate with lispers at large.

In any case bootstrapping lisp is at least not that hard since ECL exists and is decent, and that can be used to provide the lisp dependency the others need for bootstrapping.

Iā€™ve been attempting (admittedly rather half-heartedly) attempting to port a lisp to Haiku, the goal being getting SBCL ported on the 64 bit version of Haiku. As stated earlier, SBCL requires a lisp to compile.

ABCL, while it runs well appears to be incompatible at some level with the bootstrap code in SBCL. It gets quite a long way but then several parts of the package refuse to compile. I did go on the ##lisp IRC channel to ask if it is a problem that ABCL compiles to Java bytecode rather than x86 machine code but they handwaved that away by saying that the SBCL compilation process ā€œemitsā€ machine code (somehow - that would mean that the SBCL crew implemented their own compiler instead of using the compiler integrated into the Lisp image, which just sounds crazy to me).

Iā€™ve tried to compile ECL but that was fruitless. I think the best bet is to get GCL to compile and use that to bootstrap SBCL. Even though it is outdated it seems to have a sensible build structure and looks like itā€™s written in C. I havenā€™t looked at Clozure yet either.

If you want to collaborate on attempting to port SBCL to Haiku give me a shout.

EDIT: I just noticed I necroed a 5 month old thread. My apologies.

1 Like

Yeah it shouldnā€™t matter since basically SBCL is a compiler to machine codeā€¦ it doesnā€™t wrap another compiler it is a compiler.

Clasp is an example of an LLVM based lisp compilerā€¦ looks like development is active in in the branches, but the master branch is about 500 commits behind the main developer O.o Clasp is supposed to interop with C++ better so that might be a perfect fit for Haiku if you could get it working.

https://github.com/clasp-developers/clasp note the dev branch appears to be where news stuff happens.

1 Like

As I pointed out in other thread, ABCL does great job to bootstrap SBCL on Haiku x86-64. The second stage, that actually fails, does not use ABCL. Instead, it uses the bootstrap, which fails. SBCL officially states it can be compiled with ABCL.

I give you a shout :slight_smile:. I am really motivated to progress porting of SBCL to Haiku.

There is one big problem with getting clasp working on Haiku: it depends on SBCL.

Iā€™m not sure why it depends on clasp thoughā€¦ since it implements a lisp interpreter directly in c++

In the following link clasp instructs for Debian Linux to install the following packages:

gcc g++ llvm clang-6.0 libclang-6.0-dev cmake libgc-dev libgmp-dev
binutils-gold binutils-dev zlib1g-dev libncurses-dev libboost-filesystem-dev
libboost-regex-dev libboost-date-time-dev libboost-program-options-dev
libboost-system-dev libboost-iostreams-dev libunwind-dev liblzma-dev libelf1
libelf-dev libbsd-dev sbcl

where the last one is SBCL. For MacOS, the instruction says to install the following packages:

cmake llvm@6 libffi bdw-gc gmp boost libunwind-headers sbcl

Again, the last one is SBCL.

I am not sure the purpose of installing SBCL, but it seems compiling clasp from sources depends on it.