Ada web development

Almost the very first step of my Ada journey was to find a web framework for it.

Ada is a general purpose programming language, even though often it's not seen as one. "Aviation industry language" is common association, or just something that runs in embedded space (and especially embedded stuff in space industry).

Since everything is on Internet these days, it's quite natural to set the interface through the web. My default toolbox for it in Scala world is Lift. Would be wonderful to find a similar framework which would follow Lift's "View First" ideology. But at this stage, I'm happy to settle with any tooling I can find.

JVM world and other popular language ecosystems are almost polluted by different web frameworks. Ada isn't so popular and there's much less to pick from. But I was positively surprised to find a couple of interesting projects.

AWS

No, not The Amazon thingie. Here AWS would stand for Ada Web Server. It is maintained by AdaCore. AWS is a library which can be used to turn your application into a web server. It includes quite much of the functionality you'd expect for a web framework, including, but not limited to:
  • URL based dispatching,
  • Templating,
  • Session handling and
  • Ajax support.
You can also make a SOAP / WSDL interface for your service. What is really cool, is that your basic web app server will chop just a few hundred kilobytes of memory to begin with. Very nice if you have limited resources, since just the warming up of  the JVM would require at least some 64 Mb of memory.

Gnoga

The Gnoga way of doing things is an interesting one. "It's... different", I would say. But different can be good, just like with Lift that I like so much.

With Gnoga, you build your app in a similar way you'd do with a native GUI toolkit, like GTK, but the view is served through HTML5. I believe the main idea is to render the UI elements through a websocket connection between the browser and the server. Any user interaction with the view will go through the websocket to the server and handled by controllers, and any modification to the view by the server will go back through the websocket connection to the browser, and the user will see the change instantly. No separate HTTP requests will be done.

I haven't dug into deeper yet, but I believe there's also some ways to make a mix of traditional web page and a websocket enabled interactive parts. Gnoga also promises other goodies. From the tooling page:

  • Native Gtk Front end for desktop
  • Native Mac OS X applications that can be submitted to the App Store
Gnoga executable will be also small, with small memory footprint, at least by judging from the demos I have tried.

So there are possibilities for relatively easy web development with Ada. I'm not sure how production ready Gnoga would be, I have to learn a bit more, but AWS seems to be on solid ground at least.

Comments

Popular posts from this blog

Alire - Ada Library Repository

First post