News for hackers. Stuff that matters.
Re:Ada Outperforms Assembly: A Case Study by smitty1e on Saturday July 15, 2023 @09:29PM (#36742632)
> With the exception of the 1996 update note below, this article is reprinted from the Proceedings of TRI-Ada '92, Orlando, FL, November 16-20, Association for Computing Machinery (ACM), New York, 1992.
Re:Ada Outperforms Assembly: A Case Study by necroforest on Saturday July 15, 2023 @09:37PM (#36742679)
Does anyone use Ada in 2023? Back in college (~2008), I had a prof who was obsessed with it but AFAIK almost nobody used it even back them.
Re:Ada Outperforms Assembly: A Case Study by Rebelgecko on Saturday July 15, 2023 @09:48PM (#36742731)
I think it's still somewhat common in defense and safety of life type applications, and not much outside of those niches
Re:Ada Outperforms Assembly: A Case Study by Jtsummers on Saturday July 15, 2023 @09:53PM (#36742754)
Aerospace, defense, and safety critical systems still use it. It's less common these days but still out there. Ada 2012 is pretty nice if you're going to be writing imperative/procedural code anyways.
Re:Ada Outperforms Assembly: A Case Study by windexh8er on Saturday July 15, 2023 @10:54PM (#36743070)
I worked for a defensive contractor in the early 2000s. We had MS2 and ATC programs in our facility. Anything that had to do with the operations of ATC was written in ADA. Almost all the guys I worked with went to school at Embry Riddle. Pretty sure those systems are still written in ADA.
Re:Ada Outperforms Assembly: A Case Study by frankreyes on Sunday July 16, 2023 @11:29AM (#36748104)
> It's less common these days

Was Ada replaced by something else? What do they use?

Re:Ada Outperforms Assembly: A Case Study by Jtsummers on Sunday July 16, 2023 @11:48AM (#36748319)
I'm not sure "replaced" so much as "didn't grow" or "didn't grow as fast". Even in the 90s when the US DOD mandated Ada it wasn't used universally in defense projects because people got waivers for it. As the number of projects grow if Ada's not growing as fast as the others in adoption then it's getting a smaller and smaller share of the market. C and C++ took a lot of the marketshare in newer developments and rewrites of older Fortran, JOVIAL, and assembly systems.

So as a percentage of the market in the aerospace, defense, and safety space it has shrunk. In absolute numbers, I'm not sure if there are more or fewer systems developed and currently being maintained in it than 20 or 25 years ago. But C and C++ have definitely grown in that space.

Re:Ada Outperforms Assembly: A Case Study by frankreyes on Monday July 17, 2023 @07:34AM (#36756779)
Thanks, the usual sentiment with C and C++ is that it's unsafe to make anything beyond a hello world. Happy to hear that defense is using them. Last time I had to write Ada was in university!
Re:Ada Outperforms Assembly: A Case Study by kokorozasu on Saturday July 15, 2023 @09:55PM (#36742764)
I graduated recently and my first project out of college was in Ada. It was defense-related. I have also heard rumors of banks still having some ada code.

My impression of the language is that it is a lot close to C than other languages like Java or Rust.

Re:Ada Outperforms Assembly: A Case Study by ttoinou on Saturday July 15, 2023 @09:55PM (#36742767)
In France I did learn Ada at computer science school. Maybe because it is useful for the aerospace and aviation industry ? Or because teachers were used to it and deemed it was great to learn programming in a rigorous manner.

I have to say at least when you're coding in Ada there is no ideological fights over functional programming or silly design patterns from OOP. Refreshing.

Re:Ada Outperforms Assembly: A Case Study by kokorozasu on Saturday July 15, 2023 @10:01PM (#36742799)
The ideological fight that occurred at my job where the project was in Ada was that the most senior programmer didn't want to use git.
Re:Ada Outperforms Assembly: A Case Study by salawat on Saturday July 15, 2023 @10:10PM (#36742848)
...What does Version Control System have to do with choice of programming lang?

Do I even want an answer?

Re:Ada Outperforms Assembly: A Case Study by cmrdporcupine on Saturday July 15, 2023 @11:05PM (#36743122)
There is, unfortunately, a cohort for which no other version control system is allowed to exist and git is somehow the final answer.
Re:Ada Outperforms Assembly: A Case Study by zaphirplane on Sunday July 16, 2023 @04:35AM (#36744817)
Be that as it may, The relation to Ada is confounding
Re:Ada Outperforms Assembly: A Case Study by kokorozasu on Sunday July 16, 2023 @10:33AM (#36747446)
My point was that even though we didnt have to worry about what things like OOP or FP ideological stuff still crept in.
Re:Ada Outperforms Assembly: A Case Study by thesuperbigfrog on Saturday July 15, 2023 @10:04PM (#36742807)
>> Does anyone use Ada in 2023?

https://www.adacore.com/industries

Ada is used for situations where the code has to work or people die.

That makes it niche compared to other programming languages where it is okay to "panic" or "fail fast".

Different tools for different needs.

Re:Ada Outperforms Assembly: A Case Study by musicale on Sunday July 16, 2023 @02:05AM (#36744127)
> Ada is used for situations where the code has to work or people die.

C/C++/Java/JavaScript/Python/etc. are used in situations where code doesn't have to be reliable, secure, or correct.

If customers actually cared about any of those things then our favorite tech companies wouldn't be worth zillions of dollars.

Re:Ada Outperforms Assembly: A Case Study by pjmlp on Sunday July 16, 2023 @04:07AM (#36744670)
I am a big proponent of having proper liabilities across the industry, just like any other industry.

As a software enginneer professor of mine would joke, general computing quality is akin to buying a pair of shoes that randomly blow up if tied incorrectly, and people have been educated to put up with it.

With any other industry, if one buys something that doesn't properly work, usually the first reaction is to return to the shop and ask for the money back.

Thankfully digital stores, warranty contracts in project delivery, and ongoing cybersecurity laws, are already some steps into the right direction, yet there is still too much to be done.

Re:Ada Outperforms Assembly: A Case Study by musicale on Monday July 17, 2023 @11:47PM (#36767577)

    EULA: By using this product, you (user) agree that:
    1. It might kill your dog, and it will be your fault.
    2. Any other harm or defects will be your fault as well.
    3. You abandon all rights to sue us, ever, for anything.
    4. Any dispute will be handled by our arbitration department.
    5. We are free to spy on you and share all information with 
       our marketing partners or anyone else who asks.
Re:Ada Outperforms Assembly: A Case Study by hsjqllzlfkf on Sunday July 16, 2023 @09:50AM (#36746982)
C is used in situations where choose doesn't have to be reliable - wanna expand?

In my superficial understanding of computers, Linux is the paragon of reliability, so naively I would say that shows that C is good enough. However, in also aware that some instructions don't have such a great view of Linux, but I don't know much.

Re:Ada Outperforms Assembly: A Case Study by musicale on Sunday July 16, 2023 @07:04PM (#36752308)
Linux: written in C, hundreds of buffer overflow errors

Multics: written in PL/I, approximately zero buffer overflow errors

see also: https://www.cvedetails.com/product/47/Linux-Linux-Kernel.htm...

Re:Ada Outperforms Assembly: A Case Study by hsjqllzlfkf on Monday July 17, 2023 @10:57AM (#36759044)
That doesn't tell me much. Linux is much bigger and more used than whatever multics is. So the fact that more bugs are documented is no surprise.
Re:Ada Outperforms Assembly: A Case Study by Jtsummers on Monday July 17, 2023 @02:28PM (#36762073)
It should tell you that Linux is not a "paragon of reliability" unless you have a non-standard definition of paragon and/or reliability.
Re:Ada Outperforms Assembly: A Case Study by musicale on Monday July 17, 2023 @11:37PM (#36767517)
And that many serious Linux vulnerabilities were facilitated by the C/gcc language and runtime:

"The net result is that a PL/I programmer would have to work very hard to program a buffer overflow error, while a C programmer has to work very hard to avoid programming a buffer overflow error."

https://www.acsac.org/2002/papers/classic-multics.pdf

Re:Ada Outperforms Assembly: A Case Study by SnorkelTan on Saturday July 15, 2023 @10:04PM (#36742809)
My understanding is it's used in embedded and real-time systems domains. It came out of the DoD apparently.

https://en.wikipedia.org/wiki/Ada_(programming_language)

Re:Ada Outperforms Assembly: A Case Study by asddubs on Saturday July 15, 2023 @10:42PM (#36743011)
The GHDL compiler/simulator is written in ada. I suppose this makes sense since VHDL shares a lot of syntax with Ada
Re:Ada Outperforms Assembly: A Case Study by stock_toaster on Saturday July 15, 2023 @10:50PM (#36743046)
Re:Ada Outperforms Assembly: A Case Study by FpUser on Saturday July 15, 2023 @10:56PM (#36743076)
The same question can be asked about many languages that are very actively used. Just not by web army.

From my personal experience - I use many languages and I mostly base my choice on perceived ROI for particular project / situation. I could not give a flying fuck if "anyone still uses those in 2023" .

Re:Ada Outperforms Assembly: A Case Study by yjftsjthsd-h on Sunday July 16, 2023 @12:02AM (#36743502)
ROI is substantially influenced by the ecosystem; the more libraries and documentation are published, the better the ROI.
Re:Ada Outperforms Assembly: A Case Study by riffraff on Sunday July 16, 2023 @12:50AM (#36743773)
Also ability to hire or train people fast enough. It should not be your only consideration but it should be factored in.
Re:Ada Outperforms Assembly: A Case Study by FpUser on Sunday July 16, 2023 @09:20AM (#36746702)
I am very small and never needed more than couple at subcontractors of the same time. With the whole world being at my disposal I've had zero problems finding decent freelancers for any language.
Re:Ada Outperforms Assembly: A Case Study by FpUser on Sunday July 16, 2023 @09:16AM (#36746661)
Thanks for generic reply that could be totally wrong for particular situation
Re:Ada Outperforms Assembly: A Case Study by evertedsphere on Sunday July 16, 2023 @01:50AM (#36744060)
I work for a bank in Europe, and we have a large Ada project that does a lot of number crunching and is extensively depended on.
Re:Ada Outperforms Assembly: A Case Study by ajdude on Sunday July 16, 2023 @04:23AM (#36744754)
The latest version of the Ada standard came out in 2022. It has its own package manager similar to Cargo and I'm actively working in Ada. Favorite language.
Re:Ada Outperforms Assembly: A Case Study by pornel on Saturday July 15, 2023 @09:49PM (#36742735)
Nowadays CPU pipelining is the norm, so all serious optimizers have to do instruction scheduling. Beating naive assembly written for one instruction after another, is not novel any more.
Re:Ada Outperforms Assembly: A Case Study by ttoinou on Saturday July 15, 2023 @09:58PM (#36742778)
Can you write pipelines asm / schedule instructions with custom asm code ?
Re:Ada Outperforms Assembly: A Case Study by monocasa on Saturday July 15, 2023 @10:41PM (#36743002)
With the right feedback cycle with the appropriate debug counters, absolutely.
Re:Ada Outperforms Assembly: A Case Study by okanat on Saturday July 15, 2023 @11:07PM (#36743141)
Somebody has to come up with the intended results of the optimization for certain chips and the actual benchmarks in the first place. So they do write assembly and test various things.

However, that person probably have extensive experience in that narrow set of problems. Most programmers don't.

Re:Ada Outperforms Assembly: A Case Study by jleahy on Sunday July 16, 2023 @11:39AM (#36748218)
There are still jobs where you end up writing large amounts of asm regularly and this is absolutely table-stakes for that. Otherwise there would be no point using asm at all, you’d just use C or another high-level language.

There was once a case where someone dropped from asm to machine code to shave a little more performance off. Sometimes asm is too high-level.

Re:Ada Outperforms Assembly: A Case Study by olliej on Saturday July 15, 2023 @10:34PM (#36742969)
I feel like disabling all the error checking is a significant change for comparing performance, because the phrasing implies removal of bounds checks, etc that can be significant.

That aside a 2x performance improvement speaks to something algorithmic rather than the canonical "sufficiently intelligent compiler" - does anyone have the before/after source for this "study" (Obviously it does matter that algorithmic improvements may be easier in a higher level language, but that is likely truer for any high level language vs assembly)

Re:Ada Outperforms Assembly: A Case Study by compsciphd on Sunday July 16, 2023 @03:23AM (#36744439)
(1992)
Re:Ada Outperforms Assembly: A Case Study by yakubin on Sunday July 16, 2023 @05:27AM (#36745090)
Needs a (1992) — time of original publication — or (1996) — time of last update.