Archive for the Languages Category

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, nowadays 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 sometime 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…

Atypical Curiosity

Actually I am typically pretty curious, especially when it comes to programming languages.

Atypical is a programming language that I discovered recently almost by mistake.

It was designed for the PIC and around the PIC assembly (midrange, 14-bit core) by Michael Park, with all the limitations and quirks of the PIC core, but with the intention to add a little structured programming and improve readability (quite a bit). Atypical flies very low, adding only a very thin layer of pre-processing to your source code. No fancy optimizations, if you are a hard core assembly wizard, you will appreciate how all the power is still in your hands…

As the author says, take a look and see if Atypical piques your interest! (link)

Real World Instrumentation with Python

 There is a new book on my nightstand, and it is one of the best I have read in years: it is called “Real World Instrumentation with Python” by J.M. Hughes, published by O’Reilly!Less than a month ago I was readying about Ruby. Then one thing got to another and I followed a friend’s suggestion to look into Python instead. Read a lot about it mostly online, then again, I strolling through a bookstore last Saturday and I stumbled onto a copy of this new book (published this past November 2010).  I am amazed by the amount of information packed in so few pages and how smooth and fast it reads. I am now a big Python fan, it’s official, but an even bigger fan of J.M. Hughes.

Learning Ruby

Browsing through those large book stores, of the kind and size you can find only in the US, is one of my favorite pastimes.

I can loose myself in there for entire afternoons just letting the eye fly (wink) over the shelves and picking out the catchiest titles. My favorite section is of course the technology and programming one, and my first pass is often spent looking for the red spine and Newnes logo, just to make sure they do have  copies of my books available. Too often they don’t, which I like to think is a sign of how successful my books are, they must literally fly (wink wink) off the shelves!

But for the last couple of years I have been attracted by books on Ruby, a very trendy programming language, although I never really ended up buying one or getting to dig deeper into the subject. I had this notion that Ruby was just for web site designers and there was little else for me there. Eventually, this Christmas I gave in and bought a copy of “Learning Ruby” written by Michael Fitzgerald and published by O’Reilly.

I choose it (among the many other Ruby’s books) because it promised to be very compact (about 200 pages) and based on a lot of practical examples, which is definitely my idea of the way books should be. Ok mine are thicker, but I promise, the next one will be shorter.

Fact is, I ended up liking this book a lot. I read it all in a single flight (from S. Francisco to Munich) and it gave me the sort of fever I sometimes get when something new gets my neurons all fired up at once!

Of course somebody has already started playing with the concept of porting Ruby to the embedded control world, with the RAD project (somehow it does not surprise me that this was done first on an Arduino platform, the A in RAD).

While I am not yet sure of the results and their application to the average embedded control project, I learned that “modern” interpreted languages are nothing like (bad) old MS-Basic. There are so many powerful concepts, such as reflections, duck typing, and multi-paradigm support to mention a few, that are worth exploring and considering carefully when trading performance (abundant in modern processors) with ease of development and code maintenance.

What is your opinion on interpreted vs. compiled in embedded control?

|