Porting SBCL Common Lisp to Haiku

I am on the way to port SBCL Common Lisp (http://sbcl.org/) to Haiku.

SBCL is The Common Lisp ™ in almost all respects. It is open source, standard compliant, is ported to many operational systems and hardware architectures and has high performance. All new technologies, infrastructure and packages written in Common Lisp are usually firstly and primarily target SBCL implementation.

My ultimate goal is to upstream all the code to SBCL and to provide Haiku hpkg in Depot. I contacted SBCL team and with their assistance (better said, trying their code) the process seems to progress.

I will post here about important milestones. If somebody is interested in joining, he/she is/are welcome. Additionally, I would like to avoid duplication of the effort. If you know of any previous work done in this direction, I would be happy to use it.

1 Like

There is a recipe for ecl in haikuports https://github.com/haikuports/haikuports/blob/bf5779343db785b3a1e3aeada09eedf65f745e87/dev-lisp/ecl/ecl-16.1.3.recipe
Maybe you could have a look there while you start :slight_smile:

Thank you @Begasus. Of course I get this recipe and am going to contact its author (@KapiX). At very least, ECL can help bootstrapping SBCL. I didn’t look inside, but I doubt its code can help implementing some SBCL internals.

The philosophy of ECL is to implement Common Lisp standard in C and rely on C portability to provide the support for all operational systems and architectures. The philosophy of SBCL is to provide as much as possible native support for each system configuration. This usually makes it perform much better. Do not forget that garbage collection, threads, big integer calculus, unicode characters, signal processing, filesystem support and so on are outside of C standard. And many semi-standard libraries provide uniform support for them without taking in consideration particularities of each combination.

Haiku specific code was committed to SBCL master (https://sourceforge.net/p/sbcl/sbcl/ci/3fbb204b46ded6cab4f7249bf6ebf645301228f7/, https://sourceforge.net/p/sbcl/sbcl/ci/80e574014f25623ca70c96fec386c2a1550c8523/).

All work was done and committed by Douglas Katzman, a member of SBCL hackers team. My involvement was in a neighborhood of 0, as to speak mathematically. The good news is all the code is by default up-streamed, Haiku is treated as all other OSes and eventually will be a first-class citizen when the port becomes stable enough.

In order to run SBCL one needs a small native application sbcl (similar to java) and one binary image file of compiled Common Lisp code with all ANSI Common Lisp standard in it (similar to Java classpath, rt.jar). These artifacts already can be produced and it is possible to write some simple programs in it. However, the port needs to be finished, polished and to pass the tests.

4 Likes