25

Does anyone do serious web development in Ada? Are there libraries or frameworks available for such tasks? I'm particularly interested in those that are free and open source.

Any relevant pointers are appreciated.

mac
  • 253
  • 3
  • 4

8 Answers8

15

Try AWS, Only proper solution I could find...

http://libre.adacore.com/libre/tools/aws/

BUT -

I would still recommend you to learn a language that is more designed to web development Such as: PHP, asp.net, JSP ....

fingerman
  • 2,440
  • 4
  • 19
  • 24
15

I've been very pleased with AWS/Templates_Parser, XML/Ada and GNATColl. Those are three solid packages that will enable you do to exciting things with Ada.

I'm in the process of moving away from PHP (got a lot of internal tools build in PHP in my business) and so far Ada has proven a very reliable companion. It has come to a point where I truly dislike having to go back to PHP. I really look forward to the day where all my tools are powered by Ada.

Just be prepared to do some more legwork than with a "normal" web language. The reward is a much less buggy and a much better performing end-product (compared to PHP). At least that is my experience.

Someone already posted a link to AWS. Here are links for GNATColl and XML/Ada: http://libre.adacore.com/libre/tools/gnat-component-collection/ http://libre.adacore.com/libre/tools/xmlada/

Thomas Løcke
  • 605
  • 4
  • 8
  • I have seen your posts on c.l.ada and find it good to hear of an entrepreneur "putting his money where his mouth is" WRT the "choose better tools" argument. Sadly, I've been unable to get a good build of AWS as of now: MinGW and all that. – Shark8 May 10 '11 at 21:05
10

AWS is probably what you are looking for, if you want to write Ada programs that include a web server or client in them. It is probably one of the most actively maintained Open Source Ada projects around, so I'm pretty sure there are a lot of folks out there using it too.

I've used it myself to provide a web-based configuration and monitoring interface for a Windows-based service. It works very well, and is quite easy to use.

If you just want to write cgi scripts, the other folks are right that there are other languages out there designed for that. However, I've done it in Ada before, and it works just great. A lot of scripting languages encourage writing programs that don't scale well as the program expands. Ada programs tend not to have that problem.

On the flip side, languages like C and C++ don't do any automatic detection on array bounds and are very pointer-based. This makes cgi written with them an active menace when exposed to the world on the internet. Some scripting languages have that problem too. Often you can't easily see or fix it, because it is hidden in the language runtime itself. Particularly when they themselves were written in C or C++. So I actually encourage the use of Ada for web-server scripting in all but the most trivial of cases.

If you are doing scripting in Ada, but miss the more powerful string-handling facilities that scripting languages tend to provide, consider looking at Gnat's Spitbol package. That implements most of the SNOBOL string handling facilies in Ada. If you want to do much more complicated string parsing, another option is OpenToken, which allows you to build your own full-blown lexical analyzers and parsers in Ada.

However, if you are looking to develop a slick full-blown complex website, you are probably best off using some kind of Content Management System (eg: Drupal). I don't know of any CMS built on Ada, but most CMS users don't bother to drop into the implementation language much anyway. Ideally you just plug the components together.

T.E.D.
  • 44,016
  • 10
  • 73
  • 134
7

AWS was already introduced to you, now you just need a framework. I can recommend the ada-awa project.

Here's a video on how to get started: youtube.com

Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
5

You could have a look at http://blog.vacs.fr/index.php?tag/JSF to see examples of how you can use Ada Server Faces.

Rommudoh
  • 1,844
  • 10
  • 11
4

If you wanted to web-enable your toaster you could try an embedded web server like EWS. Doesn't even need a filesystem on the server.

Simon Wright
  • 25,108
  • 2
  • 35
  • 62
3

The answer to the question of whether you can do heavy duty Web development using Ada depends on what you want to do. If you can be satisfied with a cgi-bin approach, there's an Ada package that will do the work and you can attach cascading style sheets as you would with any web interface. You can also use Ada/XML if you want to deal with XML parsing. There are cases where that's useful, although you might want to think about whether XML is what you need. Because an Ada procedure for handling web interfaces is compiled, it should be comparable to C in performance. Also, you can do character input parsing with the Bounded_Strings package that can let you test that input character strings don't contain unacceptable characters and are not too long. Both of these checks are important on web sites to reduce the probability of successful hacker attacks.

If you are working databases into your web design, then you should look at the Ada Web Server (AWS), which includes links to databases. For even heavier duty work, you may want to look at the Ada-AWA project, which is open source. If you are dealing with object-relational databases, then you will probably also want to consider PolyORB, which can handle CORBA and the Ada Distributed Systems Annex. This is pretty heavy duty stuff if you're working as a single developer. You'll almost certainly need to have someone to handle the day-to-day System Administration work - and you'll need permission from your Internet Service Provider to host a web site.

If you want a web interface that will have to support heavy duty numerical work, then you should be aware that Ada has tasks that support multi-threaded applications - and typically the Ada compiler and linker will assign a thread to each task. The language is designed to support thread-to-thread communication directly using rendezvous. Furthermore, the language designers have had to worry about hard scheduling problems, in which missing a communication from one thread to another is regarded as a program failure. If you're going to do multi-agent communication, you should probably get a UML design tool that will let you use synchronization diagrams to design these kinds of programs since wrapping your mind around that kind of computing is very different from sequential programming.

