4 ms·
I'm using Rust/Rocket for Web apps and I'm as productive with that stack as I would be with, say, Go or Python/Flask. I'm more productive with Rust than I would
by pcwalton 9y ago
I'm using Rust/Rocket for Web apps and I'm as productive with that stack as I would be with, say, Go or Python/Flask. I'm more productive with Rust than I would be in Java. Programmers generally write the same amount of code (measured in LOC) per day regardless of the language, and Rust is pretty succinct. That said, I suspect if you want the absolute fastest development time, Rails and full-stack frameworks like it are still king.
In my case I'm writing a Web app to expose the functionality of a library that's written in Rust, and Rocket was a natural choice for that—it would make little sense to use some other language and go over the FFI. On the client side, I've found that TypeScript 2.x in strict mode goes nicely with Rust on the server, as both Rust and TS 2.x have comparably feature-rich and expressive type systems (generics, tuples, discriminated unions, a distinct null/option type, etc.)
- yen223 9y agoTo be fair, you might be a little bit biased ;)
- dgsb 9y agoWhat makes you think software developers write the same average amount of lines of code per day ? It seems to me the higher level the language is, higher is the average number of loc per day. IHMO Debugging has an huge impact on this average and lower level languages are harder to debug.
- pcwalton 9y agoI have not found Rust any harder to debug than, say, Python. LLDB works fine.
- dgsb 9y agoI have no experience with rust so I can not elaborate on that, but I find harder to debug a multi-threaded C++ application where race condition and memory corruption is possible than a python one. That difficulty has an impact on average daily productivity on LOC.
- marrs 9y agoThat may be because you're programming C++. :) As I recall, there is another bit of research that claims that the number of bugs written in all languages is about the same, except C++ which produces way more.
- westmeal 9y agoWhy do you say that lower level languages are harder to debug? I'd think it's the opposite.
- pankajdoharey 9y agoThe compile time guarantees that Rust provides are good for web server code not a web app. This responsibly should and must be shifted to the people writing web server code not web applications. There are many nuances with rust and it is a hard language to use and learn, when libraries which you want to use dont compile, or your code than doesn't compile for 100 reasons. I get it, it is a great language, but only for Computer Scientists. For average WebDevelopers it may not be that useful to write web apps with compile time guarantees on memory safety.
- pcwalton 9y agoSpeaking as an engineer who (maybe surprisingly) isn't particularly interested in type theory for its own sake, I like the fact that Rust has an expressive type/macro system and an ecosystem that takes advantage of it, yet compiles to native binaries. The low-level memory management isn't much of a problem for me since I've internalized the rules, and the same system prevents nasty problems like data races. Of course, different tools work well for different projects and different people's styles. If you needed me to write a CRUD Web app as quickly as possible I'd probably use Rails. After learning Rust and working with Rocket, though, I think most programmers will find the development experience enjoyable for lots of Web apps. I was pleasantly surprised at how elegant Rocket is.
- pankajdoharey 9y agoSee the post is about using Rust on the frontend. In my opinion it is not a suitable place for Go or Rust due to their large runtimes that needs to be transpiled. Even with webassembly the Runtime size would be huge. So it is not suited for the frontend. As far as backend is concerned the decreasing order of difficulty to write the same code seems something like this to me Rust -> Haskell -> Go -> Ruby -> Clojure.
- burntsushi 9y agoRust does not have a large runtime.
- pjmlp 9y agoRust web and database drivers still need a bit of maturing to be as productive as I can be with Spring, JEE and ASP.NET, Oracle and SQL Server, with multi-tier cluster based applications.