robert-strandh / Bootstrap-Common-Lisp

An implementation of Common Lisp with the sole purpose of bootstrapping other implementations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raison d'être [was: Implementation Language]

opened this issue · comments

BOCL is (or rather, will be) implemented in ISO C.

Why C?

I may be wrong, but I have heard that C is one of the few languages
allowed by some OS distributions for their packages, so that some
software can be installed from source with only a C compiler and
the associated tool chain.

What other language did you have in mind?

I think Rust should be given serious consideration in this context, as a much better and very popular alternative to C.

Also, this would effectively port Common Lisp to WebAssembly and Cloudflare Workers, an extremely exciting prospect!

(edit: Actually it seems that Cloudflare Workers supports C natively, but still...)

I see. But when language is a choice, the obvious choice is Common
Lisp. The purpose of the SICL project is to create a Common Lisp
system written entirely in Common Lisp. That way, we do get to Lisp
as soon as possible, namely from the start. I personally think it is
a very bad idea to write a Common Lisp system in anything other than
Common Lisp, and I would rather not need BOCL at all. In fact, I have
a few videos entitled "Creating a Common Lisp implementation" that
explain the problems with using anything other than Common Lisp.

So the only reason for BOCL to exist is that a Common Lisp system
written in Common Lisp, or in anything other than C (perhaps there are
some other options, I don't know), is not acceptable to some OS
distributions. And the only purpose of BOCL is as a Common Lisp
implementation that can be used to bootstrap a "real" Common Lisp
implementation written in Common Lisp. Hence the very strange
objectives of BOCL that favor simplicity and maintainability over
performance.

I may never finish BOCL because I don't really care much about SICL
being installable as a package of such an OS distribution, so you can
see the project as a voice of protest against the restrictions imposed
by such a distribution.

Sure, there could very well be some other uses for a Common Lisp
system written in something other than Common Lisp, but I already have
a lot on my plate, so I am not planning any such project.

Actually, BOCL turns out to be an interesting intellectual tool, no
matter what language is used for it. Thinking in terms of simplicity
and maintainability rather than performance is surprisingly hard,
mainly because it is so "natural" to want to optimize performance.

I think you're overcomplicating this by an order of magnitude.

AFAIK, BOCL is an attempt to get a Common Lisp implementation on a platform which has no existing CL implementation available, in order to have a stepping stone for building e.g. SICL or SBCL. In practice, it doesn't matter if BOCL ends up being written in C or D or Pascal or Ada or whatever; all it needs is to require a compiler which is easy enough to build from "nothing" and run on various platforms (such as e.g. GCC, or Tiny C Compiler for C).

ECL and CLISP already kinda fit that description, since they can be built from just a C compiler, but they also try to be general-purpose CL implementations as well, with big bytecode compilers, optimizers, FFI modules, and all that other stuff that's useful for end users.

BOCL doesn't aspire to be a general-purpose CL implementation, which means that it can be greatly simplified compared to ECL or CLISP. That in turn means that it can be more easily inspected and modified, which is valuable when it comes to bootstrapping stuff.