Writing Ada Bindings To C Libraries

Today I found a great new website: flyx.org. It is the personal website of Felix Krause and on this website I found a gem of Ada programming magic:

It is a great article if you want to get into the art of binding to C libraries:

This article gives an overview over problems, solutions and guidelines for writing an Ada binding for a C library. It summarizes experiences I made while implementing OpenCLAda and OpenGLAda. Code examples are taken from those projects.

The Ada code examples shown here are written in Ada 2005. Note that you can import C functions somewhat nicer in Ada 2012.

Since I’m a complete binding virgin, I would like to personally thank Felix Krause for writing this article. I’ve learned A LOT from reading it. I also added the article to the Ada-DK wiki Resources page.

XAdaLib 2012 for Snow Leopard

I’m sorry for the lack of updates to the Ada-DK website, but I’ve been on vacation for most of August, and updating the site while riding across Iceland on motorcycles with my wife does not really mix well with staying on top of things in the world of Ada programming.

But now I’m back, and my first post will be about the release of XAdaLib 2012 for Snow Leopard, a collection of the following Ada tools for the Mac:

  • GTK Ada 2.24.2 with GTK+ 2.24.5 complete
  • Glade 3.8.2
  • GnatColl 2012
  • Florist 2012
  • AICWL 1.3

There’s both documentation and examples in the download package, so if you’re on Snow Leopard this might be an easy way to get the mentioned Ada tools up and running. You can read the full release announcement here.

How to call LAPACK and BLAS directly from Ada

I’m not going to pretend I actually know what LAPACK and BLAS are for, except they both have something to do with mathematics, and as I’ve said before, I suck at mathematics.

But luckily Nasser M. Abbasi does not suck at mathematics, and he also appears to know how to make LAPACK and BLAS work their magic with Ada:

How to call Lapack and Blas directly from Ada

Amazing stuff, or so I will assume until proven otherwise. 🙂

An Ada Binding to ALSA

Yet another package from Jacob Sparre Andersen: An Ada binding to ALSA. For those of you who don’t know what ALSA is, it is the Advanced Linux Sound Architecture that provides sounds capability to the Linux family of operating systems.

Jacob’s first priority is being able to manage sound recording on both the “amd64” and “armhf” architectures. I’ve no idea how close he is to reaching that goal, but I suspect he’s more or less there because of this little nugget found on the website:

Implemented features:
+ 16-bit mono recording (Linux)

Maybe I can convince Jacob to add a short comment to this post, if he believes there’s more that needs mentioning.

VTKAda 5.10, QtAda 4.8.1 Released

Today Leonid Dulman (PDF) announced the release of VTKAda 5.10 and QtAda 4.8.1:

VTKAda is an Ada-2012 port of VTK (Visualization Toolkit by Kitware, Inc) and Qt4 application and UI framework by Nokia ParaView 3.14.0 (VTK version 5.10.0), Qt version 4.8.1 open source and qt4c.dll(libqt4c.so) were build with Microsoft Visual Studio 2010 for Windows and gcc for Linux x86. Packages has been tested with gnat gpl 2011 ada compiler (-gnat12 option) for Windows XP Sp3 32bit, Windows 7 Sp1 64bit and Debian 5 x86.

VTKAda is powerful 2D/3D rendering and imaging system that works inside a Qt4 application.

You can read the full release announcement here.

CUDA/Ada version 0.1

Back in December 2011 we reported on an early developer version of the newly started CUDA/Ada project, and now a mere 2 months later the codelabs.ch guys have officially released version 0.1 of the CUDA/Ada binding to Nvidia’s CUDA platform:

CUDA/Ada is an Ada binding to NVIDIA’s CUDA parallel computing platform and programming model. This project was developed during the course of the master seminar “Program Analysis and Transformation” at the University of Applied Sciences Rapperswil.

There’s a nice benchmark chart on the website, which really shows of the power of CUDA/Ada, and there’s also an interesting paper (PDF) available with lots of information about the project.

You can download the latest version here and you can read the release announcement here.

GtkAda Contributions and AICW updates

More updates from Dmitry Kazakov:

GtkAda Contributions is the work of Dmitry Kazakov and Maxim Reznik. It is a package of proposed contributions to GtkAda, adding stuff like tasking support, embeddable images, spawning processes synchronously and asynchronously with pipes and a whole lot more. You can read the release announcement here.

Ada Industrial Control Widget Library enables you to create all sorts of graphical gauges, meters, clocks and oscilloscopes. If you need some sort of visual indication of load, pressure, speed or whatever, then this package will probably be able to get the work done. You can read Dmitry’s release announcement here.

Ada binding to Google’s V8 Javascript engine

I gotta admit that I did not see this one coming: An Ada binding to the V8 Javascript engine. Very interesting and pretty bold. You can see a short usage example here.

I would very much like to hear from people using this new binding, or even better, from Kylix, the person who posted about to comp.lang.ada.

CUDA/Ada – an Ada binding to NVIDIA’s CUDA platform

If you’re into parallel computing, then you might’ve heard about Nvidia’s CUDA platform:

CUDA™ is a parallel computing platform and programming model invented by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).

With a new binding from codelabs.ch you can utilize CUDA using your favorite programming language: Ada. The binding is called CUDA/Ada, and it does just what the name implies:

CUDA/Ada is an Ada binding to NVIDIA’s CUDA parallel computing platform and programming model.

At the time of writing there’s no official release of CUDA/Ada, so you’re going to have to rely on the developer version. There’s a neat little usage example on the project page, so be sure to go check it out. Obviously you need a CUDA aware GPU for this binding to work.

D_Bus/Ada, talk with your desktop in Ada

From the busy hands of codelabs.ch comes a brand new Ada binding to D-Bus: D_Bus/Ada.

The D_Bus/Ada library provides an Ada binding to the D-Bus message bus used for inter-process communication on most modern Linux desktop systems. D_Bus/Ada supports all but two basic D-Bus types (file descriptor and signature types are not yet implemented) and all container types. The current release focuses on the client side of the D-Bus API but it is also possible to provide D-Bus services written in Ada using the service object interface of D_Bus/Ada.

In order to build and use D_Bus/Ada you must meet the following dependencies:

After that you should be good to go.

You can read the full release announcement from Reto Buerki here.