7 ms·
Anyone care to mention the best reasons to start using/learning Rust? There must be a lot with these guys joining the team.
by grandalf 12y ago
Anyone care to mention the best reasons to start using/learning Rust? There must be a lot with these guys joining the team.
- wycats 12y agoI replied to this a bit on the other HN thread on this topic: https://news.ycombinator.com/item?id=8741987 https://news.ycombinator.com/item?id=8741987 TL;DR embedding small libraries with high-performance or low-memory requirements into programs written in high-level languages.
- bsaul 12y agoSince you know a lot about web frameworks : do you see rust becoming a good language for building a modern web framework anytime soon ?
- hayksaakian 12y agofrom the parent answer i would presume he thinks it's more useful as a "bottleneck fixer" in high level web frameworks. (when the bottleneck is the language of the framework). For example, you might implement a few parts of your rails app with rust to make them faster.
- wycats 12y agoOne of the nice things about Rust is that it provides a lot of high-level abstraction capability in a way that doesn't impose any cost on the abstraction. This means that, in theory, one could make a pretty good web framework in Rust that would be both quite fast and ergonomic. That said, writing those abstractions will take time, so we'll probably see lower-level HTTP libraries, followed by Express-style abstractions, followed further on by full-stack solutions like Rails. The earlier parts of the stack are coming along quite well, so give it a few years and I think we'll have a pretty good story to tell. In the meantime, you can use Rust today very effectively as a language that you embed inside a high-level language, and I think a sizable chunk of the Rust community will use Rust for those kinds of embedding use-cases in perpetuity.
- yazaddaruvala 12y agoHaving programmed a bit of Rust, while Rust will definitely be a very capable language for web frameworks/applications, I don't think that it'll ever be the most popular choice. To be honest, if you think about your Rails controllers/models, 1. There isn't really all that much there(fat-models/controllers are pretty slim when you're language was built for web browsers/operating systems). 2. Think about your priorities. I can guarantee its not performance or safety. You want to build a content-rich/feature-full application. Basically, prioritize iteration speed, at all costs. No matter how good the Rust frameworks get, I don't think Rust will be the "iteration speed" language. Meanwhile, I think, in the spirit of wycats' comment, image if ActiveRecord, Unicorn, Rack, the template renderers, etc, were all built with Rust, but still used through a Ruby interface. That would be quite the performance improvement for Rails and it would be interesting to compare its performance characteristics to a fully Rust web framework/application.
- Scramblejams 12y agoYes, I have high hopes for Rust as an excellent way to write natively implemented functions I can call from Elixir or Erlang.
- rubiquity 12y agoHow much C boilerplate of the Ruby C extensions API do you have to write to get Rust to interop with Ruby nicely? I've played with this a bit but still found myself writing a bit of C to wire it all together. It would be nice to hear your approach to this.
- kibwen 12y agowycats has actually been teasing us for a while with a library for exactly that purpose. Here's hoping he gets to releasing it soon. :)
- rubiquity 12y agoGood to know. I look forward to him releasing that. I was about to start writing one myself, which would probably turn out really ugly.
- iopq 12y agoThe best reason is it's getting released soon.
- bjz_ 12y agoIt allows you to predictably squeeze more out of your system than you ever could in a higher level language without the worry of weird undefined behavior, buffer overflows, use-after-frees or segfaults. It also has an expressive static type system that draws a great deal from ML and Haskell.
- jvickers 12y agoDo you have an opinion on how Rust compares to Go?
- bjz_ 12y agoRust and Go do not overlap much other than they are both natively compiled, have curly braces and are backed by 'web' companies. Go was designed for building server software and for encouraging standardized, easy to maintain software. Rust on the other hand is generally targeted at the same areas where C and C++ are used for today.
- MichaelGG 12y agoThe main similarity is that Go was called a systems language for some reason, and the idea is now cached in people's minds.
- jonahx 12y agoCould you explain what differences make Go optimized for server software and Rust for systems software/C replacement? I'm not being rhetorical -- I genuinely don't understand and would like to. Related: Would Rust be a bad choice for backend web development (ie, an alternative for Ruby/Python) and why or why not?
- yonibot 12y agoIt's not mature enough to be a contender for Ruby/Rails or Python/Django yet, but assuming it gets there, it may offer incredible performance. Teepee (a Rust HTTP library under development) put together a page that explains the current state of affairs: http://arewewebyet.com/ http://arewewebyet.com/