4

I need to deploy a dynamic language to a small embedded Linux device, and have difficulty finding the right one: I want to build a small web-application with this language (with a small framework like Sinatra or Camping ) and write some scripts for maintenance.

I would prefer Ruby, as I have some experience in it, but after several days of trying to cross-compile it, I could only build the barebone interpreter, without the libs (miniruby). The problem with it is, that it's just Too Damn Large: more than 1 MB stripped!

What language are you using, and how difficult was it to get it working?

Zoltán Szőcs
  • 1,141
  • 2
  • 11
  • 23
  • See this question for several related options: http://stackoverflow.com/questions/1082751/what-are-the-available-interactive-languages-that-run-in-tiny-memory – Mark Rushakoff Apr 26 '10 at 16:12

4 Answers4

5

I don't use it personally but lua has a very small footprint.

mikerobi
  • 20,527
  • 5
  • 46
  • 42
  • a co-worker of mine has had great success with lua. Depending upon your needs it can get pretty small as well. – Beanish Apr 26 '10 at 15:23
  • I'll second this. Lua is quite easy to get going since it will pretty much compile as ANSI C89 (as either C or C++). Feel free to check out eLua, which also has some patches and modules that make it suitable for microcontroller environments: http://www.eluaproject.net/ (the whole project might not meet your needs, but some of the ideas/patches/code might be useful) – James Snyder May 03 '10 at 04:33
1

Dynamic languages are very, very hard to minify. Perhaps tinypy will give you some inspiration for squeezing out more.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
1

I am investigating this myself, and I have found some interesting candidates:

  • eLua - An implementation of Lua specifically for embedded devices.
  • p14p - Python on a chip.
  • Forth - Good old Forth, what more can I say?
cdiggins
  • 17,602
  • 7
  • 105
  • 102
  • Just a small update: since then I have successfully compiled & used Ruby, with mixed results: it is fully functional, and it made my life easier implementing the webservice, but on the other side it is fairly slow, and somewhat a memory hog. – Zoltán Szőcs Mar 01 '11 at 15:43
0

I'm using ruby 1.8.7 on a Techbase NPE GPRS modem. It has a 180MHz ARM processor, and has a lot of services already on it (eg Apache, embedded PostgreSQL). Works fairly well, but you need to be aware of a few issues with ruby on it (eg Timeout can cause ruby to SegFault).

Planning to move up to ruby1.9 later in the year...