Hacker News new | past | comments | ask | show | jobs | submit | kevlar700's comments login

I'm not afraid of functional programming. I just dislike it. I avoid recursion in Ada personally (others like it). I think OOP is over rated and the clarity of imperative is under rated. Though I do like how Ada provides object oriented design to imperative programs even without touching Adas OOP features (tagged types).


Ada goes beyond memory safety.


Rust tries with a crate and traits but it misses out on e.g. record memory overlays which are so powerful in Ada. Type design is beautifully intuitive for the main part in Ada too. Restricting your parameters with ease means there is less logic to write and mistakes and refactor fallout gets caught early.


Honestly Ada is far better than Rust for close to metal as it was designed for it. It is also safer and easier to use than Rust. Ada has also been demonstrated to be more cost effective over a programs lifetime than C, C++ and Java. I also dropped Go for Ada and prefer the quality and memory control that Ada offers. The only thing I miss are the stdlib docs and the ease of cross compilation.


> Ada is far better than Rust for close to metal as it was designed for it.

Sorry, can you elaborate on this? Rust was also designed to be close to the metal, so I'm assuming that there's some concrete difference that you're referring to.

> Ada has also been demonstrated to be more cost effective over a programs lifetime than C, C++ and Java.

Do you have a citation for this improved cost-effectiveness? Things like that are notoriously difficult to prove, so I'd be curious to know how this was measured.


Adas specification was developed competitively over a number of years with embedded development as well as the ability to replace all 450 languages in use by the D.O.D. at the time as requirements. Rusts first official specification is still in the works aside from the one created by AdaCore.

Representation clauses are just beautiful for embedded memory-mapped registers and network protocols and driver registers received over spi/i2c etc.. There is even built-in validity checking. No need to shift generally as the compiler does everything for you.

https://learn.adacore.com/courses/Ada_For_The_Embedded_C_Dev...

The D.O.D study that includes Java would need to be dug up but this one is interesting too.

https://forum.ada-lang.io/t/comparing-the-development-costs-...

I only found out recently that the D.O.D. Ada mandate didn't say you had to use Ada. It said you had to demonstrate why your project would be more cost-effective than using Ada. Considering Ada was designed with cost-effectiveness/maintainability as a primary requirement then that was a difficult task.


They have improved go modules since but if you didn't use github gos tooling wasn't so great. I actually dropped Go for Ada and prefer Adas packaging.


The package management story before go.mod was sad but I have to plat devil's advocate and point out that GitHub did have special treatment by go get, you could use any domain name to host your code and you just had serve a <meta name="go-import"> tag in a html file and you could tell go where to fetch your code (several version control tools including Mercurial are supported)


literally

alr init --bin new_project

cd new_project

alr edit


Did you come across? https://learn.adacore.com


Ada has been shown time and again to be more cost effective than C, C++ or Java. Even in the old days before Ada2022 and Spark 2014s recent improvements.

http://sunnyday.mit.edu/16.355/cada_art.html


Ada is very flexible and does let you leave out the runtime check. However the program will be stopped or atleast be exceptive by default if a logic error creates an invalid value that you haven't checked the validity of. Spark can be used for a higher degree of value analysis at compile time because flow analysis is obviously needed in many cases. Volatility can still be an issue but in most cases Ada knows the inputs such as for API usage validity.


I would rather say that Ada allows you to remove the runtime check on ranges. This is the opposite of enforcing a range with a home-rolled check of the values, that's what I mean by "won't let you leave it out": without deliberate action, the range will either be proven by static analysis to be in-bounds, or that invariant will be checked at runtime.

Julia has a similar system for array bounds: by default, accessing an array is checked for range restriction, and an error is thrown if the value is out of range. Range checks inside functions (including the system `getindex` function) can be annotated with the @boundscheck macro, and user code which knows an index is in-range can use @inbounds to elide that check. If this is done wrong, Julia will segfault or corrupt memory. In C, if it isn't all done perfectly correctly, same thing: opt-in, not opt-out. Julia is more like Ada in that respect.


That's unfortunate. Ada is so much nicer to work with and Spark now has deallocation safety and memory leak prevention.

https://youtu.be/97G1V2U8Drk?si=wNqNs1GiuO9ZdGwP


I chose Ada over Rust for my company a few years ago and couldn't be happier. My entire embedded and tooling code bases are now Spark compatible. I don't believe any language can match Ada for drivers, memory register and network protocol handling.


NVidia did as well for their car automation firmware.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: