Author Topic: Who should write embedded software?  (Read 21084 times)

0 Members and 1 Guest are viewing this topic.

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18586
  • Country: nl
    • NCT Developments
Re: Who should write embedded software?
« Reply #100 on: June 18, 2014, 09:34:24 am »
Don't mistake the tool for the engineer, as mentioned Ateml is using the Visual Studio shell. It's also very straightforward to use VS with makefiles to do embedded work. At the risk of starting another religious war I find it to be one of the best IDEs on the market.
Have you tried Eclipse? The last time I used VS (a couple of years ago) it was a huge step backwards compared to Eclipse.
Quote
Also, while I agree that Java and C# have no place in performance critical code they are still extremely valuable languages. I challenge anyone to find a language that's more productive for building UI than C# and with C++/CLI you have an extremely seamless access to native code interop. There's many support parts of building embedded systems where tools like these can be extremely valuable.
I guess it depends on the framework you are using. C++/MFC is one of the least productive ways to write a GUI. However frameworks like WxWidgets or Qt make it much easier to write (portable!) GUI programs using almost any programming language. C# is just limited to Windows.

One of my backburner projects is getting embedded Lua to work on an LPC1768. One of the problems I see with using C/C++ is that it is easy to shoot yourself in the foot. It makes sense to use a language which protects the programmer from making mistakes with pointers and buffer sizes. Another language I wanted to try on a microcontroller is Ada. According to some people Ada is excellent for mission critical software. The last time I looked there was no useable ARM port.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1303
  • Country: no
Re: Who should write embedded software?
« Reply #101 on: June 18, 2014, 10:07:59 am »
One of my backburner projects is getting embedded Lua to work on an LPC1768. One of the problems I see with using C/C++ is that it is easy to shoot yourself in the foot. It makes sense to use a language which protects the programmer from making mistakes with pointers and buffer sizes. Another language I wanted to try on a microcontroller is Ada. According to some people Ada is excellent for mission critical software. The last time I looked there was no useable ARM port.

eLua and Gnat seems to be there?
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3399
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Who should write embedded software?
« Reply #102 on: June 18, 2014, 12:29:28 pm »
I'm not really seeing use for a program running a program/script, especially embedded. As lua requires.
It's like trying to script php or javascript for microcontrollers. Seems like a waste of resources. But Moore's law is not done yet in the mcu realm, so there is room for abstraction. As was available in desktop computing.

Ada looks like a great example of http://xkcd.com/927/
http://en.wikipedia.org/wiki/Ada_(programming_language)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Who should write embedded software?
« Reply #103 on: June 18, 2014, 12:40:56 pm »
Quote
Seems like a waste of resources. But Moore's law is not done yet in the mcu realm

Agreed. However, a compiled version could be helpful.
================================
https://dannyelectronics.wordpress.com/
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18586
  • Country: nl
    • NCT Developments
Re: Who should write embedded software?
« Reply #104 on: June 18, 2014, 01:14:33 pm »
I'm not really seeing use for a program running a program/script, especially embedded. As lua requires.
It's like trying to script php or javascript for microcontrollers. Seems like a waste of resources.
Not quite. Modern scripting languages are compiled into 'bytecode' which is then executed. This bytecode in turn basically calls chunks of C (or assembly) code. The end result isn't much slower than using C directly (*). When I write software in C I add all kinds of sanity checks to prevent buffer overruns etc. It would be nice if all that is stowed under the hood. The only problem with executing bytecode is that you need a relatively large runtime binary.

(*) In theory bytecode could be faster because the effort put in optimising the blocks of code can be smeared over a large number of projects. Powerbasic is such an example. Back in the old days Powerbasic produced faster code than most C compilers.
« Last Edit: June 18, 2014, 01:19:07 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5549
  • Country: us
Re: Who should write embedded software?
« Reply #105 on: June 18, 2014, 01:27:12 pm »
Don't mistake the tool for the engineer, as mentioned Ateml is using the Visual Studio shell. It's also very straightforward to use VS with makefiles to do embedded work. At the risk of starting another religious war I find it to be one of the best IDEs on the market.
Have you tried Eclipse? The last time I used VS (a couple of years ago) it was a huge step backwards compared to Eclipse.

I have used VS for the last 20 years, Eclipse is in my opinion more cumbersome but I guess if I was using Eclipse at work I would get used to it as well. Add Visual Assist to VS and nothing can touch it as far as an IDE goes.
 

Offline vvanders

  • Regular Contributor
  • *
  • Posts: 124
