ECL

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Embedded Common Lisp)
 
(Embedded Common Lisp)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
== 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.
 
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.
 +
<p>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.</p>
 +
<p>But is ECL useful on Openmoko? Benchmarks are useless, but amusing. With the fibonacci function from [http://picolisp.com/5000/-2-F.html PicoLisp Wiki],
 +
<pre>
 +
(defun fibo (N)
 +
  (if (< N 2)
 +
      1
 +
      (+
 +
        (fibo (- N 1))
 +
        (fibo (- N 2)))))
 +
</pre>
 +
and its Python equivalent,
 +
<pre>
 +
def fibo(n):
 +
        if (n < 2):
 +
                return 1
 +
        else:
 +
                return fibo(n-1) + fibo(n-2)
 +
</pre>
 +
(yes, it's not the most efficient way to compute Fibonnacci numbers), I got the following results for (fibo 40):
 +
<table border="1">
 +
<tr>
 +
<td>Processor</td><td>CL implementation</td><td>Time, s</td><td>Python time, s</td>
 +
</tr>
 +
<tr>
 +
<td>x86 CoreDuo</td><td>SBCL</td><td>5.8</td><td>121.3</td>
 +
</tr>
 +
<tr>
 +
<td>old PPC</td><td>OpenMCL</td><td>18.4</td><td>479.5</td>
 +
</tr>
 +
<tr>
 +
<td>FreeRunner's ARM</td><td>ECL, interpreted</td><td>X</td><td>X</td>
 +
</tr>
 +
<tr>
 +
<td>FreeRunner's ARM</td><td>ECL, compiled</td><td>254</td><td>X</td>
 +
</tr>
 +
</table>
 +
(X = aborted/not run)
 +
</p>
 +
<p>And for (fibo 30) on FreeRunner only:
 +
<table border="1">
 +
<tr>
 +
<td>Implementation</td><td>Time, s</td>
 +
</tr>
 +
<tr>
 +
<td>ECL, interpreted</td><td>15</td>
 +
</tr>
 +
<tr>
 +
<td>Python</td><td>10</td>
 +
</tr>
 +
<tr>
 +
<td>ECL, compiled</td><td>2</td>
 +
</tr>
 +
</table>
 +
</p>
 +
There are lots of python code for FreeRunner, so I see some potential for Common Lisp, too.
 +
[[Category:Application Developer]]

Latest revision as of 14:05, 21 May 2010

[edit] 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

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.