Live data from Hacker News

Rust for the Web

thefullsnack.com

41–50 of 100 posts

Re: Rust for the Web

#41
post #37

Man Rust is super hard already! I mean people told me it would be harder to think functionally but after clojure, i think lisps are super easy. But i feel Rust is way harder than anything. Infact i feel Haskell is comparatively easier than Rust. So i am not sure why one wants to use it for web. I think Rust has a place and that is to replace C++ for system software, possibly even C for writing Kernels because why not…

I disagree. I think Rust is pretty easy once you've spent a bit of time learning about lifetimes. It should be substantially less surprising when it's got non-lexical lifetimes, though. Rust seems to me eminently suited to write high-performance web applications.

Well anyone is free to think anything, the Rust compiler is by nature very conservative and tries to take an approach where it wants to you put a lot of information so that it is easier for it compile programs and infer right context. In the process it demands a lot from you compared to Go. Being a C fan i would say C is way easier than Rust, but look where C has lead us, huge amount of headache due to tons of unspecified behavior of C which all compiler makers have diligently copied from each other. So i totally get it Rust is great for these scenarios absolutely, write OS Kernel, Databases, Browsers what have you... But it is really not meant for the web, trying to use Rust for web is retrofitting at best.

Re: Rust for the Web

#42

Earlier quoted context omitted.

The 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…

Speaking 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…

See 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.

Re: Rust for the Web

#43
post #37

Man Rust is super hard already! I mean people told me it would be harder to think functionally but after clojure, i think lisps are super easy. But i feel Rust is way harder than anything. Infact i feel Haskell is comparatively easier than Rust. So i am not sure why one wants to use it for web. I think Rust has a place and that is to replace C++ for system software, possibly even C for writing Kernels because why not…

I disagree. I think Rust is pretty easy once you've spent a bit of time learning about lifetimes. It should be substantially less surprising when it's got non-lexical lifetimes, though. Rust seems to me eminently suited to write high-performance web applications.

Let's be serious, Rust will never be as easy to use as a language with GC. It will perform better on many metrics, but you have to pay that cost.

Re: Rust for the Web

#45

> NamedFile::open(Path::new("www/").join(file)).ok() Is this vulnerable to the classic "../../../../../../../etc/passwd"?

I was thinking the exact same thing. Rust being a more memory-safe language does not mean it is a secure one. Still needs proper input validation.

EDIT: I opened the documentation and found https://api.rocket.rs/rocket/request/trait.FromSegments.html I don't fully understand if the checking they do on '..' fixes the attack vector here.

Re: Rust for the Web

#46

Man Rust is super hard already! I mean people told me it would be harder to think functionally but after clojure, i think lisps are super easy. But i feel Rust is way harder than anything. Infact i feel Haskell is comparatively easier than Rust. So i am not sure why one wants to use it for web. I think Rust has a place and that is to replace C++ for system software, possibly even C for writing Kernels because why not…

Haskell has more concepts than Rust (like higher kinder types) and should get linear types soon. Rust seems like Go with some Java and the great borrow checking system.

Higher kinded types don't seem like much of an extra concept. If anything they're a simplification: type parameters can be any type, rather than only being unparameterized types.

Re: Rust for the Web

#47
post #37

Man Rust is super hard already! I mean people told me it would be harder to think functionally but after clojure, i think lisps are super easy. But i feel Rust is way harder than anything. Infact i feel Haskell is comparatively easier than Rust. So i am not sure why one wants to use it for web. I think Rust has a place and that is to replace C++ for system software, possibly even C for writing Kernels because why not…

I disagree. I think Rust is pretty easy once you've spent a bit of time learning about lifetimes. It should be substantially less surprising when it's got non-lexical lifetimes, though. Rust seems to me eminently suited to write high-performance web applications.

Rust will never be as convenient as GC languages for web, GUI and distributed programming.

Also just because they have a GC doesn't mean all allocations have to go through the heap.

Rust killer area is the low level C stuff, resource constrained embedded devices, device drivers, codecs, ....

Re: Rust for the Web

#48

Man Rust is super hard already! I mean people told me it would be harder to think functionally but after clojure, i think lisps are super easy. But i feel Rust is way harder than anything. Infact i feel Haskell is comparatively easier than Rust. So i am not sure why one wants to use it for web. I think Rust has a place and that is to replace C++ for system software, possibly even C for writing Kernels because why not…

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…

Rust 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.

Re: Rust for the Web

#49

Man Rust is super hard already! I mean people told me it would be harder to think functionally but after clojure, i think lisps are super easy. But i feel Rust is way harder than anything. Infact i feel Haskell is comparatively easier than Rust. So i am not sure why one wants to use it for web. I think Rust has a place and that is to replace C++ for system software, possibly even C for writing Kernels because why not…

No, Rust is simple enough, just few first steps are difficult.

[deleted]

Re: Rust for the Web

#50

Just a small nitpick, but #3 is not actually an isomorphic app, it's just a regular server-rendered one. Isomorphic typically means that the app is rendered in the same way (e.g. via React) on both the frontend and backend, and the frontend degrades gracefully when JS isn't enabled. More on-topic: I just recently started a new web app using Rust on the backend. Though there is definitely a lot still missing, it's ama…

> I expect that within a couple years, Rust will be a viable alternative to Python and Ruby for backend web development

I like Rust, but I don't see this happening. Python, Ruby and PHP/Node.js languages became popular (and thus useful) because their learning curve is not steep - which is not something one can say about Rust. I consider myself capable developer but I struggled with many concepts. It's true that I didn't use it for a real project though, it might have been easier if I had clear goal in my mind.

Post reply on HN