I recently started to learn a new programming language: Rust. And I really have to say: This is the kind of language I always wanted. Some parts are not as nice as I’d like them, though most of the language, the tooling, the compiler and everything else is just so damn cool.
But first, for the new readers of my blog:
Where I came from
I learned Java as first programming language when I entered 11th grade. I learned the stuff really fast and I started to learn Ruby right after. This was about the time of Ruby 1.9.2 and 1.9.3 - and it really was an awesome time.
Later I learned C, all the way down from “Oh my gosh, why am I getting this segfault - oh, I didn’t allocate properly” to linux kernel patches. I really have to say it was fun and I enjoyed learning it, though I really don’t want to implement a larger project in C. C is for systems programming deep down directly at the hardware.
Where I don’t want to go to
I have three languages I want to write in future. Maybe four. Let me elaborate:
Nice language, though for academic use only IMHO. I really don’t want to write Haskell for production systems, if possible. I still can understand why people do this and even when people start new projects with Haskell as programming language, though I wouldn’t do that myself.
Do I really have to explain this? I mean, PHP was great in the ‘90s and maybe early 2000s. But today, there are much better alternatives available.
Yes, you kind of have to write these languages in web development, but I’d opt for SASS and Haml. They are both nice preprocessor languages which are much simpler to use.
Nice languages! I really enjoy reading them, though I don’t see any value in them for large production systems. Their tooling just looks to bad (from the outside) and while I’d love to see better tooling here, I don’t really care about these languages.
I see a lot of value in Python for small scripts, but not for large production software like web frameworks or similar. Yes, this was a hint in direction of Django!
Nice language for embedded stuff and so on, though I don’t really care too much about Lua either.
The standard when it comes to database querying. Though I really don’t want to write these things by hand and I really would love to have ORMs widely available (and yes, every major language has an ORM, I know that and I like it).
Can we please just have pandoc succeed and write our stuff in Markdown? I mean, yes, Latex kindof works, but when it doesn’t it just sucks as hard as hell!
Another thing I don’t want to have to touch.
There are better alternatives available… this is why I’m writing this post!
Where I want to go to
Yes, there are languages I like. It’s really just three/four, but they clearly exist: Ruby, C, (Bash) and Rust. Each of them with another purpose. Bash is in parentheses here because I kindof have to use Bash, let me explain this first:
Bash is syntactically just disturbing. I mean, its syntax just sucks, right? But it is the default on all Unix systems and that won’t change, so for scripts, I just adapt to this default and keep my things in Bash.
I know there are alternatives like fish, zsh and whatever. I cannot use them because of two reasons: If I change my shell, I want to change it everywhere, means I would need to convert all my scripts. This is a huge amount of work. And, I’d still have to write bash when contributing to nixpkgs, and not contributing to nixpkgs is just no option for me.
So, for the sake of uniformity, I just keep everything in bash.
Ruby is awesome. I love its syntax, I love its tooling (though I don’t have to mess that much with it).
I just don’t want to implement complex things in it. I started to learn rails and I really like rails, despite it is a monster from my perspective. There are other web frameworks for Ruby available which are much less complicated. I speak partly of Sinatra, but also of Lotus which seems quite nice to me (again, from the outside).
Of course there are others.
C is,… well C. It is awesome for small bit-fiddeling work and OS kernels. It is great for microcontrollers. It is just as simple as possible a high-level-assembler language can be.
I really love writing C, though I also think one has to avoid it whenever possible.
Now I finally hit the chapter this whole blog post is about.
Rust. Is. Awesome.
I mean, really. It comes with the tooling of Ruby,
cargo the package
manager/build tool/test runner/everything just works out of the box and as
good as one can imagine. Working with dependencies just works (if you get your
The language itself is really nice. I mean, I worked with for about one month by
now and I really enjoy every problem I encounter in manner of a learning
experience. I learn with every problem and I also learn to avoid problems really
Rust gives me power to my hands I couldn’t even imagine when I was in 11th grade. I can write high level code like in Ruby, but I can also go into detail and fiddle around with bits and everything, without having to worry about References and pointers, data races, bla bla bla (take that, C++)! If the compiler tells me that I’ve done everything right and it compiles my code, I can be sure that the program won’t eat my head while running. It might not do what I want, but it does what is written down without crashing in random places!
So, with Rust you get:
- If it compiles, it works (Haskell)
- It is fast ©
- You can build complex applications with type safety (C++ (though “type safety” is a stretchable term in C++))
- You can write high-level code (Ruby)
- Easy syntax (Ruby)
So, to summarize: Bash for system scripting, Ruby for more complex scripting tasks, C for embedded/system programming, Rust for everything else from systems programming to building space rockets.
If you haven’t learned Rust yet, go and give it a try! You will be amazed!