4 ms·
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 separat
by hackrmn 6mo ago
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 "syntactical" (and semantical) separation like what is prescribed to Ada, what is the difference(s) the article tries to point out?
* Similarly, Java is mentioned where `private` apparently (according to the article) makes the declaration "visible to inheritance, to reflection, and to the compiler itself when it checks subclass compatibility" -- all of which is false if I remember my Java correctly -- a private declaration is _not_ visible to inheritance and consequently the compiler can ignore it / fast-track in a subclass since it works much the same as it has, in the superclass, making the "compatibility" a guarantee by much the same consequence
I am still reading the article, but having discovered the above points, it detracts from my taking it as seriously as I set out to -- wanting to identify value in Ada that we "may have missed" -- a view the article very much wants to front.
- twoodfin 6mo agoLLMs are weaponized Gell-Mann amnesia when it comes to writing for humans.
- noahbp 6mo agoUnfortunately, you're right. It is LLM-written: https://www.pangram.com/history/8b17aa57-ce1f-4f46-85f4-4db0bd49d48f https://www.pangram.com/history/8b17aa57-ce1f-4f46-85f4-4db0...
- twoodfin 6mo agoI don’t need a tool to tell me that, and if it was a well-written, interesting, accurate essay, I wouldn’t care. But it’s none of those three things. It is, however, the result of a model trained very effectively to give humans—including hn readers—what they want.
- lproven 6mo agoThese tools are no more truthworthy than any other LLM slop-extruder.
- layer8 6mo agoThe reflection part is true. Private members are accessible to reflection in Java. You can call setAccessible(true) and then modify the contents of a String, for example.
- init1 6mo ago> 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 tries to point out? This is false. For example in Ada you can write: package Foo type Bar is private; procedure Initialize (Item : in out Bar); private type Bar is record Baz : Integer; Qux : Float; end record; end Foo; Users of the Foo package know there is an opaque type called Bar. They can declare variables of the type, they can use the defined API to operate on it but they cannot reference the implementation defined private members (Baz, Qux) without compile errors. Yes Ada does give you the power and tools to in a very blatantly unsafe and obvious way cast it as another type or as an array of bytes or whatever but if you're doing stuff like that you have already given up. In JavaScript there are no such protections. For example if you have a module with private class Bar and you export some functions that manipulate it: class Bar { constructor() { this.Baz = 420; this.Qux = 1337.69; } } export function Initialize() { return new Bar(); } In client code you have no issue inspecting and using the private values of that class: import { Initialize } from 'module'; let myBar = Initialize(); myBar.Baz = 42069; // works just fine Object.keys(myBar).forEach(console.log); // you can iterate parameters. myBar.Quux = 'Corge'; // add new parameters delete myBar.Baz; // I hope no functions rely on this... Using the private parts of Bar should 100% be a compilation error and even the most broken languages would have it at least be a runtime error. Lmao JS.
- deleted 6mo ago[deleted]
- sa46 6mo agoIt 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/Reference/Classes/Private_elements https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...