Archive for February 2012

Virgil

Virgil

I was reading recently about the (slow) adoption of object oriented programming languages in the embedded world. There is quite a sad situation, while in the mainstream, OOP languages are pretty much a standard, in the embedded world, they are just starting to show up, why?

The problem is not the lack of say C++ compilers or Java environments for the architectures used in the embedded world, it is more a matter of dealing with the runtime overhead and code bloating often produced by those solutions. But independently from the language of your choice, not all OOP is bad (as in bloating and runtime heavy…) there are some constructs in each language that are worse than others.

Ben L. Titzer, Jens Palsberg and other researchers at UCLA have been working for years on the subject and they have distilled a list of good and “bad” features that impact so much more heavily the typical embedded application. Their recipe, a new language called “Virgil“, designed from the ground up to provide you with the best of OOP without the worst of OOP.

Virgil is compiled to native (like C++) but is also strongly typed (like Java) and shares a syntax that is certainly familiar to programmers of both origin. There are also provisions for low level management including interrupt handling, special function registers and bit manipulation!

The only problem is that new languages’ adoption is always very slow, even when there are strong sponsors… (anybody used “GO” recently?), so if we wanted to accelerate the adoption of OOP, introducing a new language is not exactly a quick option…

Nonetheless, take a look at Virgil and see if you like what it has to offer…

Maximite

I have to confess that, if I had not already done so in the past,  when I wrote some of the material for the PIC24″flying” book such as the composite video and the keyboard interface examples, I had a bigger project in mind. Eventually I was hoping to be able to put them together and (re-) create some sort of a mini personal computer. Unfortunately the early PIC24 models proved to have too little RAM for that purpose, but when the PIC32 came out, I gave the whole project a second try.

This time though I took a completely different route, using a USB keyboard interface (in place of the PS2) and using a TFT display in place of the PAL video output. FreeRTOS gave me the ability to put various other pieces together with some agility, including a Z80 interpreter/emulator and even a tape emulator (using SD Cards instead). The result has been the ZX Spectrum project running on the MikroElektronika MMB-MX4 boards. With it, you can run Sinclair Basic programs but also play old videogames in almost perfect real time.

Unfortunately, in the process the simplicity of the original idea got somewhat lost. The ZX Spectrum simulator is composed of several layers (FreeRTOS, USB, Graphics libs, Z80 emulator, SD Card file system) each eventually requiring of a certain level of knowledge to handle and maintain.

Maximite

Geoff Graham took a different approach and assembled instead a neat little board, the size of a credit card, to create a very agile little computer programmable in BASIC: the MAXIMITE. The project was the center of a series of articles he wrote for the magazine Silicon Chip where he described how he ended up writing almost from a scratch a BASIC interpreter for the PIC32. He has since posted the complete Maximite project on his web site and gathered a significant community around it.

I love his idea and I will keep checking his web site for news and future developments….

|