loading...

Rust is fun

artemis profile image Diane Originally published at artemix.org ・1 min read

Since my early programming days, I played with lots of languages.

Some I almost immediately dropped (like C++, Scala, or Ruby), some I spent more time with (like C#, Go, Java, or Clojure).

Apart from a few "new" languages or concepts (new in the sense of "new to me"), most seemed redundant, just another tool for the job.

But the more I play with Rust, the more I go back to it, as I'm re-discovering the fun I felt when I started writing my first few lines of code.

I needed a lot of time to figure out interfaces and their implications (especially with typings), I still struggle a lot with lifetimes, and I still need to write a first algorithm version using match before being able to rewrite it using the map/or_else/etc method set, but those little challenges aren't as frustrating, as "road-blocking", as I may have felt with some other languages and concepts.

They feel more like a challenge, where I need to do some kind of obscure arcane transformations to interconnect every possible branch of my type tree to obtain a result of the same type at the end.

I also like this "barebones" feel I felt and loved with C (although the compiler helps me in lots of way I could only dream of having in C), the feel of this optimization challenge.

I'm probably not going to use Rust before some time at work, but for small personal projects, this language is definitely growing to be my to-go solution.

Discussion

pic
Editor guide
Collapse
seanmclem profile image
Seanmclem

What kind of things do you find yourself using rust for? I'm a fullstack Javascript developer. I'm looking to learn Rust in the coming months, but I'm unsure what I would even do with a low level language. What new pathways might it open?

Collapse
dannypsnl profile image
林子篆

Rust is only for low-level programming? Then you should take a look at this: github.com/yewstack/yew ;)

Collapse
ghost profile image
Ghost

In fact I think that higher or lower level is weird with Rust, is low level because it forces you to deal with low level stuff like where in memory you are putting your data and at the same time have very high level abstractions, letting you, as you mentioned things like frontend, templating for SSR and now even WebAssembly, weird. That's the fun stuff for me, you could do the fuller stack, from the Kernel -> OS -> DB -> webserver -> Browser -> and even the animations on it

Thread Thread
dannypsnl profile image
林子篆

Of course, low-level PL is a ridiculous description. Even low-level programming is ridiculous. As you say, we can do any abstraction on any layer. It should more like: Can it do this more comfortable?

Thread Thread
ghost profile image
Ghost

but that is weird too with Rust, having worked with Django, now Actix-web doesn't feel too much more work for the same task, of course Django have more built-in but the main features, doesn't feel "weird" or forced in Rust. In fact, to me Diesel feels more "natural" to me than the Django ORM and I'm talking Python here, a PL that is like programming in plain english. As I said Rust has a very weird, good weird, feel. And this must be the most subjective post I've ever written.

Thread Thread
artemis profile image
Diane Author

We must also keep in mind that the HTTP backend stacks are still very young and in development, so the absence of built-in is partly due to time.

Give it a few years, and you may end up with a framework that keeps all the good ideas of today's big solutions, in Rust!

Collapse
seanmclem profile image
Seanmclem

I wasn't trying to put rust in a box, but rather to think outside of my own

Collapse
artemis profile image
Diane Author

I mainly use it for two things:

  • daemons (Backends, typically)
  • CLI / GUI tools
Collapse
siy profile image
Sergiy Yevtushenko

Almost everything, from bare metal (MCU) to Web services.

Collapse
0xbf profile image
Bo

I often tell people the feeling of writing Rust is like playing Flappy Bird, both tortured and delightful :D

Collapse
isalevine profile image
Isa Levine

Rust was the first thing I jumped in to right out of code bootcamp! Definitely helps me understand lower-level stuff that Ruby and JavaScript abstract away. But yeah, I'm sure I'm spoiling myself with the compiler here, having never touched C...

Curious to see where else you use Rust in your side projects! :)

Collapse
artemis profile image
Diane Author

I don't have a lot of rust projects yet, but I'm slowly starting to get my hands on it.

Collapse
msfjarvis profile image
Harsh Shandilya

I've been growing fonder of Rust day-by-day as I work with it, it feels awkward at first with the borrowing and lifetimes being such an integral part of the entire language but it forces you to think in more logical and clear ways.

Collapse
artemis profile image
Diane Author

The biggest helper I got was the advice to "forget everything I know about programming", as its type and memory model really is different.

Collapse
kharper profile image
Kyla Harper

I've been meaning to look into Rust. I like that you describe it being similar to C - I've been getting a bit nostalgic for when I first started learning it and the thought of finding a way to experience that again makes me excited!

Collapse
p0oker profile image
Pooria A

Rust was always the most attractive language out there for me. Unfortunately I'm deep inside JavaScript now and my learning materials are all focused on other things. Definitely would love a total switch from a JS dev to a Rust dev in the next few years.

Collapse
jaakidup profile image
Jaaki

Nice. I tried rust and quite liked it.
I compared it to Go, Python and JavaScript for building API servers, and it wiped the table with the rest!
It won't replace Go as my Go to language, as run-time performance isn't the only factor I look for though.

It so nice when you get that 'Wow' feeling again trying a new language.

So I'm currently play around with Dart as well and I must say, I'd be happy if they both Dart and Rust get more developers behind them.