Something like https://sinatrarb.com/ for rust would be cool.
Axum + minijinja is quite close to this I would say. Been using it for a little while and I am very happy so far.
Rust needs a web framework
261–270 of 395 posts
Re: Rust needs a web framework
#262Rust and ‘minimal effort’ have to business being in the same room.
^^^^^^^^^^ expected lifetime>>>, found Ref>>>
Re: Rust needs a web framework
#263Earlier quoted context omitted.
It would be great to introduce some competition there, then! (Not only because I think competition is good, but because I really do not enjoy writing Go.)
This thread is amusing. Go look at job boards. The competition for Go, Rust, Django or whatever is Java+Spring. That's pretty much the industry standard unless you're in a Microsoft-only shop.
Re: Rust needs a web framework
#264Possible unpopular opinion: Rust is a systems language, doing "web work" in Rust is a waste of effort as there are much better languages and ecosystems for that.
Re: Rust needs a web framework
#265Earlier quoted context omitted.
I guess you mean ergonomics. Yes they do, unless you get your editor to magically type `.clone()` and `[A]Rc ` all over the place. Not to mention they don't need unsafe, or 3rd party crates to handle graphs. Additionally, all of them have interpreters and REPLs alongside their compilers, streamlining the code-develop-debug loop.
Thanks for pointing the typo out! I've fixed the comment. In fairness, I think a lot of this comes down to familiarity. I'm fairly familiar with `.clone()` and Arcs at this point, so they don't really change much in terms of ergonomics. Usually their usage is fairly obvious, and quite often my editor literally does magically type the `.clone()` calls through LSP fix commands. It's the same as, say, OCaml's insistence…
Re: Rust needs a web framework
#266You don't need a router when you have pattern matching (just split the url and match on static and dynamic vars however you need)
Auth is typically DIY in any language, or SaaS like Firebase/Auth0. It's not a language or framework problem, necessarily
CSS/JS tooling makes no sense for many frontend Rust frameworks like Dominator, which is in Rust (not JS) and has its own approach to styling that works for it (e.g. attaching styles to signals, so they change on the fly)
I get what the author is saying - in fact I've been around the block a couple times solving all the different points in the article and it is painful. For example, see https://github.com/dakom/dominator-workers-fluent-auth which does a lot of the stuff here on the Cloudflare workers framework (also adds another wishlist item - localization with Fluent)
A "batteries included" full framework that does _everything_ is nice to have, but many real-world projects will want to replace those opinionated decisions and go the DIY route anyway. Rust is more than mature enough, even on the frontend web, to tackle all of that - if you know where to look (wasm-bindgen, etc.)
Re: Rust needs a web framework
#267What make rust better than any language when the bottleneck is the network or the database?
Re: Rust needs a web framework
#268Earlier quoted context omitted.
> I never think about memory management when I'm writing Rust, let alone am I "doing it" (active voice). Worrying about lifetimes is memory management that is unnecessary with GC languages and directly increases cognitive load. My second paragraph is pointing out that "where I can open something like Notepad without an LSP or highlighting" is a strange qualifier. Why does it matter if you don't have semantic analysis…
> Worrying about lifetimes Again, not my experience at all. I simply don't think about any of that stuff when I write Rust, all my mental energy can safely go towards working on whatever I'm building. If you don't believe me, you're welcome to watch the literally hundreds of hours of me live coding in Rust on YouTube.
> Watch the literally hundreds of hours of me live coding in Rust on YouTube
Your definition of "lazy" seems quite different from the standard definition.
In my view, the average "incredibly lazy developer" of 2024 tries to have an LLM write most code for them (probably in JS/TS/Python), doesn't notice the subtle bugs introduced by said LLM, and ships straight to prod. If using an LLM fails, they go back to StackOverflow to look for an answer that they can copy-paste. When that fails they give up and ask a less lazy developer for help. At no point in this process did they read the documentation for the language/framework/etc they are using to accomplish their goals.
Re: Rust needs a web framework
#269Just use Phoenix and live view. Prototype is easy and fast. Scales well to very large user base on a single node. Interactive client side without even writing JS. I love rust, I really do, I use it for all kind of things. But for web app, the Erlang architecture is so well designed and mature you cannot compete. Also we use rust and zig from Erlang with native modules for video processing and AI, the elixir/Erlang "s…
No types in Elixir, I think a better comparison is actually Gleam, it is Rust-like in type system but is built on and interoperable with Erlang/OTP.
Now F# on the other hand…
Re: Rust needs a web framework
#270For new web applications, why recommend alternatives to Next.js? How do you convince someone to use an alternative? The knowledge needed to understand why will help you get close enough in Next.js anyway.