ECL

From Openmoko

Revision as of 13:05, 21 May 2010 by Yavannadil (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Embedded Common Lisp

It's possible to "apt-get install ecl" on Debian on FreeRunner, but as of 23.11.2009 prepackaged ecl fails with "Absurd stack bottom value". This error is due to libgc, which tries to obtain stack bottom from /proc/self/stat and fails. The workaround is to build ecl from source, configuring it with "--enable-boehm=included" and building garbage collector with USE_LIBC_PRIVATES defined. Worked for me with ecl 9.10.2.

In QtMoko v22, prepackaged ecl "0.9j (CVS 2008-02-16 11:33)" works, but doesn't understand Unicode, so source package 10.3.1 needs to be installed.

But is ECL useful on Openmoko? Benchmarks are useless, but amusing. With the fibonacci function from PicoLisp Wiki,

(defun fibo (N)
   (if (< N 2)
      1
      (+
         (fibo (- N 1))
         (fibo (- N 2)))))

and its Python equivalent,

def fibo(n):
        if (n < 2):
                return 1
        else:
                return fibo(n-1) + fibo(n-2)

(yes, it's not the most efficient way to compute Fibonnacci numbers), I got the following results for (fibo 40):

ProcessorCL implementationTime, sPython time, s
x86 CoreDuoSBCL5.8121.3
old PPCOpenMCL18.4479.5
FreeRunner's ARMECL, interpretedXX
FreeRunner's ARMECL, compiled254X

(X = aborted/not run)

And for (fibo 30) on FreeRunner only:

ImplementationTime, s
ECL, interpreted15
Python10
ECL, compiled2

There are lots of python code for FreeRunner, so I see some potential for Common Lisp, too.

Personal tools

Embedded Common Lisp

It's possible to "apt-get install ecl" on Debian on FreeRunner, but as of 23.11.2009 prepackaged ecl fails with "Absurd stack bottom value". This error is due to libgc, which tries to obtain stack bottom from /proc/self/stat and fails. The workaround is to build ecl from source, configuring it with "--enable-boehm=included" and building garbage collector with USE_LIBC_PRIVATES defined. Worked for me with ecl 9.10.2.

In QtMoko v22, prepackaged ecl "0.9j (CVS 2008-02-16 11:33)" works, but doesn't understand Unicode, so source package 10.3.1 needs to be installed.

But is ECL useful on Openmoko? Benchmarks are useless, but amusing. With the fibonacci function from PicoLisp Wiki,

(defun fibo (N)
   (if (< N 2)
      1
      (+
         (fibo (- N 1))
         (fibo (- N 2)))))

and its Python equivalent,

def fibo(n):
        if (n < 2):
                return 1
        else:
                return fibo(n-1) + fibo(n-2)

(yes, it's not the most efficient way to compute Fibonnacci numbers), I got the following results for (fibo 40):

ProcessorCL implementationTime, sPython time, s
x86 CoreDuoSBCL5.8121.3
old PPCOpenMCL18.4479.5
FreeRunner's ARMECL, interpretedXX
FreeRunner's ARMECL, compiled254X

(X = aborted/not run)

And for (fibo 30) on FreeRunner only:

ImplementationTime, s
ECL, interpreted15
Python10
ECL, compiled2

There are lots of python code for FreeRunner, so I see some potential for Common Lisp, too.