5 ms·
Web developers have zero issues with using Rust for web development though. The Rocket web framework is rather intuitive. I even built my website entirely in Ru
by mmstick 10y ago
Web developers have zero issues with using Rust for web development though. The Rocket web framework is rather intuitive. I even built my website entirely in Rust with it.
http://mmstick.tk http://mmstick.tk
- burntsushi 10y ago"zero issues" is a bridge too far. Rocket, for example, only works on nightly Rust, and that might be a non-starter for a lot of people.
- flukus 10y agoThis has been my biggest issue trying to learn rust, there are too many projects that only support the bleeding edge.
- burntsushi 10y agoRocket is one big one. Just recently though, serde and diesel started working well on stable Rust. Other than that, unless you're doing embedded stuff or SIMD, you should be fine on stable. Unfortunately, Rocket does not appear to be on track to work on stable Rust for the foreseeable future.
- flukus 10y agoI was hoping with serde being on stable things would settle down. What's keeping rocket on nightlies?
- steveklabnik 10y agoLots of things: https://github.com/SergioBenitez/Rocket/issues/19 https://github.com/SergioBenitez/Rocket/issues/19
- pingveno 10y agoThis issue has been greatly reduce since Rust 1.0 came out as more language features are stabilized. Just in 2017, Diesel (ORM) and Serde (serialization) have started being fully functional on stable Rust. Rocket is one of a rapidly shrinking set of libraries that relies on unstable features. As long as Rocket doesn't add a dependency on more unstable features, it too will join the ranks of stable-compatible crates soon.
- neandrake 10y agoMaybe it's nostalgia for pre-Web 2.0 designs but I love your website; it has character and feels personal compared to most pages I peruse.
- mmstick 10y agoThanks. I've never built a website before, but now I've built a website, and a web server + cms client at the same time. I've been thinking of open sourcing the code at some point in the future. The website stores all the content in a database, uses handlebar templates to generate HTML pages, stores the generated HTML pages in a concurrent hash map compressed with the native Rust implementation of Zopfli, and only regenerates pages after a set amount of time -- all in pure Rust. I can serve an unrealistic amount of requests per second -- just bottlenecked by a consumer-grade network connection.
- whyever 10y agoCouldn't you just gzip the HTML and serve it directly to the browser?
- mmstick 10y agoThe HTML pages are generated dynamically from content in my database, in the same manner that Wordpress works. Once a page for a URL has been generated, it is indeed gzipped with zopfli and stored in a concurrent hash map so that future requests for the same content will serve the already-compressed content. If the timestamp has expired and a user requests expired content, only then will that page be re-generated, re-compressed and updated. Without this, I would have to re-generate and re-compress the content each time I get a request.
- deleted 10y ago[deleted]