Much ADA about something?

Here’s a joke that you’ve probably heard but it still makes me chuckle so I’m going to repeat it: Why do all Pascal programmers ask to live in Atlantis? Because it’s below C level. It’s mildly funny perhaps because C has its own unique reputation and many programmers feel quite ambivalent about the language. Maybe this is because in C programmers had to code their own bugs while in C++ programmers can inherit them.

Ok, enough of the bad jokes, I’ll stop. There is a point to this baleful bantering and to be as succinct as possible many people are shocked to find out that many mainstream languages, including C and C++, are entirely ill-equipped for programming multicore machines.

This isn’t my view alone. In fact, I’m a bit like a weathervane pointing in the direction of the prevailing winds. But how many of us out there are grappling with the fact that multi-threading is not a feature that can be tagged on as an afterthought?

However, it’s my duty to point out that multi-processing has actually been around for decades. In the 1960s there was multi-processor machine doing its thing and since then the use of multi-processing architecture has been quite normal in many fields. And let’s not mention the tens of millions of dollars ploughed into multi-processing research over the past few decades.

Clearly much of the recent furore around the introduction of multicore chips stems from the difficulties of adapting current programming languages to multi-threading. Ironically, many of the languages of the 1960’s contained features for handling parallel execution on multi-processing machines.

This is the point at which I step aside and hand the blog floor to Robert B.K. Dewar, the president and CEO of AdaCore who also informed me about some of the above points.

AdaCore develops development tools for the Ada programming language, including compilers, tools and libraries. If you don’t already know, Ada is a structured, statically typed, imperative and object-oriented high-level language, extended from Pascal

Dewar says that the original Ada 83 version, ‘has a well-developed notion of multi-threading (known as tasking) with high-level constructs that are easy to use and analyze. The subsequent Ada 95 and Ada 2005 versions substantially improved and extended this functionality, and decades of experience have been accumulated in using Ada to deal with the problem of writing programs that run effectively on machines using more than one processor.’

Now it might be safe to assume that Mr Dewar, being president and CEO of Ada is going to blow the trumpet loud and long for his company and the Ada language. And being in his position who wouldn’t?

In the world of software developer jokes and the description of languages as cars, Ada is positioned as ‘An army-green Mercedes-Benz staff car. Power steering, power brakes, and automatic transmission are standard. No other colors or options are available. If it’s good enough for generals, it’s good enough for you.’

What I’d really like to know is there anybody out there who has used Ada for multicore machines and what is their experience? Any takers?

8 Responses

  1. Sure – check out the research project I did several years ago on a “constructive approach to integer factorization” (let the reader understand) on http://karl.nyberg.net/t1000, which, besides using a Sun Microsystems SunFire T1000 (8 cores x 4 strands / threads) with Ada was sufficiently innovative enough that Sun AWARDED me the computer for my effort.

    See also my publication at the November 2007 SIGAda on the same subject, also available on my website – http://karl.nyberg.net/publications/p79-nyberg.pdf and slides:
    http://karl.nyberg.net/publications/p79-nyberg-slides.pdf

  2. [...] a previous blog post about Ada, I asked whether anybody was using Ada for multicore programming, and Karl Nyberg has got in touch [...]

  3. It’s worth noting there were a bunch of shared memory multiprocessor ‘superminicomputers” in the ’80s and ’90s that look a lot like multi-core CPUs today. A lot of money went into developing Ada runtime environments to distribute tasks over the set of CPUs, including handling problems like cache consistency and shared variable synchronization. A big part of the Ada advantage is the concurrency model is sufficiently high-level that it can be implemented on a variety of lower level mechanisms, including POSIX threads, and directly onto multicore CPUs. Part of the investment made in the language implementations will pay off in multi-core programs that work “out of the box”. Another part of the Ada technology worth considering is its support for analysis and verification of concurrent/multi-core programming. Google “Ravenscar”…

  4. Hi David. Thanks for your thoughts. I searched for Ravenscar but couldn’t find what you’re referring to. Do you have a link please?

  5. First entry I got from Google: http://en.wikipedia.org/wiki/Ravenscar_profile

    “The Ravenscar profile is a subset of the Ada tasking features designed for safety-critical hard real-time systems. It was defined by a separate technical report in Ada 95; it is now part of the Ada 2005 Standard.”

    See also http://www.aonix.com/pdf/ravensc.pdf and http://www.adaic.org/standards/05rat/html/Rat-5-4.html

    Perhaps most importantly, the Ravenscar concepts are now adopted into SPARK, http://en.wikipedia.org/wiki/SPARK_(programming_language) What’s important is that formal properties of concurrent programs can be reasoned about and in some cases formally proven.

  6. Thanks David. The first 20 or so results for me were to do with a town in North Yorkshire, but that might be because I use Google.co.uk rather than .com. I’ll take a look at those links. Thanks for the pointers!

  7. Ravenscar profile came from a workshop in Ravenscar Yorkshire, so there is a connection. :-)

  8. I have been using Ada on multi-processor systems for years. Currently, at my job we use it for a distributed, soft-real-time system with some individual machines having eight processors.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.