Readit News logoReadit News

Dead Comment

Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
andrewl-hn · 7 months ago
Even with administration change in the US there is a long-term initiative across multiple agencies to eventually move to more robust software, and a part of it is the push towards more safe programming languages (where safe means fewer memory issues, fewer vulnerabilities, less bugs in general, etc.). Similar government initiatives now start in Europe and elsewhere in the world, too.

This regulatory change is not new, it has been going on for years and will take more years to finish. And even without a regulatory pressure, the migration would happen eventually. Look at the cars. As they get more features like adaptive cruise control and various driver assistance features, the need for software that runs with no lag and is reacting to surroundings correctly and quickly becomes absolutely critical. Car companies now can go out of business simply because their software is buggy. The car vendors now produce more software than ever, and they are in dire need for better programming tools than ever.

Languages like Java, Scala, C#, Go, etc. cover many scenarios like cloud services and, for example, car entertainment system. But for devices, microcontrollers, real-time low latency systems etc. C and C++ have been the go-to languages for decades, and now it is starting to change, because turns out it is very, very hard to write correct, bug-free, safe, and secure software in these languages.

Rust is one language that is getting into this market: Rust Foundation established a Safety-Critical Rust Consortium last year, for example, and Ferrocene compiler has a bunch of certifications done already. Ada is another option that would work for many such use-cases, too. The selling point of Ada is that it's been around for a long time and many vendors already have established compilers and tools with all appropriate certifications and qualifications done for all sorts of industries.

So, it's not really "Ada is interesting" and more "Languages that can replace C and C++ are interesting".

Lucretia9 · 7 months ago
That's why Toyota moved to Ada, because their C or C++ software caused crashes.
Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
amelius · 7 months ago
The term "pattern type" is more or less invented by Rust. See this old comment, and the first reply in particular:

https://news.ycombinator.com/item?id=39570633

Lucretia9 · 7 months ago
Pattern matching is in all functional languages, afaik.
Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
weinzierl · 7 months ago
I am always confused about the terminology. I know RangeTypes or RangedTypes from Pascal, but I think in Rust they are something else. The talk mentions SubTypes in the ADA context which I know from an OO context, but again it seems to be different. Then there are Refinement Types which seem to be more powerful but subsume the others. And now we also have Pattern Types.

Can someone bring order in these concepts?

Lucretia9 · 7 months ago
Ada has ranges and subtypes.

  type Angles is 0 .. 360;
  subtype Acute_Angles is range Angles'First .. 90;
Subtypes can be used with the parent type without conversions.

Pascal only has subranges, iirc.

Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
wiz21c · 7 months ago
Because ADA is maintained by big actors who think ADA is for "mission critical" stuff and not our lowly web apps.

Problem is, web is the new BASIC and many devs will start there and they will see rust first. And where's that ADA game engine ?

ADA can definitely claim tons of successes and very powerful constructs, but mindhsare is clearly not one of its selling points.

Lucretia9 · 7 months ago
c is the new BASIC.
Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
Lucretia9 · 7 months ago
FYI, re the ranges in rust, you can do a range minus 10 in Ada, I use it in my SDL2 bindings.
Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
DoingIsLearning · 7 months ago
The vendor list is really telling of the issues with Ada's adoption:

- Of my quick scan, only AdaCore supports Ada 2012 (where a lot of the really good stuff is implemented) the rest are stuck on Ada 95.

- None of the vendors seem to list transparent pricing.

If you are only selling based on volume and through a sales rep then you are off the bat excluding most startups, SMEs, and just general bootstrap curious folks.

Lucretia9 · 7 months ago
If the price is not on the website, you can't afford it.
Lucretia9 commented on The state of Rust trying to catch up with Ada [video]   fosdem.org/2025/schedule/... · Posted by u/pjmlp
pjmlp · 7 months ago
Mostly,

- Compiler prices

- The few UNIX vendors that supported it like Sun, it was extra on top of C and C++ compilers, why pay more when C and C++ were already in the box

- Hardware requirements

Still, there are around 7 Ada vendors around.

https://www.adacore.com/

https://www.ghs.com/products/ada_optimizing_compilers.html

https://www.ptc.com/en/products/developer-tools/apexada

https://www.ddci.com/products_score/

http://www.irvine.com/tech.html

http://www.ocsystems.com/w/index.php/OCS:PowerAda

http://www.rrsoftware.com/html/prodinf/janus95/j-ada95.htm

Lucretia9 · 7 months ago
Your first point cancels out your fourth.
Lucretia9 commented on Ada's dependent types, and its types as a whole   nytpu.com/gemlog/2024-12-... · Posted by u/nytpu
alexvitkov · 8 months ago
You don't need explicit language support to do this -- it's a fairly common practice in videogame development, but we usually usually call it an arena/scratch buffer. Ryan Fleury has a wonderful article where goes at length about different memory management strategies [1].

It's just a static buffer that you can use for temporary allocations, e.g. to return an array of 50 int32's to a parent stack frame you can just allocate `50*sizeof(int32)` bytes on that buffer and return a pointer to the beginning, instead of a heap-allocated `std::vector<int32>`. Every allocation advances the head of the buffer, so you can have multiple allocations alive at the same time.

Every once in a while you need to free the buffer, which just means resetting its head back to the start - in the case of games the beginning of a new frame is a convenient point to do that.

This doesn't solve dynamic memory in general, as it can't be used for long-lived allocations, it just saves you a bunch of temporary heap allocations. It doesn't solve all problems that RAII does either, as RAII is often used for resources other than memory - files, sockets, locks, ...

[1] https://www.rfleury.com/p/untangling-lifetimes-the-arena-all...

Lucretia9 · 8 months ago
Ada has the concept of Pools, the heap is one of the pools, you can define your own.
Lucretia9 commented on Ada's dependent types, and its types as a whole   nytpu.com/gemlog/2024-12-... · Posted by u/nytpu
wffurr · 8 months ago
Context free curly braces in deeply nested code make me crazy. Labels to match up with the open symbol would be super helpful.

My company’s style guide requires them on closing braces for namespaces.

Lucretia9 · 8 months ago
Pretty sure Java in vscode and android studio places block names after }'s because it's hard to read otherwise.

u/Lucretia9

KarmaCake day114May 18, 2017
About
https://github.com/Lucretia/
View Original