4 ms·
Is Rust really suitable for web development? I am genuinely asking. For server development I think it might be a good choice, but for application code itself i
by phn 11y ago
Is Rust really suitable for web development? I am genuinely asking.
For server development I think it might be a good choice, but for application code itself it seems like more of a pain to program in than an advantage.
- rockdoe 11y agoProbably mostly depends on the libraries and frameworks that will appear? The SQL query->data->template pipe isn't very reliant on the language as long as it can manipulate "data" reasonably well. Nobody wants to code C++ for webservers because of the risk (PayPal not included) but Rust doesn't have that issue.
- Shorel 11y agoActually, some people use C++, with an OKCupid framework. https://github.com/okws/okws https://github.com/okws/okws
- Hytosys 11y agoI think Rust has promise as a web dev language. Here's a quick list of the key libraries currently in the ecosystem[1]. Up until now, I've only ever used interpreted, dynamic languages for web development. In contrast, Rust offers me a tight memory footprint (no silly things like unicorn-worker-killer), high performance (the average response time for most of my Rails apps is 150ms), and a slew of static guarantees about types (no "undefined method for nil:NilClass") and memory safety. It also has some really cool things like sanitary macros and syntax extensions that have allowed me to build out a fairly simple yet robust ORM similar to ActiveRecord in look and feel. I may be forcing a square peg into a circle hole; all my current work is experimental. Can you clarify on the difference between "server development" and "application code"? In this context, I've always considered those terms to be the same. Edit: I think I understand what you mean by application code — business logic code? Reasonable concerns. I don't have much to say yet (I'm just doing framework stuff now in preparation for real applications), but here's a demo of my aforementioned ORM in action[2]. [1] http://arewewebyet.com/ http://arewewebyet.com/ [2] https://gist.github.com/SkylerLipthay/9015e6c79859e7dc8709 https://gist.github.com/SkylerLipthay/9015e6c79859e7dc8709
- qznc 11y agoIf garbage collection is ok for your use case, a garbage collected language (Java, Go, etc) will most certainly make your life easier than with Rust. Rust is good for extending Python, Ruby, etc stuff. More safe than C.
- bryanlarsen 11y agoRust seems like an excellent choice for performance sensitive parts of your web application, especially client side. Right now asm.js / WASM do not contain a garbage collector, so most other choices would involve shipping up a large run time with your app. Unity can get away with that -- you probably can't. Server side you have many more good choices, but Rust does have a nice FFI story in both directions. Whether you want to write your entire app in Rust is a different question. I'd want to get more experience with Rust before answering that question -- writing a performance sensitive portion in Rust first would go a long way to answering that question.
- lee 11y agoI used Rust to optimize performance in a hot spot for our Python web-app. I am a Rust newbie, and this was my first encounter with the language, so my opinion may not have much value. But I found Rust to be unsuitable for web-development. The fact that Rust requires that you think about memory management made it feel less expressive and less productive. The strictness of the compiler also got in the way of "productivity". There's nothing wrong with that strictness, but in the domain of web-development where productivity and expressiveness is often more valued than raw performance Rust doesn't feel like the optimal tool. To use Rust for web-development feels like a premature optimization. I think for web-development, it's probably more productive to use Ruby/Python/etc... and call Rust externally to optimize hot spots.