Live data from Hacker News

Giving Ada a Chance

ajxs.me

141–150 of 261 posts

Re: Giving Ada a Chance

#141

Earlier quoted context omitted.

If it helps make up your mind at all, I was much the same the way until I ended up trying Ada. After a night bashing my head against the compiler... well now every time I see a new language pop up I quickly check a few of the features I've become too attached to from Ada and usually* leave in disappointment. You can decide for yourself if this is an endorsement or a warning. Or both. *Exceptions obviously exist for v…

Yeah, ranges and modular types for me, without them data modelling is hindered severely.

Ranges are a pretty big part of it for me, but what really gets me is the ease of creating useful new types. Having to destructure a new type to use it, or create a bunch of pass-through functions kinda ruins the point. I haven't seen any language really have a strong cultural focus on types like Ada does, and I think the ease of creating and using new types is the cause.

I think the best I've actually seen in this regard is actually Haxe, with some decent macros for automatically getting pass-through functions. It doesn't even make you list them all out explicitly (as I've seen others do), IIRC.

Re: Giving Ada a Chance

#142

Earlier quoted context omitted.

I wouldn't say Ada lacks memory safety. It doesn't go for 100%-in-all-cases but neither does Rust. The main differences are that it doesn't do memory safety by default (which is significant), and also treats memory safety with less granularity. Aside from simply making manual memory management less frequent (with things like variably sized arrays), it has memory pools and subpools to handle more large-scale memory sa…

I think it’s time we start expecting 100% memory safety as table stakes, because any flaws are catastrophic. Moore’s Law has more than paid for it; Android could run an animated display and a Bluetooth stack in a wristwatch seven years ago.

For many attempts, like Rust, I don't think the problem is related to Moore's Law at all. It's more a matter of dev time, effort, and expertise.

And even then, I don't think Rust's mechanisms even can be 100% as they are now.

Ada's pools are probably the one that is most related to Moore's Law and actually capable of 100%, or so I'd expect.

Re: Giving Ada a Chance

#143

I love Ada, unfortunately it’s real world use seems to be relegated to old legacy code. I’d like to use it a little more on the side, but I also need to keep my priorities focused on realism, which sadly means ignoring Ada and learning something like C++ which seems unapproachable from any angle. Ada also seems to have a weirdly negative rep in many circles it seems. I recall looking around for an Ada compiler for a…

> people didn’t give any options but instead just joking about how the OP was interested in such a terrible language. I think the attitude is mostly a historical artifact and momentum. The language was soundly rejected in the 80s and 90s by many people in favor of C, for numerous reasons. Some valid, others invalid. It's carried a reputation since then (much like the author's take on Fortran, many quick takes here on…

Bingo. I never heard anything good about Ada until about the time that both C++ and Java were firmly entrenched.

Jack Ganssle has advocated for Ada for a long time. http://www.ganssle.com/rants/ada.htm

Re: Giving Ada a Chance

#144
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

I help beginner python students. Python might be a nice easy scripting language for bashing out NUMPY scripts, but I'm beginning to suspect it is terrible for teaching. The "what type is this variable, and will this function automatically convert it for me" game is not very fun at all for beginners.

I agree that Python is a bad language for beginners. It is conceptually heavyweight and full of opaque behavior. We lost a lot when BASIC stopped being the "standard" introduction to programming.

Re: Giving Ada a Chance

#145

I tend to like Ada, but it is a tiring language to read with the all caps. Also, it 'feels' like it has a gatekeeper group and really doesn't come up in any mobile conversation. I still believe someone will do something akin to a syntax substitution and come up with a well liked language. Also, modern Fortran is not that bad of a language much like the modern parts of C++.

All caps haven't been a part of the language since Ada83, go check the follow up spec, Ada95. Maybe you're thinking of Niklaus Wirth's languages, the Modula's and Oberon?

Wirthian languages seemed to keep the 6bit symbol encoding of the original Pascal, where the symbols and keywords ended up case-nonpreserving. Was that changed at any point with Modula or Oberon? I never have seen any code with all caps.

Re: Giving Ada a Chance

#146

Earlier quoted context omitted.

"Lovecraftian hieroglyphics of Fortran" The author might want to stay away from MUMPS for sanity's sake.

My wife used to work as a webdev at a shop that made its bread and butter contracting out some devs to do M/MUMPS development for a bank. Truly horrifying. The language/DB, but also that this thing was involved in handling people's money.

There are new projects done in MUMPS in finance all the time :|

Re: Giving Ada a Chance

#147

I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say: type OperatingTemp is range 33 .. 90; And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

If I have two OperatingTemps, can I add them? What is the type of the sum?

Re: Giving Ada a Chance

#148
I took my first university course in Ada in 1981. I also worked for a company that provided an Ada runtime in the mid 80's.

Ada was sabotaged early on because it was 'mandated' by the DOD for new programs. That meant that all the usual suspects, like Lockheed, GD , TI (I don't remember exactly which ones) came up with Ada compilers and runtimes that cost on the order of $10K per seat. The typical military contractor ripoff. So it was impossible for individuals or small companies to use Ada on their own dime. It was only feasible if the cost was rolled into a larger (bloated) defense contract. So it couldn't get a following. Of course much later on free versions became available but it was too late.

That said, Ada was absolutely no fun to program with. It was awkward and verbose. I hated it from the get go, compared to the alternatives. If it is so super why is rarely used.

Re: Giving Ada a Chance

#149
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

> People found it frustrating how much work it'd take to get their programs to even compile Makes sense if they're students working on small projects. Ada is explicitly designed to make large programs readable, and willingly trades off on writeability when the two come into conflict. It isn't going to shine if you're writing small 'single shot' applications, that isn't what Ada is for. (Ada also commits to using many…

> (Ada also commits to using many English language words where languages like C use symbols. SQL does this too. I'm not sold on the idea that this improves readability. Of course, there's far more to Ada than the skin-deep matter of its wordy syntax.)

Wasn't the hypothesis behind COBOL that this would allow managers to gain a certain level of understanding of the code?

I find that it made COBOL code notoriously unreadable.

Re: Giving Ada a Chance

#150

I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say: type OperatingTemp is range 33 .. 90; And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

I have little knowledge of HDL’s but I’m constantly hearing bad things about Verilog and good things about VHDL. Is it worth picking up?

I much prefer VHDL to Verilog. Mostly because you can define your own types in VHDL but can't in standard verilog (SystemVerilog is closer to VHDL in capability). Also because the whole reg thing in Verilog just doesn't seem very ergonomic to me - I have to stop and look things up when coding state machines or similar stateful things in Verilog. In VHDL you've got signals and variables. Signals can have state. Variables are only used inside of processes - much easier to remember for me, anyway (maybe my block has to do with learning VHDL first).

And finally VHDL is strongly typed. Verilog is pretty much C-typed meaning it's pretty weak. About a dozen years ago I worked at an EDA company and one of my tasks was to run our generated HDL code through a popular industry linting tool. There were hundreds linting problems with the Verilog code that needed to be fixed. In the VHDL code there were only a couple of things that needed to be addressed - this was mostly due to VHDL's strong type system preventing many of the problems that showed up on the Verilog side.

Post reply on HN