I’m part of a team developing embedded applications for ARM9-devices with 16mb ram and it’s own OS. We’re currently developing in C, but are all geared towards switching the language to something else.
Currently C++ and Haskell are good candidates, but I’m thinking on Coffee-script. The question is if Chrome’s v8 engine would use to much ram for this to be a viable alternative? If so, is there any other that might fit the bill?
Forgot to mention, i need easy interop with the C libraries installed on the system. As most code we have today is C, and there will be a long re-writing period, using C functions should not be a hassle (having to create bindings etc.).
Unfortunatly, we are also bound by an old compiler (GCC 3.4.3).
Any language with automatic memory management will always have memory overhead and any dynamically typed language will always add some more overhead. So if you are limited to 16 MiB and want to squeeze out a lot of it, go with something with static typing and explicit memory management, which means C++.
Modern C++ (ok, no C++11 features in gcc 3.4.3, but the standard library was already there and boost should compile) will still do most memory management for you while still keeping the overhead low. And being almost backward compatible to C makes interoperating with existing libraries trivial.
If you don’t need to squeeze out that much, many languages will do. Mono seems quite promising as it’s one of the smallest managed runtimes, decently fast, portable and has multiple languages targeting it (C#, F#, boo etc.). But I suppose even JavaScript should do; it’s interpreter is very small and if you don’t need that many objects in memory, they will fit even with all the overhead of allocating everything separately.