As a note, Ada was designed for embedded programming, which means that it has been designed for an environment in which there are many computers, each of which may communicate with other computers in a peer-to-peer manner. It was originally used by the U.S. DOD, but it has also been used in avionics software that controls the flaps and other surfaces in aircraft, as well as equivalent systems in automobiles. The Boeing 777 avionics software was written in Ada. I seem to recall that Daimler-Chrysler used Ada - noting that current automobiles have something like 80 embedded computers. The software development cost is probably about 20% of the current cost of a new car.

  • Just a sidenote... Apart from the 777, a lot of the software on the European built Tornado and Typhoon military aircraft, and their associated ground based equipment, is written in Ada. – Carl H Mar 25 '15 at 15:30
1

In general, the most serious uses of Ada occur within the Defense Contractor circles, not the web 2.0 crowd.

There are much better languages to do web development in, but i found no pre-built libraries or frameworks for web-dev with ada on google and my coworkers gave me a blank look.

That said, you could probably build something to compile HTML code and move it to the proper folders in your server in ada if you wanted to use the ada-hammer to solve the problem. Or maybe do some fancy Just-in-time compiling of the HTML to return through apache..painful, but i suppose doable

Caladain
  • 4,801
  • 22
  • 24
  • 2
    I suppose that depends on what you mean by "serious". In that directing missles is a more serious affair than directing HTTP requests to LOLcat pictures, I suppose I'd have to agree. However, there are in fact lots of folks doing web development in Ada. If your co-workers never heard of AWS, perhaps they need to get out more? Its a pretty heavily used project. – T.E.D. May 06 '11 at 13:14
  • 1
    Meaning projects with the most money behind them. Big company, big projects, outside of Acadème. Massive code-bases. Actual delivered products. Life/Flight/Space-critical software. Would you argue that the heaviest users are DOD/Defense Related (considering the DOD required Ada for a long time, and it's only been a few years since they have started trying to prevent it in defense circles.)? Use the right tool for the right job would be my recommendation. – Caladain May 06 '11 at 13:20
  • ...nothing like Apache of course. – T.E.D. May 06 '11 at 13:20
  • Gonna have to be more specific. Apache the webserver is a C project. Apache the foundation does a lot of Computational research in a lot of different languages, so perhaps you could name the source of the above comment (project name)? – Caladain May 06 '11 at 13:22
  • 1
    @Caladain - That was the case way back in the mandate days. Now, I'm not so sure. I'll agree with you that Ada's best niche has definitely been in markets where it is very, very important that the software be robust and reliable (eg: Tens of millions of dollars and/or lives at stake). However, I'd argue Sony's recent experience shows that there are many web-based applications where that applies today. – T.E.D. May 06 '11 at 13:24
  • @Caladain - Sorry man. I've been using the Apache webserver since back in the days when that's all "Apache" was. The name was originally short for "A patchy webserver". (A pun...get it?) – T.E.D. May 06 '11 at 13:26
  • Sony's compromise was primarily due to not patching their systems. Leaving un-patched servers with open ports and default configs hanging open to the outside world *with* connections to your secure servers (even if you have to bounce through a middle system) isn't a upvote for using a language that wasn't designed for flexible web development to do flexible web development. – Caladain May 06 '11 at 13:26
  • If i was making flight control software, i'd do it in Ada. The lang is *great* for that sort of thing. Split processes off, parallel calculations are near effortless. Tons of boilerplate code to do anything, but that was designed that way to force the programmer to know what they are doing. Conversely, if i was doing web development, i'd look at ASP or PHP (depending on if i was doing windows or linux devel..maybe you can do either on either server? Been a while since i looked at that), since it's "golden use" is web dev. ~shrug~No one lang is perfect at anything. – Caladain May 06 '11 at 13:30
  • @Caladain - Hmmm. I think I see what you are getting at now. If you are talking about the actual top or middle layers of the website itself, I'd have to agree. For building a complex *Website*, these days, yeah I'd probably go with a full CMS system like Drupal. – T.E.D. May 06 '11 at 13:37
  • 1
    @T.E.D, @Caladain - I have to disagree with you on using PHP… I’ve been put on a project that makes heavy use of PHP (and WordPress) and I can’t tell you how many times complete case-coverage [presupposing actual enumerations] would have ensured that changes the client requests and were implemented would have been flagged at every instance where those values were changed could save us from some buggy behavior. {I.E. like adding a ‘withdrawn’ status-indicator to a bidding system.} Further, I MISS having a spec/implementation divide… I wonder if PHP is for Pasta-Helper Programming. – Shark8 May 10 '11 at 23:05
  • 1
    I'm with Shark8, having done a bit of programming in each field, Ada is definitely a better language for developing anything of any kind of complexity. It simply offers better mechanisms for modeling real problems (try multiplying a Time value by a Distance value in each language, for instance--only one lang won't let you get away with it). Furthermore, Ada doesn't have a bulky interpreter. While it is missing a lot of ease-of-use hooks, libraries like AWS seem to offer damned-appealing abstractions for many of the most difficult web-related problems. – weberc2 Dec 17 '12 at 23:15