6 ms·
I laud the effort and I understand that rust gets a lot of visibility here on HN, but when the motivation is to improve security, than why not use a language wh
by guenthert 3y ago
I laud the effort and I understand that rust gets a lot of visibility here on HN, but when the motivation is to improve security, than why not use a language which goes through great length of ensuring such, e.g. the SPARK subset of Ada?
- awestroke 3y agoBecause they are not as good of a fit. Rust strikes an extremely good balance between memory safety and productivity. Also almost nobody knows Ada, and even fewer the flavor you mentioned
- taylodl 3y agoAre we concerned with memory safety and security or popularity?
- tardibear 3y agoMaintainability is the other issue.
- pcwalton 3y agoBoth SPARK and Rust provide memory safety, so it's perfectly reasonable to use popularity as a "tie breaker". Applications are written by people; the more people who can usefully contribute, the more work can be done.
- 0xfedbee 3y agoWhat’s your source saying more people write Rust than Ada? There are people outside HN.
- anp 3y agoThe TIOBE index’s[0] methodology is definitely flawed but it currently lists Rust at 19 and Ada at 22. No mention of SPARK. [0] https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/
- michaelmrose 3y agoIf you use a flawed metric that measures nothing of note noting relative position is not illuminating.
- mustache_kimono 3y ago> What’s your source saying more people write Rust than Ada? I think this "popularity" reasoning is flawed. It completely misses the context of the tool. Just ask yourself -- are there many UNIX CLI tools written in Ada/SPARK? I'm sure there are some, but not aware of any I use regularly. Meanwhile, there is a Cambrian explosion of Rust CLI tools taking place. "Popularity" is really a surrogate for "popular, accessible, infrastructure for an OSS CLI tool for UNIX", a place where Ada AFAIK has not been a first choice. If we were building firmware for a missile guidance computer, maybe the reasoning would be different? But it's still not a sufficient reason, so I'll add another: People really like using Rust to make these types of tools. It's amazing to me that people are so willing to discount as non-technical, and therefore unworthy of discussion, lots of people really like using Rust.
- pcwalton 3y agoIn my other comment I wrote "open source ecosystem" in order to avoid all the speculation about how much SPARK is used in commercial avionics and whatnot.
- ratmice 3y agoSeems obvious to me that ease of installation seems also is a factor where popularity can have an impact. If one is more popular that increases the likely hood that users will already be familiar with installation methods (ignoring actual difficulty), reaching more people in the process.
- csb6 3y agoSPARK goes further though. More advanced properties besides memory safety can be proven. This seems tremendously useful for something like sudo.
- chmod600 3y agoApparently both. Computer languages are partially to communicate between people and computers, and partially to communicate among people.
- LASR 3y agoExactly. The point of a programming language is to translate human intention into machine instructions. Whatever optimizes for the accuracy of the instruction output is the best. Sometimes it means language features. But it can also mean its popularity so you can get many more human eyes on the same bits of code.
- dogma1138 3y ago“Popularity” is quite important for security too as more people can vet the software and maintain it.
- mid-kid 3y agoYou overestimate how many people know rust.
- Cardinal7167 3y agoThe 2022 SO survey puts it as one of the most popular languages, and spark or ada don’t even make the list
- dogma1138 3y agoSO surveys are more indicative of how many people are aware of it and think it’s cool than how many people actually use it in anger.
- guipsp 3y agoYou're making this comment in comparison with ada?
- baq 3y agoMaybe we also underestimate how many people know Ada… doubtful but not impossible
- ender341341 3y agoI imagine the number of Ada people is decently high but hidden. But more importantly, how many of them are contributing to open source is lower (or at least advertising that they know Ada & contributing)
- tialaramex 3y agoLots of people seem to be learning Rust judging by the last few years of Advent of Code. In a safe language like Rust, the level of capability you get doing even say the first couple of weeks of AoC is enough that your small contributions to a project are likely to actually work and be more or less serviceable, so that's a huge help.
- Yoric 3y agoAs a Rust developer, I second the question. I love to see the broad move towards safer languages, but let's not forget that Rust is not the only safe language for system development. Plus iirc the model-checking ecosystem of Ada/SPARK is much more mature than that of Rust.
- deleted 3y ago[deleted]
- irundebian 3y agoAda/SPARK does not do model checking.
- pcwalton 3y agoRust has a much larger open-source ecosystem.
- Hemospectrum 3y agoSuppose you could have memory safety in C by implementing a borrow checker for every individual function. It would be suitable for certain industries, but breathtakingly expensive, error-prone, and therefore useless for most kinds of software. That's roughly the situation today with SPARK. Using Ada does not automatically buy you memory safety on the same level as Rust. You can get a lot further with SPARK, but the annotations are very cumbersome to write. These are well-known problems in the Ada community. There are efforts underway to improve SPARK's ergonomics by adapting ideas from Rust, with the help of the Rust Foundation. Someday soon, Ada will be much closer to Rust's sweet spot on the safety/productivity graph. In the meantime, there are CVEs to patch.
- irundebian 3y agoYou don't need annotations to write memory safe programs in SPARK. With annotations you can verify properties of the program up to functional correctness which is not integrated in the Rust ecosystem.
- mustache_kimono 3y ago"Why didn't you choose [my language], it's obviously better at X?" has got to be one of the weirder open source Qs. It reminds me of when the Ruby folks wrote their YJIT in Rust and there were a few Qs which were like -- Q: "There doesn't seem to be a security reason to write this in Rust, why not use C++?" To which, a totally reasonable A is -- A: "We like Rust (and there is no reason to be miserable forever)!" People almost never choose a language for one reason (except for the people who use Ada, I suppose -- the reason is the government requires them to do so). Memory safety is a great reason to learn/choose Rust, but Rust is much, much more than memory safety. Moreover, "Why are you ignoring Ada?" is "Why didn't you write/don't you rewrite this in Rust?" by a different name.
- hannob 3y agoAll my experience with opensource projects tells me that it's hard to have a healthy opensource project with a super-obscure programming language. The reason is simple: You won't get contributors. You have a hard time finding people doing anything in it. I have no idea what the SPARK subset of Ada is. But even if it is superior to Rust in one aspect or the other, the fact that you will have a very hard time finding any developers capable of using it kills it as an option.
- formerly_proven 3y agosudo only seems to have two contributors outside Todd Miller which committed more than a handful of lines: https://github.com/sudo-project/sudo/graphs/contributors https://github.com/sudo-project/sudo/graphs/contributors It's the kind of infrastructure project that doesn't really attract much interest, I doubt there would even be a single external contributor if it were written in some niche language.
- josefx 3y agoDoes that page only list Github accounts? Sudo is maintained using mercurial, the git repository is just a mirror. Try the official homepage for a significantly longer (and also incomplete) list of contributors https://www.sudo.ws/about/contributors/ https://www.sudo.ws/about/contributors/ .
- ksherlock 3y agoIt looks like it's being done in rust because some rust zealots convinced Amazon to give them money to re-write su/sudo. It looks like it's not being done in Ada because Ada zealots couldn't convince anyone to give them money to re-write su/sudo.
- lukaszwojtow 3y agoDid Ada zealots try? Do you have a link to their proposal?
- Gigachad 3y agoAda has no community. It’s dead.