Question

As we know, Maxima is based on common lisp. I'm writing a lisp program working in Maxima; using Maxima procedures. I press argument "maxima -p foo.lisp" to load the lisp file, and it works well. However, I'm poor at programming, so my programs have many bugs. I want to debug my program, but I realize that it is not so easy.

I got used to slimv, a vim-script to extend lisp support of vim. Slimv is an awesome tool, which contains swank to connect between slimv and lisp interpreter, but when I loaded 'start-swank.lisp' in the Lisp Mode of Maxima, it returned an error:

>> Error in CONDITIONS::CLCS-LOAD [or a callee]: The variable *LOAD-TRUENAME* is unbound.

I realized that it is due to gcl. So I came to search for maxima-sbcl. However, there's no official package of maxima-sbcl. I was disappointed.

I wonder whether I can load the whole maxima into sbcl. If so, I can read it in REPL of swank, and debug my program successfully.

Or is there anybody who has better ideas?

Was it helpful?

Solution

I've come across this project, which might be what you're looking for
https://github.com/filonenko-mikhail/embeddable-maxima

This is the developer's blog (Russian) which mentions usage nuances

OTHER TIPS

Browsing the Maxima documentation, it seems that the source code can be compiled by SBCL:

Notes on Lisp implementations for Maxima:

2 3 Clisp, CMUCL, Scieneer Common Lisp (SCL), GCL (ANSI-enabled only) 4 and SBCL can compile and execute Maxima

You might get some traction this way:

[1] Load up your SBCL (and default core file).
[2] Load Maxima into that lisp session
[3] Save the core file
[4] Kill the swank server
[5] Replace the old core file with the new core file
[6] Restart the swank server

Alternatively, check the 'ports' page on the Maxima site. I found a SBCL fink port of Maxima for OS X there.

About rebuilding Maxima with just Lisp, see INSTALL.lisp in the Maxima source code. http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=tree

The method described by INSTALL.lisp makes use of defsystem. You can, alternatively, use ASDF. Assuming you have the source code unpacked, you should be able to do just

(require 'asdf)
(asdf:operate 'asdf:load-op :maxima)

and then dump out the Lisp image or launch Maxima immediately,

(cl-user::run)

Note: probably I've omitted some details about the ASDF approach.

Sorry for the late reply. Leaving this here in case someone finds it by searching.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top