←back to thread

365 points tanelpoder | 1 comments | | HN request time: 0.001s | source
Show context
thanhhaimai ◴[] No.44978239[source]
I'd rather `ruff` being merged with `ty` instead. `uv` for me is about package / project manager. It's not about code style. The only time `uv` should edit a code file is to update its dependencies (PEP 723).

On the other hand, both `ruff` and `ty` are about code style. They both edit the code, either to format or fix typing / lint issues. They are good candidates to be merged.

replies(7): >>44978308 #>>44978351 #>>44978465 #>>44978499 #>>44978500 #>>44979712 #>>44981364 #
charliermarsh ◴[] No.44978500[source]
To clarify, `ruff` and `uv` aren't being merged. They remain separate tools. This is more about providing a simpler experience for users that don't want to think about their formatter as a separate tool.

The analogy would be to Cargo: `cargo fmt` just runs `rustfmt`, but you can also run `rustfmt` separately if you want.

replies(7): >>44978537 #>>44978539 #>>44979669 #>>44980254 #>>44980289 #>>44985044 #>>44985715 #
WD-42 ◴[] No.44978537[source]
Thank you for writing software for all of us Python day-jobbers who wish we were writing Rust instead.
replies(2): >>44984068 #>>44984899 #
echelon ◴[] No.44984899{3}[source]
You can advocate for using Rust at work.

If you're writing microservices, the Rust ecosystem sells itself at this point.

replies(1): >>44986616 #
foxygen ◴[] No.44986616{4}[source]
What Rust has over other languages that makes it better for writing microservices?
replies(1): >>44986729 #
mtndew4brkfst ◴[] No.44986729{5}[source]
API-first or API-only backends are a sweet spot for today's Rust, IMO, and its resource footprint, reduced maintenance long-tail, and performance properties are all super competitive. It's especially hard to find another language that can compete with Rust on all three of those at once.
replies(1): >>44989016 #
simpaticoder ◴[] No.44989016{6}[source]
>reduced maintenance long-tail

I'd like to hear more about that. I'm also curious what makes Rust particularly suited to "API-first" backends. My understanding of the language is that it's concurrency primitives are excellent but difficult to learn and it's gc-less runtime.

replies(1): >>44989154 #
echelon ◴[] No.44989154{7}[source]
> it's concurrency primitives are excellent but difficult to learn

They're actually incredibly easy to learn if your software paradigm is the request-response flow.

The borrow checker might kill your productivity if you're writing large, connected, multi-threaded data structures, but that simply isn't the nature of 90% of services.

If you want to keep around global state (db connectors, in-memory caches, etc.) Arc<Mutex<T>> is a simple recipe that works for most shared objects. It's dead simple.

You can think of Rust with Axum/Actix as a drop-in replacement for Go or Python/Flask. With the added benefits of (1) no GC / bare metal performance, (2) much lower defect rate as a consequence of the language ergonomics, (3) run it and forget it - no GC tuning, very simple scaling.

Rust has effectively made writing with the performance of C++ feel like writing Ruby, but with unparalleled low defect rates and safety on account of the type system.

replies(1): >>44990354 #
aaronblohowiak ◴[] No.44990354{8}[source]
>Rust has effectively made writing with the performance of C++ feel like writing Ruby, but with unparalleled low defect rates and safety on account of the type system.

This is a little overblown.. speaking VERY HAND-WAVILY, sea_orm < active record by a factor of about 10x more mental overhead but is at least that much more performant...

but yea, vibe-coding rust micro services is pretty amazing lately, almost no interactions with borrow checker, and I'm even using cucumber specs...

replies(1): >>44991016 #
echelon ◴[] No.44991016{9}[source]
You're right on that front.

I currently wouldn't recommend any Rust ORM, Diesel included. They're just not quite ready for prime time.

If you're not one to shy away from raw SQL, then SQLx is rock-solid. I actually prefer it over ORMs in general. It's type-checked at runtime or compile time against your schema, no matter how complex the query gets. It manages to do this with an incredibly simple design.

It's like an even nicer version of Java's popular jOOQ framework, which I always felt was incredibly ugly.

SQLx might be my very favorite SQL library of any language.

replies(1): >>44996427 #
1. aaronblohowiak ◴[] No.44996427{10}[source]
I will give it another look, thanks!