Here some advantages of a virtual machine (VM) on embedded systems.
The B# VM is written in full ANSI C and promotes:
• The reusability of software components expressed in binary
format on any architecture
• The writing of interrupts handlers and access device registers
in a uniform manner, independent of the underlying target
architecture (memory-mapped or port-mapped)
• No dedication to any specific microcontroller architecture
• The ease to test, debug, and maintain embedded applications
It is nice that it does that but,
- binary re usability is irrelevant imho when embedded systems are involved, it is not a bad thing, but not worth the overhead
- handling interrupts in a VM is generally a "lie" and one can implement "uniform handling of interrupts" in a compiler if one wants to using "smart compiler" like for example mikroC does or CSC C .. the whole interrupts and vm are not really fitting in the single sentence as you cannot guarantee any timing within vm hence the whole point of interrupt becomes pretty different then what interrupt really is in "real" system, not to mention "real time" system
- No dedication to .... aint really a good thing when "small fast and cheap" is the whole point ... don't get me wrong I work for company that invented Java, but there is a point and place for everything (except .net which is embarrassment for any real developer)
-
the ease .. now this I agree with you 10000000% .. limiting developer by fencing the code inside the LVM allows the complete moron with 2 week course to call him self developer (anyone remember the gzilion "VB developers" that came out over night?) but it is LIMITING .. I do not approve that on desktop PC and hell will freeze before I approve it on my micro controller! You can have VM like flash, java and such where overhead is "acceptable" as you have binary independence from os/cpu on a large scale... so your binary works from "phone" to sun mainframe .. with possibility of doing it in hardware ... BUT you are distributing your "binary" to huge population ... in embedded systems, you do not distribute your binary to anyone!!! you distribute the SYSTEM where user have no idea what the firmware is, nor they want to know .. you choose the hardware, you have the source, you compile the source, you burn the source ... where's the need for VM ??? if you know you will be using uC XYZ, compile the darn code for XYZ and burn it?!?
The whole point is in that "ease" ... I do not approve / accept that that "ease" is worth the price ... I do believe C overhead over ASM, the time, the ease .. it is just worth it, the VM - not in the million years... now, that's me - I have a right to have opinion
A VM provides additional levels of abstraction which isolate the developer from the idiosyncrasies of the underlying hardware architecture. But that's it. It is certainly not an easy ticket to enter in the embedded systems arena. Bad developers or those who underestimate and not objectively understand the constraints of embedded systems applications will always shoot themselves in their foot.
allow me to disagree with you... VM provides additional level of abstraction at what cost... that's the major question... I recently fired a client/server developer who had no knowledge of tcp/ip internals ... "he was using components" and then when it stopped working he had no idea where to look ... this is the similar issue, VM is not "easy ticket" but
- the good developer do not need the benefit's VM is offering
- the moron will still be moron but will be able to provide code "That looks like it is working" .. and of course, because that moron works for 20% of what good developer costs, the device manufacturer will get the "moron" and more expensive chip -> so I will have to pay more for my CXYZYZ device, because they hired moron who put 10x more expensive uC inside so he can be able to "program without knowledge of what darn interrupt is" ... look around ... 99% developers have no idea what is the difference between von neumann and harvard architecture ... 90% never heard those terms...
I perfectly agree with you that a VM is not a fence of protection neither a point and click solution for those who are used of unlimited cpu and memory resources. Embedded developers are very cautious about any waste, but a bit more flexibility and reuse will be a plus, if it is affordable.
that's the whole point ... "if it is affordable" .. .it is always affordable .. but someone have to pay the difference .. and it is not going to be developer nor company .. it is going to be end user ... VM's have its use but IMHO embedded systems are just not one of them... especially as everything that you can provide with VM you can provide with "good" compiler, the only difference is that with good compiler you will have to allow "developer" to make mistakes and with VM you do not have to do that, you can put the limit there .. to repeat myself, I have pretty much same opinion of .net as most of the parallels stand