Hacker News new | ask | show | jobs
by jlangenauer 2751 days ago
It's a bit rough to work with still - the IDE support is still a work in progress (though improving) and there is a compile step with every iteration (incremental compilation has improved this too).

Diesel is the main library for interacting with SQL databases, it wasn't async last time I used it, and a quick web search tells me it still isn't - this has been a BIG problem with Rust over the last year, as everyone waits for the async implementation to finally become stable.

Rust is a funny beast at the moment - you have to deal with the learning curve, you have to deal with the unstable/pre-1.0 libraries (some of which are fine), you have to deal with all the errors the compiler throws at you.

But once you've done all that, something magical happens: you end up with software that is mind-blowingly stable and blazingly fast. It doesn't throw segfaults, it doesn't leak memory, it just works, and works amazingly well.

3 comments

Isn't diesel being sync largely hid behind a connection/thread pool? Generally you want to limit the connections to the database anyway, so a connection pool is desirable...
Aren't those orthogonal concerns? A connection pool lets you share the same connection across multiple threads of execution. Async lets you share the same thread of execution across multiple actions waiting for IO to happen. For the best performance, you want both.
>it doesn't leak memory

Fairly sure you can leak memory, just no memory safety issues (in safe Rust).

You can also cause segfaults, the point I think is more that it is hard to do this instead of easy as it is in some languages, like C.
Memory leaks can happen in safe code, segfaults cannot. That’s at least one major difference.
That's a great summary, thank you. What about the rate of improvement? Do you think it will be significantly more developer friendly in a few months?
Futures should be in Rust within a few months and the next Rocket release will switch to async. The Rust plugin for JetBrains IDEs is also getting better every release[1].

In short, I'd say Q2 2019 would be a time to seriously jump into it if you don't want to do it now.

1 - https://intellij-rust.github.io