Wandering Thoughts archives


My current views on Rust (the programming language)

Let's start with my tweet:

Modern languages like Rust and Haskell often give me the feeling that I am not smart enough and determined enough to program in them.

In the geeky programmer circles of the Internet that I fish for information in, Rust is very much the latest hot thing. It's generally presented as a better C/C++ that is (or should be) just as fast while being far more memory safe. All of this sounds very nice; who wouldn't want a C with better memory safety, after all?

My problem with Rust is that, as far as I can see from reading about it in passing, it is a fairly complicated language (due in large part to its determination to be a memory safe systems programming language). To read about Rust code is to be immersed in mutable and immutable variables, transferable references, borrows, macros, apparently complex types, and many other things. I'm probably smart enough to code in Rust if I was dedicated enough to learn all of the things that you need to know to write and read Rust code fluently. In practice I'm not.

One reason I'm not that dedicated is that it turns out I no longer have a use for 'like C but with better memory safety' (and a modern type and macro system, I think). And this is because I no longer write 'systems programs', broadly construed. If I just need a program, I can write it in Go or Python. If I need a program that goes fast or uses relatively little resources, I'll write it in Go. I write C programs these days only in two circumstances: if I need an absolutely minimal sized executable, or if I need a program that is right down to the metal of Unix system calls.

(One use of 'down to the metal' programming is benchmarking and testing, where I want to be sure exactly what the program is asking the kernel to do.)

But that's the sober rational reason. The emotional reason and my gut reaction to Rust is that it's too complicated to be appealing to me. More than that, it's complicated about things I no longer give a damn about, such as memory management without garbage collection. Rust is a language for smart people who care very deeply about certain issues, and I do not.

(I can completely see why Mozilla wants Rust and would not consider Go an adequate substitute. But I am never going to write a browser.)

And despite everything I've written here, there's still a part of me that wants to like Rust because damnit, it's cool and in theory it is right up my 'systems programming' alley and any number of smart people think it's a great thing. So I keep reading Rust news every so often (in much the same way I keep reading Haskell news). No one ever said I was a completely sensible person.

programming/RustMyViews written at 02:14:30; Add Comment

Page tools: See As Normal.
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.