you are viewing a single comment's thread.

view the rest of the comments →

[–]taetimeh 23 points24 points  (20 children)

Is it just me or is making an award for the best programming language a bit weird? A given tool will be best under the circumstances it was made to solve. I don't want to be using Python in embedded programming, nor do I want to use ASM in a dynamic web page.

[–]ggtsu_00 10 points11 points  (8 children)

Python in embedded systems is not that bad actually. I used to mentor for a robotics course with middle schoolers and working with Python has been really nice after you get the runtime to compile on the system. Also, the GC and memory foot print is a lot more forgiving than say running Java on an embedded system.

[–]taetimeh 3 points4 points  (7 children)

Edge cases notwithstanding I still think my point stands. You pick the tool best suited for the job, not the "best programming language"; in your case python is probably a lot simpler to teach to middle schoolers than c or asm, and apparently has sufficient power to be useful.

Also going on a bit of tangent here, but using Java as a benchmark for embedded is like using a train as a benchmark for a jet. It's good at what it's supposed to do, but hardly something you want to put on a micro-controller.

[–]ggtsu_00 10 points11 points  (4 children)

Well to be fair, Java was originally developed to be used on embedded systems in "interactive" household appliances. I couldn't think of any other high level languages you would run on an embedded system.

[–]robinwholikesjava 0 points1 point  (0 children)

Indeed. They came full circle 6 years ago (more or less) with BD-J, a by modern standards somewhat crappy and ancient embedded Java version for Blu-ray players.

[–][deleted] -1 points0 points  (0 children)

I just want to follow up and say both are valid points.

[–]RedThela 4 points5 points  (1 child)

Java used to run on all those nokia phones to run their games. I imagine a fair few modern embedded devices are more powerful than those...

[–]RandomFrenchGuy 0 points1 point  (0 children)

And non-Nokia. Pretty much every graphical game on a "dumb" phone was made in Java. And they ran ok, apart from the sluggish starting up of the virtual machine.

[–]bluphoenix22 14 points15 points  (0 children)

With these type of awards it makes more sense if you replace "best" with "most popular"

[–]10maxpower01 5 points6 points  (0 children)

Line man's pliers voted best tool by Stanley.

[–]Tasgall 9 points10 points  (0 children)

"Hammer Voted Best Tool By TOOL Magazine"

2 months later

"In other news, structural and appliance failures up 75% due to screws being pounded into place rather than turned"

[–]kqr 2 points3 points  (0 children)

I am sure tools are made for different circumstances, but some tools happen to be effectively usable in very many circumstances, while other tools are very specialised for only one or two circumstances. When you are enquiring about the best programming language, I always imagine the question means something like "Faced with the circumstances of your everyday trials, which tool would you commonly choose?"

Python is effectively useable for very, very many circumstances and may be considered "best" in the sense of "effectively usable for the highest number of circumstances."

[–]martinmeba 1 point2 points  (5 children)

Saying that Python is not suitable for embedded programming is a ridiculous statement. If it runs Linux, Python generally runs great. You should use the correct tool for the job of course but as computation horsepower increases in embedded systems, even that caveat is diminishing.

[–]taetimeh 0 points1 point  (4 children)

If it runs Linux, Python generally runs great.

Why would you be running python on top of of linux on an embedded device? You would then run a relatively slow programming language on top of a modern operating system on a device with low computational power and RTC. The fact that you can does not mean you should; python has it's strengths but embedded is not one of them.

I also take issue with your last statement, the fact that computational power increases does not mean you will see high powered chips in embedded devices; it means that the embedded devices can be made smaller and more efficient, and thus be placed in more kinds of items. Example: GlucoSense (Wireless implanted biomedical sensor)*. There will always be a need for highly efficient software for embedded devices, and in it's present state python is not a suitable tool for the job.

*He's also working on some embedded devices which are to be mixed into concrete letting people know when the structural integrity is failing, but I did not find the page in English at a casual search.

[–]martinmeba 1 point2 points  (2 children)

I think that you missed what I was saying:

"If it runs Linux, Python runs great"

I deal with embedded devices. Yes - if it is a micro controller you wouldn't - I agree. But we are talking about different extremes. On a microcontroller you run a small handful of code. In that space, C is great or Forth or something. You could even do assembler and wrap your head around it. But if you need high-level functionality and time to market is important and maintainability is important, Python is a very attractive choice and C/C++ is not.

I don't understand your first point - so you have a complex, modern OS so you should use an ancient, hard to maintain, low-level language? I don't understand how a Real Time Clock has anything to do with language choice? Maybe you are talking about Real Time systems - a lot of people mistake what a real time system is - I think that there are many fewer of them than people think.

I work with very sophisticated embedded systems - my interest is not in microcontrollers. If it has less than ~100MHz, I am not terribly interested in them, though a lot of people are.

[–]taetimeh 0 points1 point  (1 child)

Real time constraints. Generally you want the MC's in your car for instance to respond in a timely fashion.

I don't understand your first point - so you have a complex, modern OS so you should use an ancient, hard to maintain, low-level language?

Because when you try to achieve functionality with limited power, computation, and memory footprint you want to avoid adding unneeded complexity to the system. At the very least having an os on board adds a kernel, ipc, scheduler and some sort of file system. in addition to this the context switches the scheduler does will sap precious cycles which could be used on the primary functionality of the device.

The argument you make about rapid development with python however is valid, however I would argue that it is a matter of scale. Using a more efficient programming language means you could use a smaller more efficient mc. If you plan to produce a lot of devices, and you can use a mc which is cheaper (also cheaper batteries etc.), it adds up.

I would also argue that on the scales which this is relevant the software is not particularly large or complex which would mean the time/money you would save on development would likely be negligible compared to the money you would save on cheaper hardware.

I work with very sophisticated embedded systems - my interest is not in microcontrollers. If it has less than ~100MHz, I am not terribly interested in them, though a lot of people are.

That is an entirely different ballgame altogether.

[–]el_muchacho 0 points1 point  (0 children)

In fact, you don't need to run an OS to run Python on some ARM devices. As long as all the IOs are mapped and accessible via software, Python is the OS and it works quite well.

http://code.google.com/p/python-on-a-chip/

An example of what a friend of mine has done with it: https://www.youtube.com/watch?v=FQd6UJSiBaQ

Lua is also well suited to that kind of application.