4 ms·
I 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 e
by wycats 12y ago
I 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.