News for hackers. Stuff that matters.
Re:A Random Walk Through Ada (2014) by goatlover on Tuesday November 01, 2016 @08:25PM (#12851346)
Ada is like Smalltalk or Lisp at this point. It's not new and shiny. It's not being marketed. It's seen as outdated, or even extinct (how many people know an Ada developer or project)? Like it or not, people bandwagon technologies. Not to say anything against Rust, Go, etc. But how many people who have jumped on one of those bandwagons did so after examining Ada, and found it wanting in comparison, do you suppose?

There's also the expectation that a more modern language will have modern tooling people today need, and community support easy to find (if it's caught on).

Re:A Random Walk Through Ada (2014) by planteen on Tuesday November 01, 2016 @11:20PM (#12852025)
You see Ada used in legacy code bases in aerospace and defense. A big problem, at least at an ex employer of mine, is that no young engineers have a desire to learn Ada. It completely pigeonholds you to the aerospace/defense industry's legacy systems.
Re:A Random Walk Through Ada (2014) by marssaxman on Wednesday November 02, 2016 @12:16AM (#12852212)
That's been true for at least a quarter century, since I was a young engineer hearing Ada mentioned as another one of those fusty old legacy languages like FORTRAN or COBOL. Even if I'd felt any interest in trying it out, I had no access to any Ada compiler.
Re:A Random Walk Through Ada (2014) by jdboyd on Wednesday November 02, 2016 @12:44AM (#12852309)
Perhaps you didn't have access to an ADA compiler 25 years ago, but GNAT has been free and open source for about 20 years and part of GCC for more than 15. Of course, 20 years ago, ADA was already 15 years old, so no surprise that when it became accessible it was already branded fusty.
Re:A Random Walk Through Ada (2014) by flomo on Wednesday November 02, 2016 @02:29AM (#12852715)
Even back in the 1980s, ada had a "stodgy government bondage & discipline language" reputation. At least among the hacker set, who back then was all about bit-banging the machine.

I'd speculate that ada never received the big commercial push, like Sun Java received. There were no salesreps talking up ada on the golf-course to CIOs, and there weren't marketing people planting 'Ada is great' stories in the popular press. It always had "the pentagon made me use it" aura around it.

Re:A Random Walk Through Ada (2014) by a_imho on Wednesday November 02, 2016 @09:41AM (#12854553)
>no young engineers have a desire to learn Ada.

I think this is akin to statements when companies say they have a shortage of developers. Of course they do when they offer no good incentives to join. Offer (above) market salaries and young people will flock to Ada.

Re:A Random Walk Through Ada (2014) by pjmlp on Wednesday November 02, 2016 @01:49AM (#12852581)
It may be wrong, but from occasionally attending Ads talks at FOSDEM, I got the idea that at least in Europe in what concerns high integrity systems, Ada's has be slowly increasing.

Also quite a few European universities do seem to teach it nowadays.

Re:A Random Walk Through Ada (2014) by femto on Tuesday November 01, 2016 @08:43PM (#12851427)
I'd expect someone who knows VHDL could get up to speed on Ada pretty quickly. VHDL is a widely used Hardware Description language, which was derived from Ada.
Re:A Random Walk Through Ada (2014) by user5994461 on Wednesday November 02, 2016 @08:12AM (#12853881)
To have done [a bit] of both. I doubt that.
Re:A Random Walk Through Ada (2014) by gaius on Wednesday November 02, 2016 @06:34AM (#12853457)
PL/SQL is also derived from Ada.
Re:A Random Walk Through Ada (2014) by pjmlp on Wednesday November 02, 2016 @06:45AM (#12853495)
Which makes me a bit happier every time I have to dig into our stored procedures. :)
Re:A Random Walk Through Ada (2014) by catnaroek on Tuesday November 01, 2016 @11:07PM (#12851976)
Rust demonstrably gives you stronger static guarantees than Ada, which, just like C++, is a lot larger than C, for relatively little benefit in terms of safety.
Re:A Random Walk Through Ada (2014) by fghgfdfg on Wednesday November 02, 2016 @03:17AM (#12852847)
I completely disagree with those statements.

Rust can give stronger static guarantees in simpler instances. When it comes to more complex cases, neither language can guarantee much. Ada however has better mechanisms for handling them safely. For example, you can specify a particular allocator for individual types rather than relying on each allocation to use the custom allocator.

If you're outside the realm of the Rust borrow checker and want to use an arena to keep the memory side of things simple and safe, it's much easier to do properly in Ada.

Ada is also significantly safer than C. Between the much stronger type system, memory safety facilities, bounds checking, non-nullable pointer types, generics, contracts etc. it's clearly a much safer option than C.

Re:A Random Walk Through Ada (2014) by catnaroek on Wednesday November 02, 2016 @07:39AM (#12853722)
> For example, you can specify a particular allocator for individual types rather than relying on each allocation to use the custom allocator.

Having a 1-to-1 correspondence between types and allocators screams of lack of separation of concerns. In any case...

> If you're outside the realm of the Rust borrow checker and want to use an arena to keep the memory side of things simple and safe, it's much easier to do properly in Ada.

Arenas can be given safe interfaces in Rust just fine: https://crates.io/search?q=arena

> memory safety facilities

The article literally says: “Tasks are awesome, but sometimes they're not quite what you want --- particularly as there's no protection against two tasks modifying the same variable at the same time.”

So much for memory safety.

> bounds checking

Implementable as a library feature. For example, in Standard ML:

    signature BOUNDS =
    sig
      val minBound : int
      val maxBound : int
    end
    
    (* INTEGER and Overflow are in the Basis Library *)
    
    functor BoundsChecked (include BOUNDS) :> INTEGER =
    struct
      type int = int
      fun toInt x = x
      fun fromInt x =
        if x < minBound orelse x > maxBound
        then raise Overflow else x
      val op+ = fromInt o op+
      val op- = fromInt o op-
      val op* = fromInt o op*
      (* rest of implementation... *)
    end
There is no need to bloat the core language.

> non-nullable pointer types

In an unusable way.

> generics

Parametric polymorphism buys you non-repetition, not safety.

> contracts

Contracts don't buy you safety. Your code will just crash at more predictable places when a contract assertion fails. But it will still crash. Hard.

Static analysis buys you safety.

Re:A Random Walk Through Ada (2014) by fghgfdfg on Thursday November 03, 2016 @01:52AM (#12861873)
> Having a 1-to-1 correspondence between types and allocators screams of lack of separation of concerns. In any case...

It's a 1-to-1 correspondence between an access type (aka pointer) and an allocator. There isn't an issue with separation of concerns.

> Arenas can be given safe interfaces in Rust just fine

I never said they couldn't. I said, they require the arena allocator to be used explicitly for each and every allocation. So if you screw that up, it's a problem.

> The article literally says: “Tasks are awesome, but sometimes they're not quite what you want --- particularly as there's no protection against two tasks modifying the same variable at the same time.”

And if you bothered to read another few sentences, you would see the article mention controlled types. These are types that exist to be task-safe. It's entirely safe.

> <bounds checking> Implementable as a library feature.

Which makes it more difficult or impossible (depending on other language features) to detect such errors at compile time. It's also much harder or impossible to optimize away the checks when possible. And finally being a separate library means it's not part of the core language. You might call that bloat, I call it good design that not only requires safety but fosters an environment that encourages safety. You can have all the best most safe features in the world, but if they are hidden off in a library then programmers must explicitly reach for them and by default start off playing around in unsafe ways. It becomes a cultural thing.

> (non-nullable pointer types)In an unusable way.

What? Care to expand? I've used them before, so they are usable in some sense at least...

> Parametric polymorphism buys you non-repetition, not safety.

Non-repetition buys you a single place to screw up, rather than many.

> Contracts don't buy you safety. Your code will just crash at more predictable places when a contract assertion fails. But it will still crash. Hard. Static analysis buys you safety.

Where possible Ada contracts are checked statically. Contracts that are checked at run-time do buy you safety too, though. Not in a given build, but unless you are in the habit of shipping as soon as you get a successful compile, having crashes occur as soon as there is a problem is a wonderful way of being able to quickly identify not only that a problem exists, but what the problem is. In terms of actual software development, it very much helps with producing correct software.

Re:A Random Walk Through Ada (2014) by vertex-four on Wednesday November 02, 2016 @07:04AM (#12853571)
It's relatively easy to create a type which can't be created at all by functions outside the module it's defined in - add any private member. Then that module is in control of how it's created, and can set any restriction you like. This pattern is regularly used in Rust to ensure that types are always initialised correctly.
Re:A Random Walk Through Ada (2014) by fghgfdfg on Thursday November 03, 2016 @01:37AM (#12861834)
Sure, you can do things like that too in Ada. To some degree that might make sense sometimes, but having the option of an equally safe type that's used in a "normal" fashion, rather than something that has to go through the proper library interface has some advantages as well.
Re:A Random Walk Through Ada (2014) by vertex-four on Thursday November 03, 2016 @01:50PM (#12866234)
It's relatively uncommon in Rust in general to create types without going through their constructors.
Re:A Random Walk Through Ada (2014) by Avshalom on Tuesday November 01, 2016 @11:56PM (#12852131)
Though SPARK gives you stronger guarantees than rust.
Re:A Random Walk Through Ada (2014) by jonathanstrange on Wednesday November 02, 2016 @06:24AM (#12853423)
In my opinion, Rust traded in too much readability for conciseness and made a number of dubious syntax choices.

Don't get me wrong, I'm just talking about personal preferences and I'm planning to use Rust in future projects. It's a fine language. It just tries too much to please programmers from other languages...

Re:A Random Walk Through Ada (2014) by catnaroek on Wednesday November 02, 2016 @07:27AM (#12853667)
> readability for conciseness

Are you talking about lifetime elision?

> dubious syntax choices

Surface syntax is neither here nor there. In any case, fixing the surface syntax of a language is much less involved than fixing its semantics.

Re:A Random Walk Through Ada (2014) by jonathanstrange on Wednesday November 02, 2016 @07:55AM (#12853789)
These considerations are irrelevant from a usage perspective.
Re:A Random Walk Through Ada (2014) by pjmlp on Wednesday November 02, 2016 @06:46AM (#12853497)
In the begging there was a rule about how long keywords in Rust were supposed to be, if I remember correctly.
Re:A Random Walk Through Ada (2014) by steveklabnik on Wednesday November 02, 2016 @07:03AM (#12853567)
There was. That was thrown out years ago though, ret has been return for a very long time.