Live data from Hacker News

Ada: a C Developer's Perspective

methodsandtools.com

111–120 of 157 posts

Re: Ada: a C Developer's Perspective

#111
post #62
post #50

Earlier quoted context omitted.

Range types are probably the main thing I miss from the Rust type system. But even without range constraints, wrapper types (called newtypes in Haskell and Rust) are great. Let's say you have a function that accepts a temperature. A temperature is a float, but you want to prevent the user from mixing up celsius and fahrenheit. This is what newtype looks like in Rust: struct Celsius(pub f64); struct Fahrenheit(pub f64…

Huh. That's clever. This approach should also work in other languages, say, C/C++/C#. I don't remember if C uses structural identity for struct types, but it might work.

No identity or equality concept in C for structs apart from their address, I'm afraid. In C++ one can define a comparison operator, but it has to be implemented manually.

Not that you can use the language-provided == on floats anyway, due to precision issues you should always check if the difference is below a specified limit...

Re: Ada: a C Developer's Perspective

#112
post #6

It's not only a language that is key to success. Libraries. I searched for LDAP support for ADA (old protocol used by many companies). I found library ( http://savannah.nongnu.org/projects/adaldap/ ) with latest news from 2002 and CVS repo :) Then I search for SNMP (another dinosaur still in wildly use) - similar result. Second - many solutions/libraries are purely commercial. You need basic open protocols support by…

Also, TLS support. Ada Web Server uses OpenSSL for that. It's not possible to develop a secure web application with ADA at this moment, because you can't run one of the known weak spots with ADA based implementation. If you can't do that, why bother at all...

I did consider doing all my projects using ADA. I really want to love ADA. I simply can't because some fundamental building blocks are missing. I am very disappointed over this.

Re: Ada: a C Developer's Perspective

#113
post #70
post #37

Earlier quoted context omitted.

If you start a project today that depends on a library that was last updated in 2002, then may God help you.

Well, why? Why would a library be bad just because it hasn't been updated in 15 years? Does it spoil? Maybe it doesn't need to be updated.

Libraries that interface with other systems like LDAP go bad over time. Either you are missing bug fixes or new features.

Re: Ada: a C Developer's Perspective

#114
post #37

Earlier quoted context omitted.

If you start a project today that depends on a library that was last updated in 2002, then may God help you.

Why? Ada libraries from 2002 without outside dependencies work perfectly fine. I'm using that old libraries all the time. Ada has been designed specifically for that, it's been used in the aviation industry that runs the same code for 20+ years minimum. That you think otherwise only shows that you've never seriously used Ada in a larger project.

The keyword is "without outside dependencies " . Most of us have to integrate many systems and there outdated libraries are a big problem.

Re: Ada: a C Developer's Perspective

#115
post #8

Earlier quoted context omitted.

On early PCs, Pascal and C were pretty much tied in popularity. Both were free to implement, and small enough that you could make a fast compiler on a typical PC with only 256-640 kB RAM. C won because it was more flexible and was chosen by Microsoft, but Pascal definitely had a strong following (it was the original Mac's API language, and on PC it was a major contender thanks to the nice and fast Turbo Pascal IDE).…

> Ada was a complicated and rigid language designed by a Department of Defense committee Ada was designed by Jean Ichbiah, and although there was a committee he did override them on multiple occasions. So not really a design-by-committee. The reasons it got no traction were: it was too complex/heavyweight, and too dissimilar to C to warrant a change (businesses waited for C++ instead, since it was around the corner a…

Ada is a beautiful language, but the licensing issues, the archaic and bloated IDE tooling combined with the proliferation of ancient bitrotting libraries are crippling Ada's potential.

Drake [1] is a promising new Ada runtime with non-GPL license that deserves more support.

Similarly, DRACO is ISC licensed [2].

Of course, these projects aren't backed by moneyed interests like AdaCore is, so they get no love.

[1]: https://github.com/ytomino/drake/wiki/Why-a-new-Ada-runtime%...

[2]: http://www.dragonlace.net/questions/quest_004/

Re: Ada: a C Developer's Perspective

#116
I worked with Ada for several years on a military satellite program (simulator software for various satellite subsystems). Specifically, I was using Ada95 on SPARC/Solaris, and later got to work on a project (with a different employer) to port much of the same system to x86/Linux with Ada2005 (so many endian issues :shudder:). This was in the mid-late 2000s.

I remember when I told my mother (also a software engineer) that I got a job using Ada, she laughed and handed me all of her old Ada83 books (which are still on my bookshelf at work). I'm doing backend services in JVM-land these days, which I enjoy a bit more (not to mention I'm building a more portable skill-set) :)

Re: Ada: a C Developer's Perspective

#117
post #6

It's not only a language that is key to success. Libraries. I searched for LDAP support for ADA (old protocol used by many companies). I found library ( http://savannah.nongnu.org/projects/adaldap/ ) with latest news from 2002 and CVS repo :) Then I search for SNMP (another dinosaur still in wildly use) - similar result. Second - many solutions/libraries are purely commercial. You need basic open protocols support by…

Also, TLS support. Ada Web Server uses OpenSSL for that. It's not possible to develop a secure web application with ADA at this moment, because you can't run one of the known weak spots with ADA based implementation. If you can't do that, why bother at all... I did consider doing all my projects using ADA. I really want to love ADA. I simply can't because some fundamental building blocks are missing. I am very disapp…

I bet AWS isn't the only option when one takes into consideration commercial Ada compilers.

Re: Ada: a C Developer's Perspective

#118
post #62

Earlier quoted context omitted.

Huh. That's clever. This approach should also work in other languages, say, C/C++/C#. I don't remember if C uses structural identity for struct types, but it might work.

No identity or equality concept in C for structs apart from their address, I'm afraid. In C++ one can define a comparison operator, but it has to be implemented manually. Not that you can use the language-provided == on floats anyway, due to precision issues you should always check if the difference is below a specified limit...

> Not that you can use the language-provided == on floats anyway, due to precision issues you should always check if the difference is below a specified limit...

Hehe, I've been there. ;-) Fortunately, that code dealt with physical coordinates, so if two points were less than 100µm apart, they were equal for our purposes.

Re: Ada: a C Developer's Perspective

#119
post #57
post #29

Earlier quoted context omitted.

> The subtyping feature I love the most. I only have very little experience with Ada, but being able to define a type whose values are integers in the range, say, 1 .. 7, to represent days of a week was an eye opener.

I find this regression kind of strange. Pascal had number ranges in the 80s! I don't get why no modern language adopted them...

[deleted]

Re: Ada: a C Developer's Perspective

#120
post #5

It's such a pity these days there is no modern tool chain/workflow for Ada (or C++ for that matter). I mean, a package manager, a build tool with integrated dependencies. As far as I know, there is very little open source software for Ada. It's a shame, because I feel like the language would become more mainstream, if only better tooling was easily available.

I believe you are looking for http://conan.io + cmake + any number of IDEs (VS, QtCreator, CLion, KDevelop, Eclipse, Vim) all of which will integrate with cmake perfectly.

I guess! (CMake is still horrible, but well...)
Post reply on HN