1

I am looking for the best scripting language interpreter for cross compiling to an ARM processor. Here are the requirements for "best":

  • Its small. Ideally, I'd like to be able to decide which parts of the language and "standard" libraries that are supported. (For instance: file system, nah don't want that. Floating point math, nope don't want that either.)

  • Its easy. Ideally, I'd like some documentation/tutorial/examples on how to do the cross-compile.

The goal: I'm writing a small, simple web server in an embedded ARM device and I'd like to do some string processing easily. The code is currently written in C.

I'd like the server and system-level code to be in C. I'd like to write the web "application" in a scripting language. The language features I'm most interested in are:

  • built-in string support
  • built-in regex support
  • built-in map support (i.e key-value pairs object)

I'd like the "best" to come from the following list: Perl, Python, Ruby, Lua. But I would be open to other language suggestions.

Kalana
  • 5,631
  • 7
  • 30
  • 51
Josh
  • 21
  • 1
  • 4
  • 1
    "scripting languages", at least among the ones you mentioned, don't need to be cross compiled, or compiled at all. ARM is a pretty powerful platform, and won't represent much of a constraint on your choice of languages; You should probably select a platform that suits your development process and experience"scripting languages", at least among the ones you mentioned, don't need to be cross compiled, or compiled at all. ARM is a pretty powerful platform, and won't constrain your choice of languages; You should probably select a platform that suits your development process and experience. – SingleNegationElimination Jul 17 '11 at 22:57
  • Hi, I've updated my post. I meant "scripting language interpreter", not "scripting language". For instance, I would like to do the following in C: MyAwesomeInterpreter(my_awesome_script_char_array); – Josh Jul 17 '11 at 23:00
  • Ahh, so you want to know how to use those languages on arm. In each case, however you've been cross compiling your C is still valid, since each of those languages are in C. If you are hosting on linux, most distros that support arm already support those languages in their package repositories. – SingleNegationElimination Jul 17 '11 at 23:03
  • Hi, this is my "problem", not hosted on linux. No OS, no RTOS. BTW, I already know Perl, Python, Ruby (which is why I listed them). I've read Lua is small and powerful for embedding in applications (although not necessarily embedded applications), so I also put it on the list. Ideally, a link to "here is how to compile language X for ARM" would be ideal :-) – Josh Jul 17 '11 at 23:08

1 Answers1

7

I would consider Lua.

Lua is distributed in a small package and builds out-of-the-box in all platforms that have an ANSI/ISO C compiler. Lua runs on all flavors of Unix and Windows, and also on mobile devices (such as handheld computers and cell phones that use BREW, Symbian, Pocket PC, etc.) and embedded microprocessors (such as ARM and Rabbit) for applications like Lego MindStorms.

Lua compared to Python

(Note: I really like Python and for general purpose scriping would prefer it to Lua but in terms of portability and performance on embedded processors I'd lean towards Lua).

Community
  • 1
  • 1
Guy Sirton
  • 8,331
  • 2
  • 26
  • 36
  • Thank you for the informative links. ATM, Lua is the winner of this poll. – Josh Jul 17 '11 at 23:51
  • 1
    @Josh, you should look more specifically at eLua (http://www.eluaproject.net/) that supports ARM7, ARM9, Cortex-M3 (http://wiki.eluaproject.net/Boards). – Clement J. Jul 18 '11 at 21:37