Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suggestions for the most appropriate (best) language for programming an embedded system? [closed]

Tags:

embedded

arm

I'm looking at doing embedded coding for a device that's approximately 20MHz, has 6mb ram, with an ARM32 processor. Can anyone suggest the best / most appropriate language for programming an embedded system? I'm considering:

  • Lua
  • TinyPy
  • C
  • Java ME
  • C#
  • someone has suggested JavaScript

Any suggestions? Thanks

Edit - looks like C and Lua are the winners. Cheers all!

Edit - Real Time is not an issue, its more the limited ram/cpu dictating things.

like image 299
Chris Avatar asked Mar 16 '09 03:03

Chris


4 Answers

If you're bringing the device up from scratch or interfacing directly with non-standard peripherals, C is really the only way to go.

If you've already got an embedded OS or can port one without difficulty, you might have more flexibility in adding one of the more script-y languages. C# is out of the question unless you're on WinCE, and then you'll be restricted to .NET Micro.

Beyond that, "best" has little meaning without describing what your device is going to be used for. Some languages have better support for certain tasks than others.

like image 187
HUAGHAGUAH Avatar answered Nov 13 '22 07:11

HUAGHAGUAH


C is probably your best bet for such limited cpu resources.

like image 40
patros Avatar answered Nov 13 '22 08:11

patros


I've used Lua on an ARM OMAP processor. Lua's tight integration with C allows going to the metal whenever you need, and its small size makes it suitable for a wide range of platforms. I developed the UI for my firmware in Lua on my mac and then brought it over to the embedded platform with no changes.

While the OMAP processor was beefy enough to run other languages like Java or Python, I didn't know what hardware I was targeting when I started the code. Lua was a safe bet.

like image 28
Paul Avatar answered Nov 13 '22 09:11

Paul


I'd be tempted to go with straight C, but then I've been writing C for nearly 30 years. Lua and TinyPy seem too new, experimental, to me; embedded devices need to be very robust.

Java ME has good points. I don't know about C# in an embedded world.

like image 24
Charlie Martin Avatar answered Nov 13 '22 09:11

Charlie Martin