From: Stefan Arentz
Subject: Lisp in embedded systems?
Date: 
Message-ID: <87hdayf7yj.fsf@keizer.soze.com>
I'm looking for a new language/environment to do the next version of a
medium sized C++ application in. I'm interested in using a flavour of
Lisp because I think it will allow us to overcome some of C++'s issues.
(Development time, hard to debug, error prone).

However, this has to run on an embedded system. And I'm not sure if that
will work out with Lisp.

The device is small. It just has 2MB flash and 8MB ram. The application
really just needs the basics ... threads, sockets, simple data structures,
no storage and some bindings to C methods in a library.

Performance is not an issue. It just needs to do basic network io
once in a while and control some hardware features.

Am I crazy to even look at lisp here? Can anyone recommend a public (open
source) flavour that would work here? Anyone with real world experience?

 S.

From: George Neuner
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <eaqbm19p4uo6l6m78lbr9mo3vji2amsrvn@4ax.com>
On 31 Oct 2005 08:42:44 +0100, Stefan Arentz <·············@gmail.com>
wrote:

>
>I'm looking for a new language/environment to do the next version of a
>medium sized C++ application in. I'm interested in using a flavour of
>Lisp because I think it will allow us to overcome some of C++'s issues.
>(Development time, hard to debug, error prone).
>
>However, this has to run on an embedded system. And I'm not sure if that
>will work out with Lisp.
>
>The device is small. It just has 2MB flash and 8MB ram. The application
>really just needs the basics ... threads, sockets, simple data structures,
>no storage and some bindings to C methods in a library.
>
>Performance is not an issue. It just needs to do basic network io
>once in a while and control some hardware features.
>
>Am I crazy to even look at lisp here? Can anyone recommend a public (open
>source) flavour that would work here? Anyone with real world experience?

It's tough to give advice without knowing the processor or the tool
chain you need to integrate with.  You might want to look at Lisps
(and/or Schemes) that compile to C.  That way you can leverage any
specialized development tools you may already have.

Even so, 2MB for the application image is pretty tight for Lisp.
There's a reason most embedded programming is done in C (or
derivative).

George
--
for email reply remove "/" from address
From: ···········@gmail.com
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <1130774613.414273.277570@g43g2000cwa.googlegroups.com>
I have done a lot of work in this area.  My pick in restricted
environments is generally tinyscheme, which is an excellent R5RS scheme
that fits in about 1.5M of memory on my windows box.  I have extended
it with FFI to windows and rudimentary support for sockets, and it
still compiles to ~50K on disk.  It runs on everything, and it was a
trivial port to the Sharp Zaurus, according to Heow Eide-Goodman.
http://tinyscheme.sourceforge.net

If you need to go a lot smaller than that, check out Picbit, which is a
scheme for PIC microcontrollers.  I doubt that it would run natively on
your platform, but it would not be a terrible port, most likely.
http://repository.readscheme.org/ftp/papers/sw2003/PICBIT.pdf

If you just cannot live without your 2nd namespace, then Hedgehog lisp
is a good call, but it is pretty big by these standards.