Re: Who should write embedded software?
« Reply #106 on: June 19, 2014, 02:01:58 am »
Don't mistake the tool for the engineer, as mentioned Ateml is using the Visual Studio shell. It's also very straightforward to use VS with makefiles to do embedded work. At the risk of starting another religious war I find it to be one of the best IDEs on the market.
Have you tried Eclipse? The last time I used VS (a couple of years ago) it was a huge step backwards compared to Eclipse.
Yes, spend every day in it and it drives me mad. Even for Java development is leaves a lot to be desired. It doesn't handle external changes to files easily making it trivial to erase work if you don't manually refresh the project every time you make a change with external source control. The debugging UI is pretty non-intuitive(no way to consistently launch the same project if multiple projects are loaded) and doesn't have good watch support or many of other modern things you'd expect.

There's a bit of a learning curve when adjusting to any IDE but I'd recommend you give VS another try, I've used both extensively and very much prefer it.

Quote
Also, while I agree that Java and C# have no place in performance critical code they are still extremely valuable languages. I challenge anyone to find a language that's more productive for building UI than C# and with C++/CLI you have an extremely seamless access to native code interop. There's many support parts of building embedded systems where tools like these can be extremely valuable.
I guess it depends on the framework you are using. C++/MFC is one of the least productive ways to write a GUI. However frameworks like WxWidgets or Qt make it much easier to write (portable!) GUI programs using almost any programming language. C# is just limited to Windows.
Not true, checkout the Mono project(http://www.mono-project.com/WinForms) they've got a fully compliant WinForms implementation for OSX, Windows, Linux that's binary compatible with VS(http://www.mono-project.com/Guidelines:Application_Portability) or MonoDevelop, although VS's form builder is top-notch. I've spend a ton of time with wxWidgets and while it's a good crossplatform framework I'm easily 2-3x more productive in C#.

In fact Mono has been making large strides in the mobile market along with game development with Unity using it as their primary language.
One of my backburner projects is getting embedded Lua to work on an LPC1768. One of the problems I see with using C/C++ is that it is easy to shoot yourself in the foot. It makes sense to use a language which protects the programmer from making mistakes with pointers and buffer sizes. Another language I wanted to try on a microcontroller is Ada. According to some people Ada is excellent for mission critical software. The last time I looked there was no useable ARM port.
Lua is really nice, I've worked with it quite a bit and it shines on systems with relatively low memory requirements(outside of the uC space). I've seen it used on the PSP(24MB system memory) in a ~800KB preallocated block to handle all the game logic of quite a few shipped titles.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18586
  • Country: nl
    • NCT Developments
Re: Who should write embedded software?
« Reply #107 on: June 19, 2014, 11:34:52 am »
I guess it depends on the framework you are using. C++/MFC is one of the least productive ways to write a GUI. However frameworks like WxWidgets or Qt make it much easier to write (portable!) GUI programs using almost any programming language. C# is just limited to Windows.
Not true, checkout the Mono project(http://www.mono-project.com/WinForms) they've got a fully compliant WinForms implementation for OSX, Windows, Linux that's binary compatible with VS(http://www.mono-project.com/Guidelines:Application_Portability) or MonoDevelop, although VS's form builder is top-notch. I've spend a ton of time with wxWidgets and while it's a good crossplatform framework I'm easily 2-3x more productive in C#.
I was expecting this reply  8). AFAIK Mono development is not supported by Microsoft so you always have to watch out for using things which are not (yet) supported or buggy. It says so on the page you linked to >:D
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline vvanders

  • Regular Contributor
  • *
  • Posts: 124
Re: Who should write embedded software?
« Reply #108 on: June 20, 2014, 01:06:17 am »
If you were expecting that reply you should have qualified things a bit more than saying C# is limited to windows. Sure you can't use WPF or some of the fancier things but there's full WinForms and .net framework support which is plenty enough to be effective.

I know for a fact that Mono is very well maintained and ships software on many, many other platforms than windows in large volume.

Also what you were talking about with scripting based bytecode being faster that C only applies to a very small subset of architectures. If you're looking at raw instruction count then they can be fairly close. However the true limiter for performance on most modern computing architectures(including some of the mid-high end ARM chips) is memory accesses and cache misses. If you've got DRAM and a L1 cache then memory layout and access patterns matter more than an order of magnitude than how optimized the code is. This is why radix sort tends to destroy all other sorting algorithms on small key(2-3x word size), < ~2000 items.

This talk from Herb Sutter(@24 mins) and this paper both do a good job of explaining why memory layout matters more. To my knowledge very few scripting or interpreted languages allow explicit layout of memory structures(C# is one of them).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf