13 ms·
I’ve seen a number of people move from Rails to Rust... is that really a common move? Seems like they’re very different and designed for very different things.
by freehunter 8y ago
I’ve seen a number of people move from Rails to Rust... is that really a common move? Seems like they’re very different and designed for very different things. Are people commonly building web applications in Rust? I know it’s possible but C++ has web frameworks too and that seems like a more apt comparison.
I guess I’m just baffled by the number of people on here that I see pointing to Rust as the next project they tackle after Rails when I don’t see them overlapping at all.
- kbenson 8y agoI can't comment from experience, but I have seen a lot of people here say that Rust feels a lot like something between C++ and Python/Ruby. I think the idea is that besides the static typing (which a lot of people that use Dynamic languages, like me, would love to enforce at times), if you use it in a functional manner it's fairly expressive and not that different looking/feeling that the equivalent dynamic language of large chunks of the code you write. As someone who's gone through the Rust book but not really written anything useful in it, that's how it appears to me sometimes too (and other times it appears to be an arcane incantation). Edit: The solution here[1] is a good example of what I'm talking about I think. A lot of what's there is pretty obvious to someone familiar with JS/Ruby/Python/Perl, and they might even use a very similar looking solution. The Rust specific stuff is really the only foreign stuff, so if you assume you would learn that when learning the language, it's a pretty straightforward solution that looks similar enough to be inviting. 1: https://stackoverflow.com/questions/31986628/collect-items-from-an-iterator-at-a-specific-index https://stackoverflow.com/questions/31986628/collect-items-f...
- dmix 8y agoWhether it can be used like an more FP-style Python/Ruby is one thing but whether it can replace Rails is a whole other question. This website is dedicated to answering that: https://www.arewewebyet.org https://www.arewewebyet.org (although looking at it again most of the content links are a bit old, but the library stuff seems current)
- enz 8y agoI think that a Web framework such as Flask (without the ecosystem of its plugins) or even Falcon can be replaced by a Rust app, as of today. But, I totally agree with the rest of the website. Before replacing a Django or a Rails project, there is some work!
- Bombthecat 8y agoRust has that feel because it is new. I have no doubt that it will look like c++ in a few years. Full of "must have functions and extensions"
- wangchungtonite 8y agoAstro turfing. Easy startup. Supported by big company. New fad
- everdev 8y agoRuby has a very readable syntax and easy learning curve for new devs. What it lacks is the performance and type safety of a compiled language which I think is why many people eventually switch to Rust and Go. Interestingly, Crystal might be an easier jump as it's syntax is very similar to Ruby, but with the performance gains that come with compiling to a single executable. Crystal is still pre-1.0 though so it doesn't quite have the production-ready stability or robust community of Go or Rust. https://crystal-lang.org https://crystal-lang.org
- dleslie 8y agoPerhaps critically, it lacks an official Windows distribution and support.
- learc83 8y agoIs anyone deploying anything other than .NET on windows for webdev though?
- pault 8y agoA lot of folks have to use Windows machines at their day jobs.
- learc83 8y agoIf they're not deploying on windows though, there isn't much reason to develop on it.
- pault 8y agoThat's what I'm saying. It's not uncommon for companies to have AWS linux infrastructure for deployment but give everyone windows laptops for development. Don't ask me, ask the IT department.
- 8y ago
- fizx 8y agoI think it's less about the working style and more about the promise of working in the future(tm). When Rails 0.9 dropped in 2004, I instantly rewrote my old PHP app in it and never looked back. It just felt so expressive and naturally declarative. Rust has a similar amount of promise, though not quite as good of a demo. The idea that you can write high-performance code without typical high-performance code bugs is amazing! There's a whole new type of type system that ensures it! Sometimes you want your language to also be a religion ;)
- geowwy 8y ago> The idea that you can write high-performance code without > typical high-performance code bugs is amazing! There's a whole > new type of type system that ensures it! I just can't see how Rust is a good choice for web dev. There's a lot of mental overhead to writing Rust. Something like C#/Kotlin/Go will avoid all the same bugs and give you 95% of the performance while being much easier to code.
- adrianN 8y agoRust also promises concurrency without data races.
- inferiorhuman 8y agoI just can't see how Rust is a good choice for web dev. There's a lot of mental overhead to writing Rust. Something like C#/Kotlin/Go will avoid all the same bugs and give you 95% of the performance while being much easier to code. Rust is dramatically lower level than something like Ruby or Python. But sometimes the promise of really usable dependency and project management with something like Cargo wins out over the minimalist approach that Go takes. Rust (and something like Rocket.rs) wouldn't be my first choice for anything other than smaller personal projects, but it's not nearly as awkward as PHP was before it matured... and it's nowhere near as bad as rolling everything from scratch in C++. It also depends on your target audience. My experience has been that Rust is significantly more portable than C#, Node, Elixir, and (to some extent) Go. Java (and by extension things like Kotlin and Clojure) have a big leg up here too.
- cocochanel 8y agoCorrect, they are for completely different purposes. I have the feeling that a lot of people (particularly the bloggers/more vocal types) jump into newer languages for no other reason than to position themselves as experts in said language/stack, right when it's getting more popular. I've seen this happen with Ruby/Rails, JavaScript/Node, and now Rust. In this case, it would have made a lot more sense to move to something like Elixir/Phoenix.
- cbHXBY1D 8y agoI think this is one of the reasons the Rust community is so much more focused on web related technologies than other software. Web servers are where most of the community is coming from and how they make a living so it makes sense. TUIs are also popular but I would love to see more emphasis on getting cross platform GUIs working (as well as kernels, codecs, drivers, graphics, data science, etc). Mmstick had a good post about this two months ago: https://www.reddit.com/r/rust/comments/af43dy/rust_windows_gui/eeqd9al/ https://www.reddit.com/r/rust/comments/af43dy/rust_windows_g...
- inferiorhuman 8y agoI tend to agree with those that suggest OO languages are far better suited for GUIs than Rust. I love traits, but all the GUI libraries for Rust I've seen are hot messes. The TUI stuff isn't much better (e.g. Cursive is borked on Windows). I'd LOVE to see something along the lines of Qt for Rust, but I'm not going to hold my breath.
- inferiorhuman 8y agoI cut my teeth on Ruby and Rails, I've screwed around with Phoenix, and I'm currently infatuated with Rust. Earlier on I thought that, yeah, Rust is a great replacement for C and not something want to write a web app in. So, sure, I've got a bunch of little doodads written in Rust (mostly CLI tools). Now? The fluff I've written in Elixir is getting ported to Rust. The Rust tooling and community are just that good. I'd rather have to work on some extra verbosity and maybe even maintain my own helper library in Rust than deal with with Elixir/Phoenix at this point. The number one reason is that Elixir deployments are nothing short of a nightmare. I've found the community not particularly helpful or knowledgeable about how things work (and given how many moving pieces are in an Elixir deployment, and how brittle Elixir deployments are, this is a terrible thing). And you're definitely not going to write CLI tools in Elixir (it straight doesn't work with escript in the first place). Compiling down into a single "static" binary like Rust (and Go) do by default is a huge win for things like this. The quick startup time of a Rust or Go app compared to Ruby or anything JVM based is great for rapid iteration and testing. The tooling around Rust is, in general, fantastic. Being that much of a pleasure to use really makes up for how inappropriate it is to use Rust for most high level web app things. Phoenix had a lot of promise, but these days I'd much rather go back to Rails or Django (with an eye towards how to migrate to a compiled language) if I needed to churn something out quickly.
- learc83 8y agoI don't see rust as a natural move from Ruby at all. I think it's just people moving to next cool language. A few years ago when Go was at the peak of the hype cycle, you saw a lot of people moving there from Rails. Rails to Phoenix/Elixr makes some sense. As for me, I'm moving backwards in the hype cycle. I started out with Ruby as my first programming language 15 years ago, but I'm spending more and more time in C# these day.s
- latch 8y agoWhich I think is a testament to the expressiveness and readability of Ruby and Elixir and how powerful some of the libraries are. Once you get past the superficial, they're nothing alike. That said, I agree that anything you build in Ruby can be done in Elixir and you should be able to leverage a lot of benefit. The reverse isn't true.
- cheschire 8y agoC# and TypeScript make for a powerful combination when developing web-based solutions, with the added benefit of making you flexible to switch over into desktop or server applications. Or, if you're feeling froggy, an entire OS (Cosmos). Doesn't it feel so much nicer to just focus on the domain problems of new tasks without relearning how to talk to the computer?
- pjmlp 8y agoWhich is why I prefer platform languages, slowly adopting the best parts of trendy languages, no need to keep switching to the next shinning thing. Pick platforms, not languages. But always learn what the others bring into the table as well.
- tlrobinson 8y agoIt seems fairly common for a small number of prominent members of some community to move on to a new technology and have a number of people follow them for various (good and probably not good) reasons. I'm not that familiar with Rails or Rust, but Steve Klabnik (http://www.rustforrubyists.com/ http://www.rustforrubyists.com/) and Yehuda Katz come to mind in this case (https://blog.rust-lang.org/2014/12/12/Core-Team.html https://blog.rust-lang.org/2014/12/12/Core-Team.html).
- namelosw 8y agoMe too curious about this. For me it's more understandable moving from Ruby to Elixir. But Rust is so different from Ruby...
- gyvastis 8y agoNext optimal choice is calculated on the number of letters that needs to change on the resume.
- veidr 8y agoI did not read TFA, but I think the reason people go from Ruby on Rails to Rust is that various people they trust went that route. For instance, Yehuda Katz and Steve Klabnik were both extremely helpful and widely admired figures in the Ruby/Rails community. Then they both joined the Rust core team. That alone is enough to attract the interest of a lot of rails people I think, by giving Rust relatively huge exposure among Ruby people. Then you have the fact that (probably due to the above) Rust became a common choice for outsourcing performance-critical parts of Rails apps. Once you start doing that, it’s kind of natural to start thinking hmmm what if I wasn’t even doing Rails..
- erikpukinskis 8y agoBoth the Ruby and Rust communities are drawn to a "Everything In Its Right Place" mentality.
- bitbang 8y agoThe one reason that might make sense is if the objective is to write webapps using webassembly. Rust can compile to webassembly. But that seems more like it would displace something like React or other frontend frameworks rather than Rails. Elixir/Phoenix seems like a much more logical progression from Rails.
- rabidferret 8y agoIn case it wasn't clear from the article, I'm moving from contributing to Rails to Rust, not as a user. Most of my contributions to Rails were around Active Record (the ORM), and I got into Rust by creating its most used ORM. My main role in the project right now is co-leading the team responsible for crates.io, the Rust package registry, which is a web application written in Rust. So all of those things overlap quite a bit (also am I not allowed to expand the scope of things I work on beyond web frameworks? I'm not really sure why they have to overlap at all)