Live data from Hacker News

Ada: a C Developer's Perspective

methodsandtools.com

51–60 of 157 posts

Re: Ada: a C Developer's Perspective

#51
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…

This idea that Rust and Ada are somehow alternatives continually pops up, and I still don't understand it. They each have their own ideas on what "safety" is, and how to address it. I'll admit I'm biased towards Ada, but I think it is pretty safe to say that "Rust safety" is a subset of "Ada safety" - but Rust does it's section and run further with it than Ada. Rust is obsessed with memory safety. That's it's thing.…

How does Ada address the problems that Rust's borrow checker addresses? Use-after-free in particular.

As for not being alternatives, how do they mix in the same project? Does Ada have C-compatible FFI that lets both Ada and Rust see each other as C?

Re: Ada: a C Developer's Perspective

#52
post #25

Earlier quoted context omitted.

Ada is the F14. Expensive, works well, but ya really just don't need it most of the time.

So what's the F/A-18?

I almost said Javascript out of ubiquity, but it'd be a grave insult to the plane. Java is a good answer, maybe C#, maybe Python. The language needs to be one that gets a lot of work done, and is reliable.

What's a language that's just always got your back in a situation? That's the F/A18.

Re: Ada: a C Developer's Perspective

#53
post #20
post #12

Earlier quoted context omitted.

I wish there were a simplified (as in automated) and "community-blessed" workflow at least for static binaries with source dependencies, like all the popular "modern" PLs are doing these days. I'm saying this as a newcomer (in C++ land) that finds the lack of this kind of tooling a bit intimidating.

I know what you mean. It's just really hard to bolt dependency management on C family languages, and so many ways it can exacerbate the problem by adding another layer of accidental complexity... (IMHO, CocoaPods is a good example of how a community-managed library dependency manager can end up creating a worse mess than the one it tried to solve.) The Rust team started working on a package manager early as part of t…

Fun bit of history: it's a hard problem! Rust went through three different package managers in its history:

1. Cargo. But not the one you've heard of. A small Python script that pulled stuff off of GitHub.

2. Rustpkg. Felt like Go's tooling. https://doc.rust-lang.org/0.9/guide-rustpkg.html

3. Cargo, the one we still use today. https://mail.mozilla.org/pipermail/rust-dev/2014-March/00908... just over three years ago.

Re: Ada: a C Developer's Perspective

#54
post #44
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.

Same goes for a library that was last updated 5 minutes ago though.

Good point. I'd rather pick the one that hasn't needed an update in 20 years unless they're assuming it is bitrotten.

Re: Ada: a C Developer's Perspective

#55
post #36
post #35

Here is my list of shortcomings when it comes to Ada 1) Ada is not a magic bullet, the seminal case study of why computer bugs are bad taught in CS courses around the world is the failed 1996 Ariane 5 rocket launch where the rocket veered off course and then exploded due to a software error that caused it not to understand the data it was getting from a sensor. More recently there are plenty of demonstrations of poor…

1) and 3) are related as far as I remember - Ada WOULD have found the problem which was responsible for the Ariane 5 launch failure, but the section involved was speed critical, so the asserts were dropped to make the code run fast enough. Sad reality: The best security features in the world are useless if they are too slow for your use case.

Ironically, it's also Ada's asserts which contributed to the failure (though far from the root cause): The result of the erroneous calculation wasn't actually used, so just ignoring it like C would have would have been fine. It was the fact that the wrong cast caused the software to abort which resulted in the crash.

Re: Ada: a C Developer's Perspective

#56
I wanted to use Ada for a personal project, it's not what it's cracked to be. Some registers are hard to map in the language.

The timing side of things is extremely misleading: there are time primitives in the language, but you don't know if the implementation of the runtime will actually reach your constraint, and you won't be warned (it took me 2 days on the scope before understanding that it was not my code that was the issue).

if you want to toy around, I have started an Intellij Plugin: https://github.com/nraynaud/ada-intellij

Some registers of the STM32 are mapped here: https://github.com/nraynaud/bldc_ada/tree/master/src

Re: Ada: a C Developer's Perspective

#57
post #29

I had a strange internship topics involving Ada. I tried to run a huge program (a simple stdio wrapper around a huge library actually) on an Android machine (Android 2.3, ARM). At that time, the only ADA compiler for ARM was available on BSD so I had used a Windows machine for development and a OpenBSD laptop for compiling the wrapper. The subtyping feature I love the most. You see the benefit when you need to call a…

> 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...

Re: Ada: a C Developer's Perspective

#58
post #35

Here is my list of shortcomings when it comes to Ada 1) Ada is not a magic bullet, the seminal case study of why computer bugs are bad taught in CS courses around the world is the failed 1996 Ariane 5 rocket launch where the rocket veered off course and then exploded due to a software error that caused it not to understand the data it was getting from a sensor. More recently there are plenty of demonstrations of poor…

> Overhead, each of these features like assert adds a lot of overhead into the system, this is just not viable in a lot of systems

You can verify assertions statically and then omit them from the compiled program.

> most of us can't afford expensive toolchains and libraries

Check out the free software toolchains and libraries at http://libre.adacore.com/tools/

Re: Ada: a C Developer's Perspective

#59
post #22
post #19

Earlier quoted context omitted.

The problem is that it does not manage and version dependencies for you. Say I start a new C++ project where I want - say - use ZeroMQ and also Folly to parse JSON. Where do I start? Should I install ZeroMQ and its headers globally? What if the version changes? Will it conflict with other system libraries? Well, better start using Docker. What if the version I need is not in the Ubuntu repositories yet? I need to add…

To paraphrase JWZ... "Some people, when confronted with a dependency problem, think 'I know, I'll use Docker.' Now they have two problems." Unfortunately there's no single answer. Static libraries vs. dynamic? Global install or packages from a repo? Everything depends on the degree of control you have over the deployment environment.

True, C/C++ have it a bit more complex. But is it really an unsolvable problem? One would think that with the level of investment in C/C++ someone would be able to create something all the hipster languages have done in the last 20 years.

I guess Gentoo's emerge would be the closest thing to a "good" C/C++ package manager we have today, which I find a bit funny :)

Re: Ada: a C Developer's Perspective

#60

Earlier quoted context omitted.

This idea that Rust and Ada are somehow alternatives continually pops up, and I still don't understand it. They each have their own ideas on what "safety" is, and how to address it. I'll admit I'm biased towards Ada, but I think it is pretty safe to say that "Rust safety" is a subset of "Ada safety" - but Rust does it's section and run further with it than Ada. Rust is obsessed with memory safety. That's it's thing.…

How does Ada address the problems that Rust's borrow checker addresses? Use-after-free in particular. As for not being alternatives, how do they mix in the same project? Does Ada have C-compatible FFI that lets both Ada and Rust see each other as C?

> How does Ada address the problems that Rust's borrow checker addresses? Use-after-free in particular.

It has a more limited way of writing safe programs (memory pools and sub-pools, no aliasing by default, etc). That said, for some programs you will have to go unsafe and then you're done; however, from my limited experience with Rust it's also true there (Doubly linked list ?) even though you can go further and check more things.

Some people are working on having something similar in Ada/SPARK FWIW :)

> As for not being alternatives, how do they mix in the same project? Does Ada have C-compatible FFI that lets both Ada and Rust see each other as C?

Ada does have a C-compatible FFI, and in theory you can interface Rust and Ada. I don't know if it has been done though !

Post reply on HN