Pergunta

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!

Outras dicas

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.

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.

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top