logoalt Hacker News

amiga386today at 4:16 PM2 repliesview on HN

> all else being equal, most C software would indeed benefit from being written in Rust instead

I don't even think this is true.

You can certainly say "the security of computer systems would be a little bit better if most software was written in memory safe languages" (even more so if you went a bit further and said "with automatic memory management").

However, a lot of software exists and is useful, and the only reason it exists is because the author(s) found a way they liked to express that software.

So, for example, there are millions of companies out there, especially small ones, running all their finances on Excel. Not even accounting software. Excel. I am totally OK with this. I do not need all these companies to rewrite their Excel workflows into frontend applications backed by a relational database, even though that would be "better" in a lot of ways (more robust, easier to backup, easier to bring someone else onto...). Those little business owners understand Excel and build models and count numbers and they're happy with that. If some kind of edict compelled them to use something "proper" instead, they might not even go into business, and the world would lose whatever it is their business does.

The same thing goes for software and languages. Each language, whether it's F#, Haskell, Common Lisp, PHP, ... brings with it its own kinds of expressiveness and usefulness, and ecosystems of programmers and libraries/modules form around it. Some languages are a better "fit", sometimes for the problem domain, sometimes for the programmer's mind, sometimes for community building. It's difficult to compare any two languages because of this, and if you were to say "language X should not exist, all software written in X should've been written in language Y", you have to accept in your thought experiment that were that the case, their is likely a huge amount of software which would not exist just out of the people who made it not being happy about language Y and, if it were the only choice, would choose not to create the software they created in language X at all.


Replies

pdpitoday at 5:30 PM

I think we're in violent agreement, because when I said "all else being equal", I really meant all else.

If a language's mental model doesn't mesh well with yours, that's in and of itself an ever-flowing fountain of bugs, and a legitimate reason not to use it. This isn't a valid excuse to not give unfamiliar languages an earnest try, but does justify different people reaching different conclusions afterwards.

The single most important part of the mental model for programming in Excel is precisely that it takes people who tell themselves they could never be programmers, and tricks them into believing they aren't really programming, so they're "allowed" to do it by themselves. It's an incredibly empowering piece of tech. Rust and Zig and Haskell and all the other languages that excite me personally can never hold a candle to that.

> Each language, whether it's F#, Haskell, Common Lisp, PHP, ... brings with it its own kinds of expressiveness and usefulness, and ecosystems of programmers and libraries/modules form around it.

Preaching to the choir :)

bmitctoday at 8:40 PM

> and the only reason it exists is because the author(s) found a way they liked to express that software.

In a discussion about comparing two languages, there's an implication there that they found a way they liked to express their idea in a particular language that couldn't be done in the other just as well if not better.

Doing things well in C requires a large amount of things that just don't happen if you're writing the same program in Rust. And Rust greatly enables domain-driven design that basically doesn't exist in any C program.