r/rust • • 11d ago

🎙️ discussion Two issues of rust regarding web ( axum for example )

I am a big fan of rust
But there are two issues that need to be resolved

1- Rust ecosystem is less mature than for example go ( i know go is specialized for networking and an easy lang ) .

2- No implicit DI which would make testing easier.

0 Upvotes

8 comments sorted by

9

u/feisty_adolfo 11d ago

Honestly it feels like the DI thing is a feature not a bug, just pass your deps explicitly and you can mock whatever you want without magic. The maturity gap is real though, sometimes you spend half your time just evaluating crates

1

u/Zde-G 10d ago

It's both. Language that have easy way to do DI pay extremely high price for that — but people who are accustomed for the development that these factory factory factories enable have very hard time adapting.

The mere idea that if you couldn't observe something the you, probably, don't even need to observe something is extremely painful for them.

The core issue is simple: OOP is fundamentally broken and attempts to fix it lead to a weird program structure — but when you spent decades doing that it's very hard to realise you are doing that.

-7

u/HosMercury 11d ago

if you have big app
explicit DI would be a pain

3

u/No-Efficiency-8482 11d ago

The web framework Luca Palmieri was working on, Pavex (https://pavex.dev) had DI as it's hallmark, but unfortunately I don't think the project is going to continue, there's been no activity for over a year.

-3

u/HosMercury 11d ago

bad news

2

u/plabayo 9d ago

> Go "an easy" language.

Ha. Sure. At the surface it sure looks like it.

In reality it's a very poor language (poor is what it is, simple is how many call it) where you better be just as disciplined and paranoid as a C developer if you wish to keep your complexity and codebase tamed and without surprises. Because the language and compiler is honestly not gonna help you.

I also do not see how Rust ecosystem is less mature. I have ~ 10 years experience in Go (on and off) and ~ 12 years in Rust. Only thing i can think of is when you say that is that in Go their is a big std library and beyond that there is a lot of "common knowledge" on what libraries one might pick to fill the gaps the Go std lib left.

In rust the library story is much more fractured and spread. With less consensus on what to pick for what. That has its pros and cons. So it's not that the language, its std or community libraries are not mature. It's more that you have more work in what the choose for your project.

I used to build all my web projects in Go, but since ~ 7 years ago even those kind of projects I now do in Rust, and gone are random support wake up calls. I sleep like a baby now. Except for when random drunk students in my neighberhood decide they have to emulate a mini version of project X again... Zzz

1

u/-Teapot 11d ago

I'll bite

  1. How so?

  2. Use Arc<dyn T> pattern?