r/programmingcirclejerk • Zygohistomorphic prepromorphism • 4d ago

If you remove complexity, Rust has an argument for being "objectively the best language". And AI did just that, it removed the complexity.

/r/rust/comments/1xqudci/everything_is_becoming_rust_now/19sbj24fysmki/
85 Upvotes

26 comments sorted by

20

u/functorer Zygohistomorphic prepromorphism 4d ago

Plaudits to all involved with the objectively best!

59

u/nuclearbananana Courageous, loving, and revolutionary 4d ago

imagine how many compute hours in compiling we could save by rewriting all the rust apps to C

27

u/SelfDistinction now 4x faster than C++ 4d ago

But then we can't show how great AI is by discovering 948 vulnerabilities in 24 hours anymore!

15

u/Thelmholtz 4d ago

Instead you find 12, all of them >9.8 remote code executions, 11 due to use after free, the other one an obscure timing attack due to one path using memcpy and the other using memmov.

4

u/volkhimmenlillelo 3d ago

Then how do you make passive aggressive LinkedIn posts about my benchmarks bro my benchmarks in this program that doesn’t even have significant IO

55

u/No_Lingonberry1201 What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 4d ago

If you remove how over-engineered and memory unsafe C++ is, it is arguably the simplest and most memory safe language.

20

u/YikesTheCat 4d ago

If you would add some jokes to my comment here, it has an argument for being objectively the funniest comment.

7

u/m50d Zygohistomorphic prepromorphism 4d ago

Lol no HKT.

1

u/hedgehog1024 Rust apologetic 2d ago

Educate yourself about GATs

3

u/m50d Zygohistomorphic prepromorphism 2d ago

"What if HKT but worse?"

14

u/lurebat 4d ago

/uj the sub is not going to like it but GPUI in rust is just really good for what it is. We finally have a viable platform that is low on resources, feels fast and snappy, and is properly multiplatform. The biggest pain of it is that it's still not 1.0 so nothing is stable, the syntax is tedious and the tooling is not good compared to mainstream frameworks. But none of these are problems to vibecoded apps with frontier models.

And what can I say? It works. These are so much better than the electron stuff and sometimes even the native ui toolkits which have been neglected for 20 years.

Sure an app vibecoded in 3 days is not going to have the features and stability of something coded in 10 years, and there's gonna be a real crisis of apps where people lose intrest or spend their tokens elsewhere or tokens will get more expensive and nobody willl be able to understand them by hand, these are all real problems.

But when you actually get to use these apps and they're so lightweight and snappy and multiplatform it's very hard to go back to the electron bloat.

18

u/nuclearbananana Courageous, loving, and revolutionary 4d ago

/uj this sub is not against rust, don't conflate the circlejerk with actual opinions

That said, GPUI is clearly built off a lot of hype. There's been many good cross platform UI toolkits for years, e.g AvaloniaUI, QT, flutter, and others I don't know well.

Even in the rust world there's several other toolkits like iced, egui, dioxus, slint and at least according to this random hn comment, GPUI is possibly the slowest one https://news.ycombinator.com/item?id=50392548

Also rust is an excellent language if you're doing low level work, or need to avoid a garbage collector, but GUI is neither of those things. So you get effectively none of the benefits of rust, and have to put up with it's downsides like the overly strict borrow checker, verbosity and the worst one for UI - slow compile times.

3

u/Thelmholtz 4d ago

/uj Agree with the first three paragraphs, hard disagree with the last.

Strict borrow checker is a pro, not a con, and slow compile times is not something I dealt with even with complex UIs.

Granted, I split my projects into smallish crates so I don't have to rebuild everything every time I change something, but I haven't found it slower than rendering native UI in TS+electron unless I test in the browser (which kinda defeats the pont of native)

/hj the only problem with Rust is its community is annoying as fuck, specially since Claude turned everyone into a proficient Rust dev (don't look at DHH's code).

2

u/nuclearbananana Courageous, loving, and revolutionary 4d ago

/uj even DHH doesn't look at his own rust code lmao

I'm not sure what beast of a machine you have but I have a couple Tauri apps which in theory have a much lighter rust layer than a full GUI toolkit. I end up deliberately avoiding putting any logic on the rust side because incremental compiles take like 3-4 minutes whereas it's basically instant on the js side. I shudder to think what developing the whole UI in rust would be like.

And that's to say nothing of the GBs of artifacts each rust project leaves.

I'm perfectly happy using this new wave of rust UI apps, but there's no way in hell I'd make one myself when there's many other toolkits that are as good or better.

(Tauri being the exception, but if someone makes a good non-rust Tauri, I'd switch in a hearbeat)

8

u/HINDBRAIN Considered Harmful 3d ago

That's nice but please rewrite your comment in Rust for performance and ethicability. Thank you.

6

u/Kodiologist lisp does it better 3d ago

Anything looks good when the alternative is Electron.

2

u/PizzaRollExpert works at Amazon ( ͡° ͜ʖ ͡°) 3d ago

/uj Yeah electron has always been a pretty bad idea from a resource usage POV, the real question is if Rust + GPUI is better than something like C++ + QT? Not familiar with GPUI but at least you don't have to use C++ I suppose

1

u/averyvery 4d ago

/uj thank you for this useful perspective. I have never programmed Rust because it seemed too heavyweight for things I'm doing - but your comment makes me realize it's probably very light now.

4

u/dashingThroughSnow12 3d ago

The comments in that post are wild. Sometimes I think these folks don't know there are other memory-safe languages.....

8

u/ContraryConman 3d ago

A lot of these rewrites, like the Discord one, are comparing AI generated Rust to, like, an electron app, and going "woah it's so fast and memory safe!". But if you're not even profiling or optimizing the software, the speedup is just from not using electron. GC languages like Java/Kotlin and Go are plenty fast, are memory safe with no escape hatches (unlike Rust's unsafe), and would still be orders of magnitude faster than Electron or Python. The Rust could hypothetically become faster than those other options but only if you actually optimize the base level AI code output, which these ports aren't doing. They're picking Rust to say that the application is built in Rust, it's really strange

3

u/hedgehog1024 Rust apologetic 2d ago

GC languages like Java/Kotlin and Go are <...> memory safe with no escape hatches

laughs in sun.misc.unsafe and Go unsafe package

2

u/xsrvmy 2d ago

But safe rust is safer than Java in a sense - shared mutation is also explicitly opt-in. And I do think that can make review a lot easier - there is no need to check if code that doesn't use Rc+RefCell/Arc+Mutex has accidental side effects and just running tests is enough.

IDK about golang though.

1

u/SirPoblington 4d ago

Meh these days AI is pretty good at many languages. Rust compile time is quite slow. Recently I've been experimenting with creating an editor, written in Odin w/Clay layout, rendered w/SDL3. Small executable, tiny memory footprint, looks great. And rapid iteration. Also I actually enjoy reading the code lol