I did say I was trying to learn Ada.
Well, I thought I would explain that it is a bit stalled, sadly.
I have managed to read a lot of the Barnes book on Programming in Ada 2012. Well, over half anyway. I read a lot whilst on a cruise!
It is a tad more verbose than I am used to, but overall I would have to say it does look good. The very strong typing, and the fact that all types allow value range controls, all make for much safer code. Even the multi-tasking looks interesting.
I have got to the stage that I would like to try using it, and that is where I have come unstuck, sadly.
Obviously, if I wanted to simply code some abstract program, much as one would on a Computer Science course, then of course I could use Ada. Sadly, such simple self contained abstract programs with no more than basic text input and output are pretty much academic now. Nobody does INPUT and PRINT to communicate to the user, they use a range of libraries, web sockets and web pages, javascript, all sorts. And that is just the user side, the back end is all libraries for mysql, or B2B XML, or libcurl, or something else.
A lot of the code I work on, and code I start from scratch even, is run on a linux environment. I have a load of our own C libraries which we use extensively, but of course linux has a lot of C libraries that are used for all sorts of things. I am not against re-working our own libraries - some of the key ones are XML manipulation and SQL front end for the standard client library. I am sure both can be done in Ada with no problem, but I am not re-working OpenSSL from scratch in Ada.
The problem is that to use these from Ada I would have to find or code interfaces or new libraries. That is going to make a huge hurdle for any code I need to write. I get the impression that there are some Ada wrappers and libraries available, but I am struggling to find them.
I mean, is there an Ada library for mysqlclient interface, or openSSL for TLS? Heck, what about something really simple to start with like popt library? There must be a good Ada XML library?! If I can find libraries or wrappers for a large list of key functions that we use regularly on linux then maybe I can start using Ada, but right now it is not looking promising.
There is one closed project we work on, and have for many years. It is a project where every library and functions is written from scratch, including the operating system. It was suggested long ago that maybe we should use Ada, and I decided against it. In hindsight maybe that was a mistake, as it would have been a perfect case where we did not rely on any external systems and could have started from scratch in Ada. That project is the FireBrick. There is even some chance we may start using some Ada modules in future... But that would have been cool - a complete operating system from scratch all based on Ada. I am kicking myself for not doing that when we started now. Sorry Cliff.
If I do make more progress, I'll let you know, but for now it is stalled.
Subscribe to:
Post Comments (Atom)
Don't use UPS to ship to UK
I posted about shipping and importing and tax and duty - general info. But this is specific. DON'T USE UPS! I had assumed the UPS issue ...
-
Broadband services are a wonderful innovation of our time, using multiple frequency bands (hence the name) to carry signals over wires (us...
-
For many years I used a small stand-alone air-conditioning unit in my study (the box room in the house) and I even had a hole in the wall fo...
-
It seems there is something of a standard test string for anti virus ( wikipedia has more on this). The idea is that systems that look fo...
Looking at https://github.com/ytomino/openssl-ada/blob/master/source/crypto.ads creating ada bindings for standard libraries doesn't look *too* difficult.
ReplyDeleteAssuming it works: I haven't tried it!
To be honest I am half expecting people too tell me I missed the obvious and that this is easy, and if so I may progress my Ada endeavour.
ReplyDeleteP.S. Er, I meant to link to https://github.com/ytomino/openssl-ada/ not the individual file.
ReplyDeleteOf course, creating bindings for every function is going to be a bit tedious...
That, or start commenting on my book collection.
ReplyDeleteI'm mostly just troubled about the mixing of fiction and non-fiction... :)
DeleteNow you have me pondering - Ada, like any language (including Klingon) is just "made up", so is it fiction too?
DeleteYou'll be telling us that Terry Pratchett is fiction as well next! ;)
DeleteI learned Ada many years ago but moved on to the more hardcore Haskell and OCaml. Ada occasionally comes up on HackerNews with the same problem: there is a dearth of third party libraries for the language to do many things. I liked the language but I like the more functionally oriented ones now.
ReplyDeleteThis might help but maybe only for simple libraries.
ReplyDeletehttps://www.adacore.com/gems/gem-59
I'm currently working in Rust for similar reasons to your interest in Ada, and we're able to work around the "all interesting in-house libraries are in C++" issue by using bindgen to make it easy to write FFI bindings from Rust callers to C++ libraries.
ReplyDeleteIs there a similar route in your Ada compiler and runtime, to make it easy to call an existing C library from Ada? You could then write a "nice" Ada interface on top of the raw binding (which we do in Rust for important C++ libraries) so that the rest of your code is idiomatic Ada.
Wonder whether h2pas from FPC would help?
ReplyDeletehttp://wiki.freepascal.org/H2Pas