3

I'm looking for a fast interpreted language for a microcontroller.

The requirements are:

  • should be fast (not crucial but would be nice)
  • should be light on data memory (small overhead <8KB, excludes program variable space)
  • preferably would be small in program size and the language would be compact
  • preferably, human readable (for example, BASIC)

Thanks!

Thomas O
  • 6,026
  • 12
  • 42
  • 60
  • 1
    related: [What are the available interactive languages that run in tiny memory?](http://stackoverflow.com/questions/1082751/what-are-the-available-interactive-languages-that-run-in-tiny-memory) – David Cary May 28 '11 at 04:09

4 Answers4

1

This is a bit generic: there are many kinds of Microcontrollers, and thanks to technologies like Jazelle, it is possible to run hardware-accelerated Java on Microcontrollers. (if... your microcontroller supports it)

For a generic answer: Forth is commonly referenced. But really, you need to be far more specific with your question.

Dragontamer5788
  • 1,957
  • 1
  • 12
  • 20
0

Micro-controllers come in a vast variety of architectures. There are small 8-bit families, 32-bit families with simple architectures and 32-bit families with MMU support, suitable for running a modern OS. If you don't state which family you are targeted at, it is impossible to answer your question.

Anyway, for 8-bit families the best you can get is a BASIC variant. See Bascom for example. Note that this would be a compiler version of the "interpreted" language. If you actually want to have a runtime or an interpreter that will execute your code, then you most probably need to install an operation system in your microcontroller.

kgiannakakis
  • 103,016
  • 27
  • 158
  • 194
0

There were a variety of interpreted languages for small micros back in the late 1970's and 1980's. They seem to have mostly fallen out of fashion. I'd like to have a p-code based C compiler for the PIC18 that could coexist nicely with my other C compiler; for much of my code I'd be willing to accept a 100-fold slowdown for a 50% space reduction (so long as I could keep the important stuff in native code). I would think that would be achievable, but I'm not about to implement such a thing from scratch myself.

supercat
  • 77,689
  • 9
  • 166
  • 211