A lisp oriented question - interning symbols for use in Maxima
Subject: A lisp oriented question - interning symbols for use in Maxima
From: Žiga Lenarčič
Date: Tue, 20 Oct 2009 23:25:33 +0200
> Clo*z*ure CL/OpenMCL looks good, but I was actually hoping against
> hope that
> Clo*j*ure (the JVM-based Lisp) somehow had a CL compatibility
> scheme that
> would let us run Maxima so we could then have native access to Java
> libraries....
I've looked into both Clojure and ABCL.
Clojure is so far from CL that porting Maxima is IMHO not possible -
the only way would be a rewrite. If CL is a land of many options
(imperative, functional, object oriented programming), Clojure is
much more focused on functional programming (immutable data
structures) with some nice new abstractions. Speedwise it's not as
good as fast CL implementations, except on some tests where the
compiler manages to unbox variables in loops.
ABCL on the other hand is a full CL and runs Maxima, but cannot dump
a lisp image yet. Accessing java from ABCL is a bit convoluted, but
it works. A big difference is that in ABCL everything is derived from
a Java class LispObject, while Clojure tries to stay close to Java -
i.e. Clojure strings are Java String objects, numbers are Java's
Integer/Bignums... so interaction with Java is much simpler - Java
and Clojure share some datatypes... ABCL has to conform to ANSI CL,
so it has to sacrifice performance. JVM isn't exactly built for
implementing Common Lisp.
A rewrite in Clojure is probably not worth it (and even not possible
without some devoted programmers with a lot of time on their hands).
I think it's better to stick to CL since fast implementations are
already available and accessing C libraries is not an issue in any CL
implementation but GCL - if Maxima would benefit from external
libraries.
Regards,
Ziga