Live data from Hacker News

Ada, its design, and the language that built the languages

iqiipi.com

191–200 of 242 posts

Re: Ada, its design, and the language that built the languages

#191
post #178

I find multiple "strange" flaws with the article, even for my appreciation of Ada _and_ the article as an essay: * The article claims only Ada has true separation of implementation vs specification (the interface), but as far as I am able to reason, also e.g. JavaScript is perfectly able to define "private" elements (not exported by an ES6 module) while being usable in the module that declares them -- if this isn't "…

> The article claims only Ada has true separation of implementation vs specification (the interface), but as far as I am able to reason, also e.g. JavaScript is perfectly able to define "private" elements (not exported by an ES6 module) while being usable in the module that declares them -- if this isn't "syntactical" (and semantical) separation like what is prescribed to Ada, what is the difference(s) the article tr…

It might interest you to know JS has real private fields, formally introduced in ES2022. [1]

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: Ada, its design, and the language that built the languages

#192

Ada was also ignored because the typical compiler cost tens of thousands of dollars. No open source or free compiler existed during the decades where popular languages could be had for free. I think that is the biggest factor of all.

That factor was downstream of its complexity though. It's far harder to implement a compiler for Ada 83 than even for modern C.

Re: Ada, its design, and the language that built the languages

#193
post #152
post #106

Earlier quoted context omitted.

I have not seen it, but there is something close to what you ask about: Turbo Modula-2 (an implementation of MODULA-2 written by Martin Odersky), as both MODULA-2 and PASCAL were Niklaus Wirth-invented languages that looks very similar to Ada: "Shortly before we finished our compiler, Borland came out with Turbo Pascal, and they were considering going into the Modula-2 market as well. In fact, Borland decided to buy…

I think Oracle PlSQL was also based on Ada, basically Ada + SQL embedded. So it may be the widest used version of "Ada".

Pretty much [close enough for government work]; see: https://stackoverflow.com/questions/7764656/who-is-diana-and...

Re: Ada, its design, and the language that built the languages

#194
post #146

Earlier quoted context omitted.

Let's just be honest that even if there was a free compiler in 1985 or earlier, there's no way that e.g. someone like Linus Torvalds or an RMS etc would have written various groundbreaking pieces of software on Ada. It was just in an entirely different headspace. I was around then, and culturally there just wasn't this (legitimate) concern with safety in the more "hacker" and Unix community generally. C won headspace…

> while providing the minimum of abstraction people wanted Yes, I think this is key. I wasn't around in 1985, but on every attempt to write something in Ada I've found myself fighting its standard library more than using it. Ada's stdlib is an intersection of common features found in previous century's operating systems, and anything OS-specific or any developments from the last 30 years seem to be conspicuously abse…

To be fair, the file-handling is probably the 'crustiest' part of the standard library. (To use the posix-flags, you use the Form parameter.)

The best way to use Ada, IMO, is type-first: you define your problem-space in the type-system, then use that to solve your problem. -- Also, because Ada's foreign-function interface is dead easy, you could use imports to handle things in a manner more amiable to your needs/preferences, it's as simple as:

    Function Example (X : Interfaces.Unsigned_16) return Boolean
      with Import, Convention => COBOL, Link_Name => "xmpl16";
You can even put pre-/post-conditions on it.

Re: Ada, its design, and the language that built the languages

#195
post #68
post #41

I like the article overall but the continually repeated 'Language X didn't have that until ' is very grating after the first ten or so. I also wish there were concrete code examples. Show me what you are talking about rather than just telling me how great it is. Put some side by side comparisons!

I imagine an ada dev would find the pattern grating over the decades, so it reads like an expression of that experience.

Yep. And sometimes it's hype over the weirdest things... a good example "dependency injection".

    Generic
      Type Index   is ();                                      -- Any discrete type.
      Type Element is limited private;                           -- Any non-discriminated type.
      Type Vector  is array(index range ) of element;          -- An array-type of Element, indexed by Index.
      with Function "="(Left, Right: Element) return Boolean ; -- Equal, defaulted.
      with Function "; -- Less-than, defaulted.
    Function Generic_Sort( X : Vector ) return Vector;
Now when we instantiate we can inject '>' in place of the '
    Function Sort is new Generic_Sort( Index => Integer, Element => Integer, Vector => Integer_Array, " ">");

Re: Ada, its design, and the language that built the languages

#196
post #56
post #36

I really don't want this to be AI writing because I enjoyed it, but as other commenters have pointed out, the rate of publishing (according to the linked Twitter account) is very rapid. I'm worried that I can't tell.

>the rate of publishing (according to the linked Twitter account) is very rapid. I've written almost 50 blog posts in the last 3 years. All in draft, never published mostly because a crippling imposter syndrome and fear of criticism. But every now and then I wake up full of confidence and think "this is it. today I'll click publish I don't give a fuck. All in". Never happens. Maybe this author was in the same boat un…

Hey, let me encourage you: do it. You might be surprised at the agreement you get, or at discussions.

Re: Ada, its design, and the language that built the languages

#197

I would never work on projects that ADA is used for. 1. Would never work on "missile tech" or other "kills people" tech. 2. Would never work for (civ) aircraft tech, as i would probably burn out for the stress of messing something up and having a airplane crash. That said, im sure its also used for stuff that does not kill people, or does not have a high stress level.

It's actually really great for anything where you want to be more safe/correct, like banking... and the `TASK` construct makes it really nice for naturally multitasking situations. A couple of the people in the community are putting together gamedev tools/engine.

Re: Ada, its design, and the language that built the languages

#199
post #174

Earlier quoted context omitted.

* only if `x` is _an object_ (read: has methods) To preempt the obvious: yes, I know _everything_ (nearly) in JavaScript is an object, but a module exporting a `Function` can expect the caller to use the function, not enumerate it for methods. And the function can use a declaration in the module that wasn't exported, with the caller none the wiser about it.

I think you're confusing values with types. JS modules can certainly keep a value private, but there's no way for them to expose an opaque type , because that concept simply doesn't exist in JS. The language only has a few types, and you don't get to make more of them. TypeScript adds a lot of type mechanism on top, but because it's restricted to being strippable from the actual JS code, it doesn't fundamentally chan…

Here's an opaque type wrapping numbers, in JavaScript:

    class Age {
        #value;
        constructor(value) {
            if(typeof value != "number") throw new Error("Not a number");
            this.#value = value;
        }
    }

Re: Ada, its design, and the language that built the languages

#200
post #163

Earlier quoted context omitted.

The real problem is that Ada forces you to plan ahead and most developers don't really know how to do that.

I'd say that is even more so with Rust and Rust got popular in a very short amount of time.

I think this was a genuine generational change. I am pretty sure Rust would never have become popular 20 years earlier because the priorities back then were so different (that was the era of languages like Ruby and Pearl where conciseness and low verbosity were the most valued aspects).
Post reply on HN