What does HackerNews think of tide?

Fast and friendly HTTP server framework for async Rust

Language: Rust

https://tourofrust.com/ is fun. Learning rust has a weird initial learning curve dealing with the aggressive analyzer/compiler and how you have to approach your variables, but after that initial hump it is one of the coziest languages I've used. Having what was initially a bit of a nag, is now a godsend when i'm getting red-squiggles in vscode for a typo in my SQL string for a misnamed column, or a field in my template was removed and so my struct shows how it's now unused. Rust allows me to mainly only run the application to confirm things work from a business perspective.

For people starting out building stuff in rust - understand that there is a distinction of async code and libraries and can lead to confusing compiler errors if you don't realize there is a distinction. It's simple in hindsight but did cause me to waste hours barking up the wrong trees at first. Other wise just learn about `match` and Result/Option types asap, they're fundamental.

https://github.com/http-rs/tide tide is great to create an http server / routes

https://github.com/djc/askama I use this to template out HTML and it checks all my boxes, dynamic data, passing in functions, control flow.

https://github.com/launchbadge/sqlx sql interface for a variety of backend, async safe.

https://github.com/seanmonstar/reqwest http client to make requests

Rust is amazing, don't let the initial few speed bumps discourage you - building real things with rust is no more challenging today than any other modern language stack.

The DB space for Rust is a bit young, though there are several good projects like sqlx making it much more pleasant.

Rust shares many of the benefits of Go:

- statically linked binaries for ease of deployment

- good concurrency

- builtin testing framework

But it's a much sharper tool than Go:

- Really great error handling with Result/Option and the ? marker

- Like, really really good error handling, esp compared to Go

- Very pleasant logging and tracing

- Serde is fantastic at automatically serializing/deserializing datastructures

- Generics make Map/Reduce/Filter really easy and readable

- Really good project management through modules/Cargo.toml

- Crates.io is like NPM - really discoverable and easy to upload (with its goods and bads)

- FFI with Swift, C, C++, Node, etc to share code everywhere

- Builtin documentation

- Builtin benchmarking

- Powerful hygienic and non-hygienic macros

There's a lot more. I would say people choose Rust over other web frameworks not because of the language, but the emphasis on great tooling. Being able to test, document, benchmark, deploy, package, with a language that feels like a child between Go, JavaScript, and C++ is very attractive. Plus, it's fast - like really fast - and it's really obvious where optimizations can be made when the time comes.

I've worked a decent amount with Go, but I'm also frustrated with the size of projects balloon. When I compare my Rust and Go code, the Rust code ends up being much smaller (LoC) and much more dense/terse.

I've been working with it for a few years now, and I'm 100% willing to trade some complexity when doing Advanced Stuff (tm) for the 1st-class tooling. I hate having to decide which testing/documentation/building/benchmark/etc framework to use in other languages. I just want to build, not futz around with Jest/Babel/Webpack/Poetry/PyEnv/Opam/CMAKE etc.

If you're looking into using Rust for web, I recommend https://github.com/http-rs/tide - it's the most pleasant web framework I've ever used.

When learning Rust a few months ago, I built a small client library for a REST API using reqwest (which uses Tokio). I then started writing a web app using Tide (https://github.com/http-rs/tide). I eventually realized that it would be difficult to use the library I had built earlier since Tide uses the async-std runtime rather than Tokio. That was very disappointing. Is there any plan to make it easier to write "runtime agnostic" libraries in the future?