Hacker News new | ask | show | jobs
by throwaway63467 22 days ago
Does safety matter for this kind of software? It’s mostly internal tooling used by researchers and statisticians. I get it rust is cool but safety isn’t the prime concern here I think.
4 comments

Author's comments are dead unfortunately so I'll repost w fragment from them here:

> It's not about memory safety per se. It's about not losing an hour of analysis because a malformed .sav file or a zero-variance sample triggered a segfault or silent wrong output. SPSS crashes on bad data.

Why not [vouch] the dead comment?
I've done some without any effect. I'm guessing there may be some sneaky moderation in play. I did email the mods though.
A couple days ago we had 0-click RCE in MS Paint. At this point, we must think about safety everywhere, we're entering AI era where vulnerabilities are easy and fast to find, exploit and chain in automated ways, and it only accelerating.
Rust is the prime language for vibecoding because the compiler checks most of the issues for you. This is meant to be part of the ArtCraft suite, so it is intended to be developed and managed with AI agents.
People always seems to confuse correctness as in „it compiles“ vs. „it does what I intended it to do“, not sure how Rust helps with that as it won’t solve mismatch between intent and implementation. Or how could it? Main problem with vibe coding is that you almost always under specify requirements so the agent will fill in the blanks and make choices for you, the language it implements these choices in doesn’t matter much in my opinion, agents will produce correct code from a detailed specification almost always which is why they are so good at translating between languages, they are terrible at interpreting requirements not specified or derivable for complex software though. Rust can’t solve that.
> not sure how Rust helps with that as it won’t solve mismatch between intent and implementation.

It's not rust specific, but any language which allows you to work on a higher level and with better typing helps close that gap. For example for a long time Linux kernel had an issue with marking user/kernel addresses which opened it up to bugs and security issues. In C those are just numbers. In Rust this is moot and correct by default because user addresses are explicitly UserPtr.

So yes, sometimes a better language allows you make some unintended things explicitly not compile. It won't solve the issue completely, but the scope of the mismatch gets much smaller.

You don’t even understand my point. It’s about specifying what you want to accomplish, the code can be correct and safe and still do the wrong thing, that’s the most relevant bug for a statistics software like SPSS. Almost no one cares about it segfaulting once in a million runs, people do care about it doing the math right. Rust doesn’t help at all with that. Rust isn’t more high level than C or other languages or how is it? Does it know anything about quantiles or student t distributions and will warn the agent if it implements them wrong?
> You don’t even understand my point.

What if you didn't understand the comment?

Full validation of spec to implementation is still close to impossible and nothing that exists today will get us there outside of extremely limited scope. But some language features make the gap just a bit smaller. The less you have to look at details and more at the actual structure, the more you can be sure the implementation matches what you want.

Extreme, unrealistic case: you want to add something to a list of samples - one implementation does list.add(sample), the other inlines all the reference counting, object cloning, memory allocation and possible extension of list over 100 lines. How sure are you that either one of those implements what you want? Now reduce that to more realistic scenarios where C still forces you to either be more verbose or less explicit, while Rust (or any other more expressive language) lets you show exactly what's needed via better features or via types.

> Does it know anything about quantiles or student t distributions and will warn the agent if it implements them wrong?

No, we're not even close to that. But it lets you use stylo and implement `student(PositiveInteger v)`, which you can't achieve in C. So again - nothing can eliminate that gap today, but language features can definitely make it smaller.

Does that actually exist or is it wishful thinking? People keep telling me this but whenever I look at vibecoded Rust projects it’s the worst kind of abstraction mess I have ever seen. This project here isn’t any different and the author is obviously just throwing stuff against the wall to see if anything sticks. What closes the gap is conventions and abstractions the AI can rely on which is why most AI Rust code looks like crap as there’s just too many ways to do things, AI written Python or even JS code is much simpler in comparison. Never seen a good vibe coded Rust code base if you know anything let me know.
Segmentation faults are super easy to get from AI agents writing C. If you want an agent vibecoding in a compiled language, you have to use Rust. That doesn't mean that the software does what is intended (that requires a review agent and then an orchestrator at minimum) but it makes things a lot easier.
There are MANY safer-than-C alternative languages compiled to efficient native code. I don't vibe code, but vibe coding seems popular with Nim, for example. I'm sure it's a very long list. "Safer-than-C" has been a slogan for PLangs for the entire history of modern computing. { Before people groan about "but, but mem.mgmt", that is often negligible overhead in context (depending on context and overhead). When it is not negligible, the same problems in Rust will usually have "allocations optimization" fiddling and such, so you don't really avoid "fighting memory". Ada people often just avoid dynamic allocation entirely. Java people will spot-optimize certain things. Ocaml, etc., etc. AMM is not even a property of a PLang as much as a runtime since even spartan C has -lgc with Boehm. }
I feel like Nim is too expressive to be a good vibe-coding target. That is one feature that I think is generally good for people writing code and really bad for agents.

You can take a lot more "smart" shortcuts in Nim, that are hard to reason about, and probably even harder when an automated system writes them.

I very much agree at the stylistic and syntactic abstraction levels. One reason I don't do it myself is that I find chatbot "judgement" for such things awful, usually highly contaminated by weaker PLangs. To be fair, there is probably not much sampling data in several relevant directions. Honestly, I think it Araq's personal tastes in tooling drives people to vibe Nim, but I do hear about it a lot.
It's not about memory safety per se. It's about not losing an hour of analysis because a malformed .sav file or a zero-variance sample triggered a segfault or silent wrong output. SPSS crashes on bad data. Researchers work with messy data. Rust's Result type makes "handle every error explicitly" the default, not an afterthought. That's why I chose it.
Right, and that happens a lot I’m sure… not once have I had this when using SPSS. I mean good luck with that vibe fest but looking at your GH you seem to be throwing stuff at the wall, look AI ain’t going to rewrite SPSS for you in Rust and if it does you can count on it having a million bugs in it when it’s done, none corruption or segmentation faults but all of them just your version happily doing the wrong thing and corrupting results…