I spent about a month looking for small lisps, and found about 20 of
them, including the ones listed above.  I'll put a summary of my
findings up sometime tonight on my site ( http://www.mattknox.com/ ).
From: Stefan Arentz
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <87r7a1tut8.fsf@keizer.soze.com>
···········@gmail.com writes:

> I have done a lot of work in this area.  My pick in restricted
> environments is generally tinyscheme, which is an excellent R5RS scheme
> that fits in about 1.5M of memory on my windows box.  I have extended
> it with FFI to windows and rudimentary support for sockets, and it
> still compiles to ~50K on disk.  It runs on everything, and it was a
> trivial port to the Sharp Zaurus, according to Heow Eide-Goodman.
> http://tinyscheme.sourceforge.net

I have to admit that both scheme and lisp are mostly new to me. I've
played with scheme a few years ago but i did not consider it to be an
option for this project. I'll look at it again, including tinyscheme.

> If you need to go a lot smaller than that, check out Picbit, which is a
> scheme for PIC microcontrollers.  I doubt that it would run natively on
> your platform, but it would not be a terrible port, most likely.
> http://repository.readscheme.org/ftp/papers/sw2003/PICBIT.pdf

Neh. This is a MIPS based device with at least 6MB available. The biggest
problem is the flash size . the image cannot go beyond +- 2MB of which
almost half is used by linux/modules/userland.

> If you just cannot live without your 2nd namespace, then Hedgehog lisp
> is a good call, but it is pretty big by these standards.

I looked at Hedgehog. Looks very cool.

> I spent about a month looking for small lisps, and found about 20 of
> them, including the ones listed above.  I'll put a summary of my
> findings up sometime tonight on my site ( http://www.mattknox.com/ ).

Awesome.

 S.
From: Juho Snellman
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <slrndmbjv9.a7e.jsnell@sbz-30.cs.Helsinki.FI>
<·············@gmail.com> wrote: 
> However, this has to run on an embedded system. And I'm not sure if that
> will work out with Lisp.
>
> The device is small. It just has 2MB flash and 8MB ram. The application
> really just needs the basics ... threads, sockets, simple data structures,
> no storage and some bindings to C methods in a library.

Hedgehog Lisp (<http://hedgehog.oliotalo.fi/>) is one example of a
small embedded Lisp. It might not be exactly what you want, but should
at least serve as an existence proof and inspiration. It's free
software and small, so adding any missing features should be feasible.

> Performance is not an issue. It just needs to do basic network io
> once in a while and control some hardware features.
> 
> Am I crazy to even look at lisp here? Can anyone recommend a public (open
> source) flavour that would work here? Anyone with real world experience?

Hedgehog is in production use. The guys using it seemed to be very
happy to switch to it from C, despite mostly having little Lisp
experience.

-- 
Juho Snellman
"Premature profiling is the root of all evil."
From: Duane Rettig
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <4y849vern.fsf@franz.com>
Stefan Arentz <·············@gmail.com> writes:

> I'm looking for a new language/environment to do the next version of a
> medium sized C++ application in. I'm interested in using a flavour of
> Lisp because I think it will allow us to overcome some of C++'s issues.
> (Development time, hard to debug, error prone).
>
> However, this has to run on an embedded system. And I'm not sure if that
> will work out with Lisp.

Why not?  Have you heard the rumor that Lisp is Big and Slow?  It seems
that rumor just won't die.

> The device is small. It just has 2MB flash and 8MB ram. The application
> really just needs the basics ... threads, sockets, simple data structures,
> no storage and some bindings to C methods in a library.

Funny; it used to be that 1 Mb _total_ was considered small.  And I
came close, getting lisp inages less than a megabtyte on disk.  But
that was not the same as memory footprint, and my smallest memory
footprint was about 1.5 Mb.

Of course, your mileage depends upon your needs.  If your device
has graphics, then there's a lot more library space required.

> Performance is not an issue. It just needs to do basic network io
> once in a while and control some hardware features.
>
> Am I crazy to even look at lisp here?

Absolutely.  Crazy like a fox.

> Can anyone recommend a public (open source) flavour that would work here?

Why do you need open-source?  Why not just free?  Try out an Allegro CL
trial version.

> Anyone with real world experience?

I've had experience crunching lisp sizes down, both image size and
memory footprint.  But I wouldn't call that real-world experience,
since the "application" involved there was the lisp itself.  We
do have customers, some of whom have successfully put Allegro CL
onto small or memory-limited devices; I won't give any names, but
some do participate in this newsgroup - perhaps they would respond.

And finally, several years ago one of the developers at Franz got
an Allegro CL application to serve as a Netscape plugin, to be used
as a webcam server.  This was back in the days when Netscape and other
web browsers weren't as bloated as they are today, but back then the
Netscape and the plugin fit along with the kernel and the webcam driver
into a linux box with 8 Mb of RAM, and it didn't page at all while
running.  Of course it probably couldn't be done today, because most
programs have grown by hundreds of precent.  However, the base of
Allegro CL has not grown by more that some 10s of percent over the
last 8 or so years, before which it was actually shrinking.

-- 
Duane Rettig    ·····@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182   
From: William Bland
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <pan.2005.10.31.17.16.23.290677@gmail.com>
On Mon, 31 Oct 2005 08:21:16 -0800, Duane Rettig wrote:
> 
> And finally, several years ago one of the developers at Franz got
> an Allegro CL application to serve as a Netscape plugin, to be used
> as a webcam server.

This reminds me... I'm sure I saw some mention a while back of a Plan to
make a Firefox plugin that was a Lisp runtime.  Sounded like a cool idea,
but now I can't find any details - anyone know what happened?

Cheers,
	Bill.
From: Stefan Arentz
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <87mzkptund.fsf@keizer.soze.com>
Duane Rettig <·····@franz.com> writes:

> Stefan Arentz <·············@gmail.com> writes:
> 
> > I'm looking for a new language/environment to do the next version of a
> > medium sized C++ application in. I'm interested in using a flavour of
> > Lisp because I think it will allow us to overcome some of C++'s issues.
> > (Development time, hard to debug, error prone).
> >
> > However, this has to run on an embedded system. And I'm not sure if that
> > will work out with Lisp.
> 
> Why not?  Have you heard the rumor that Lisp is Big and Slow?  It seems
> that rumor just won't die.

No. I started looking at Lisp because I read stories from people who put it
in mars rovers and tiny embedded systems. I just don't have enough experience
to know what is available.

> > The device is small. It just has 2MB flash and 8MB ram. The application
> > really just needs the basics ... threads, sockets, simple data structures,
> > no storage and some bindings to C methods in a library.
> 
> Funny; it used to be that 1 Mb _total_ was considered small.  And I
> came close, getting lisp inages less than a megabtyte on disk.  But
> that was not the same as memory footprint, and my smallest memory
> footprint was about 1.5 Mb.
> 
> Of course, your mileage depends upon your needs.  If your device
> has graphics, then there's a lot more library space required.

No graphics. Just network io, some bindings to C libraries, threads, xml
parsing and exec()uting unix commands on the system.

> > Performance is not an issue. It just needs to do basic network io
> > once in a while and control some hardware features.
> >
> > Am I crazy to even look at lisp here?
> 
> Absolutely.  Crazy like a fox.
> 
> > Can anyone recommend a public (open source) flavour that would work here?
> 
> Why do you need open-source?  Why not just free?  Try out an Allegro CL
> trial version.

Free is fine, but experience learns that having the source code available is
incredibly useful if you are integrating it in something bigger. Oh and this
needs to run on linux/mips. No Allegro version available for that platform
right?

 S.
From: Bulent Murtezaoglu
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <87fyqhv7qq.fsf@p4.internal>
>>>>> "SA" == Stefan Arentz <·············@gmail.com> writes:
[...]
    SA> No. I started looking at Lisp because I read stories from
    SA> people who put it in mars rovers and tiny embedded systems. I
    SA> just don't have enough experience to know what is available. 
[...]

Hmm.  This reminded me of a talk I went to 10 years ago:

http://www.cs.cmu.edu/~chuck/pubpg/luv95.pdf

Perhaps this'll help in some way.

cheers,

BM
From: Christian Lynbech
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <87fyqhz7wh.fsf@chateau.defun.dk>
>>>>> "Bulent" == Bulent Murtezaoglu <··@acm.org> writes:

Bulent> Hmm.  This reminded me of a talk I went to 10 years ago:

Bulent> http://www.cs.cmu.edu/~chuck/pubpg/luv95.pdf

Does anybody what became of "L"? 

I remember digging halfheartedly around for it a few years back with
very little success.

                             -- Christian
From: Bulent Murtezaoglu
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <877jbsveot.fsf@p4.internal>
>>>>> "CL" == Christian Lynbech <·········@defun.dk> writes:
[...]
    CL> Does anybody what became of "L"?

    CL> I remember digging halfheartedly around for it a few years
    CL> back with very little success.

I failed to acknowledge where I found the link:

http://lemonodor.com/archives/000885.html

So apparently the authors do respond to e-mail.  (My interest is 
half-hearted too, so I didn't bug them).  

cheers,

BM
From: Pascal Costanza
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <3smgpfFoq6ffU1@individual.net>
Stefan Arentz wrote:
> I'm looking for a new language/environment to do the next version of a
> medium sized C++ application in. I'm interested in using a flavour of
> Lisp because I think it will allow us to overcome some of C++'s issues.
> (Development time, hard to debug, error prone).
> 
> However, this has to run on an embedded system. And I'm not sure if that
> will work out with Lisp.
> 
> The device is small. It just has 2MB flash and 8MB ram. The application
> really just needs the basics ... threads, sockets, simple data structures,
> no storage and some bindings to C methods in a library.
> 
> Performance is not an issue. It just needs to do basic network io
> once in a while and control some hardware features.
> 
> Am I crazy to even look at lisp here? Can anyone recommend a public (open
> source) flavour that would work here? Anyone with real world experience?

The description of CLisp states that it only needs 4 MB RAM - see 
http://clisp.cons.org/summary.html

Another choice that seems reasonable is OpenLisp, an implementation of 
ISLISP which is more or less a subset of Common Lisp. See 
http://www.eligis.com/


I don't know whether other CL implementations could fit. There are 
probably a number of Scheme implementations which you could use as well.


Pascal

-- 
My website: http://p-cos.net
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/
From: Bob Hyman
Subject: Re: Lisp in embedded systems?
Date: 
Message-ID: <dk5ll5$9ig$1@newsx.cc.uic.edu>
Stefan Arentz (·············@gmail.com) wrote:

: I'm looking for a new language/environment to do the next version of a
: medium sized C++ application in. I'm interested in using a flavour of
: Lisp ...
: However, this has to run on an embedded system. And I'm not sure if that
: will work out with Lisp.

... maybe this:

http://www.ccs.neu.edu/home/matthias/Scheme2000/dube.ps

"bitscheme aka bit; a very compact scheme system for embedded applications;
presented at scheme and functional programming 2000; by D. Dube"

I read this paper a while ago but I haven't had time to explore
it any further.