View Single Post
Posts: 14 | Thanked: 21 times | Joined on Nov 2009 @ Moscow
#1
C is tiresome, C++ is crazy, Python... I have enough Python at my work. Why not use a real programming language to write Maemo apps? So I decided I must have a working Common Lisp compiler on my N900. A good candidate was CLISP as it has an ARM port, good CL standard support plus there was a previous successful effort of porting it to N810.

Making it work on N900 turned out to be very difficult though... After a lot of debugging/hacking/cursing I finally did it, despite bugs like accidental ARM endianness switch due to wrong calling convention. Here is my post to clisp-devel mailing list with attached patches and detailied explanation of what was done.

The port is not of production quality yet, so use it at your own risk. The patch was made against CVS head (clisp-2.48+) and it still has some stability issues. I've tried to build debs, but resulting clisp build was crashing at CFFI callback tests, so I'm not releasing them until I find out what causes the crash.

Stuff I tested with this clisp build:
  • SWANK - it's possible to connect from Emacs, didn't
    try it from Emacs running on the device itself though;
  • cffi - most tests pass, there are two unexpected failures
    related to floating point numbers;
  • cl-gtk2 - demos seem to work.
  • cl-sqlite - all tests seem to pass fine
  • some other important libs, like cl-ppcre, alexandria etc.

I'm including the clbuild archive I've made that contains the most common libraries. I've had to patch asdf-for-clisp (problems with RUN-PROGRAM), trivial-features (was pushing :NIL to *features* due to unfamiliar ARM architecture) and cl-gtk2 (wasn't compatible with gtk2 v2.14). Unfortunately I was unable to run the latest cl-gtk2 yet (it crashes).

Installation:
Code:
cd /home/user/MyDocs
wget http://depni.sinp.msu.ru/~ivan_iv/clisp-binaries-2-48+-2010-01-27.tar.gz http://depni.sinp.msu.ru/~ivan_iv/clbuild-2010-01-27.tar.gz
tar -C / -xzf clisp-binaries-2-48+-2010-01-27.tar.gz
tar -C / -xzf clbuild-2010-01-27.tar.gz
After that, you may start CLISP using the command:
Code:
/opt/clbuild/clbuild lisp
In order to load cl-gtk2 and see some gui demos, tell it
Code:
(asdf:oos 'asdf:load-op 'cl-gtk2-gtk)
(gtk-demo:demo-text-editor)
SWANK can be started using the following command (forward
port 4005 to your pc via ssh):
Code:
(swank:create-server :coding-system "utf-8")
I've set up temporary git mirrors of CLISP and ffcall CVS repositories with Maemo-related patches applied:
Finally, here are some screenshots:

cl-gtk2 demo:


CLISP in xterm:


EDIT: 2010-03-02: after much struggle, I've resolved shared libraries-related issue in ffcall (see changes in github repositories above) and managed to build .debs for clisp and related libraries. No common-lisp-controller or anything like that, though. Use clbuild from the archive above, asdf-install or other tool/library set you like. So, here are the debs (probably will make them apt-get installable, but a bit later):

Last edited by fionbio; 2010-03-02 at 02:10.
 

The Following 16 Users Say Thank You to fionbio For This Useful Post: