maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   CLISP 2.48+ with FFI on Maemo Fremantle (https://talk.maemo.org/showthread.php?t=42339)

fionbio 2010-01-26 22:44

CLISP 2.48+ with FFI on Maemo Fremantle
 
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:
http://i.imgur.com/FcwdC.png

CLISP in xterm:
http://i.imgur.com/yP73Y.png

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):

jeddak 2010-01-27 00:16

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
This is very cool, and a testimony to the openness of Maemo 5. I hope this is an indicator of a diverse future software ecosystem for Nokia tablet devices. It's good to have an alternative to the monoculture platforms!

ebzzry 2010-01-27 02:34

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
Sweet! Thanks a lot!

macdice 2010-02-01 21:27

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
I've been using this for the past few days to hack with SLIME on the device - it works very nicely - thanks! I was experimenting with building stand-alone executables (with EXT:SAVEINITMEM) but it seems that any image containing GTK locks up chewing CPU when you reload it (and I'm not familiar with Clisp and don't have gdb on my phone so I'm not sure how to get more details about what it's doing). Am I doing something stupid or is that the kind of stability problems you're talking about?

It's a great hack anyway, bravo! I look forward to apt-getting it one day.

fionbio 2010-03-02 02:13

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
I've managed to build clisp .debs and added corresponding links to the first message in this topic. Now I will try to find out what's wrong with EXT:SAVEINITMEM.

ebzzry 2010-03-11 02:00

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
Quote:

Originally Posted by fionbio (Post 551903)
I've managed to build clisp .debs and added corresponding links to the first message in this topic. Now I will try to find out what's wrong with EXT:SAVEINITMEM.

Thanks, yet again.

LuciusMare 2010-03-27 14:59

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
Great! I vote for getting it to the repos :)

rm53 2010-04-15 20:15

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
for me as a lisp man who is not fluent in mangling .deb and all sorts of libs it would be wonderful to have clisp in apt-get repos!

Keep up your great efforts.

rm53 2010-06-30 12:21

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
nothing new here? I am waiting hard for a real Maemo CLISP package...

jean 2010-09-09 14:21

Re: CLISP 2.48+ with FFI on Maemo Fremantle
 
Thank you very much for this excellent work. Today I installed CLISP on my N900 both under Maemo5 and also “chrooted” under Easy Debian. It works fine and I’m very happy to use it together with Maxima.


All times are GMT. The time now is 00:10.

vBulletin® Version 3.8.8