4 ms·
I don’t have hard data to back it up, but LLMs make writing code super easy now. If the code compiles, you’ve basically filtered out the hallucinations. That’s
by m00dy 1y ago
I don’t have hard data to back it up, but LLMs make writing code super easy now. If the code compiles, you’ve basically filtered out the hallucinations. That’s why writing in Python or TypeScript feels kind of pointless. Rust gives you memory safety, no garbage collector, and just overall makes more sense, way better than Go. Honestly, choosing anything other than Rust feels like a risky gamble at this point.
- yahoozoo 1y agoDoes nobody write business logic in Rust? All you ever hear is “if it compiles it works” but you can write a compiling Rust program that says “1 + 1 = 3”. Surely an LLM can still hallucinate.
- m00dy 1y agoyou also write units tests, which is something baked in rust std toolchain.
- spacechild1 1y agoRust only really makes sense in settings where you would have otherwise used C or C++, i.e. you need the best possible performance and/or you can't afford garbage collection. Otherwise just use Go, Java or C#. There is no gamble with picking any of these.
- m00dy 1y agoIf you use an LLM with C or C++, stuff like pointer arithmetic or downcasting can be tricky. The code might compile just fine, but you could run into problems at runtime. That's why Rust is the only way...
- spacechild1 1y ago> The code might compile just fine, but you could run into problems at runtime. Obviously, this can also happen with Rust, but certainly less so than with C or C++, I'll give you that. But how is Rust the only way when there's also Java, Go, C#, Swift, Kotlin, etc.?
- echelon 1y agoRust is fantastic for writing HTTP servers, microservices, and desktop applications. OpenAI uses Rust for their service development as do a lot of other big companies. It's a lot like Python/Flask, or even a bit like Go. It's incredibly easy to author [1] and deploy, and it runs super fast with no GC spikes or tuning. Super predictable five nines. Desktop apps sing when written in Rust. A lot of AI powered desktop apps are being written in Rust now. If you're going to reach for Go or Java (gRPC or Jetty or something) or Python/Flask, Rust is a super viable alternative. It takes the same amount of time to author, and will likely be far more defect free since the language encourages writing in a less error prone way and checks for all kinds of errors. Google did a study on this [2,3]. [1] 99.9% of the time you never hit the borrow checker/lifetimes when writing server code as it's linear request scoped logic. You get amazing error handling syntax and ergonomics and automatic cleanup of everything. You also have powerful threading and async tools if you need your service to do work on the side, and those check for correctness. [2] "When we've rewritten systems from Go into Rust, we've found that it takes about the same size team about the same amount of time to build it," said Bergstrom. "That is, there's no loss in productivity when moving from Go to Rust. And the interesting thing is we do see some benefits from it. So we see reduced memory usage in the services that we've moved from Go ... and we see a decreased defect rate over time in those services that have been rewritten in Rust – so increasing correctness." https://www.theregister.com/2024/03/31/rust_google_c/ https://www.theregister.com/2024/03/31/rust_google_c/ [3] https://news.ycombinator.com/item?id=39861993 https://news.ycombinator.com/item?id=39861993
- spacechild1 1y ago> Rust is fantastic for writing HTTP servers, microservices, and desktop applications. In which world is Rust fantastic for writing desktop applications? Where are the mature Rust UI frameworks? > Desktop apps sing when written in Rust. What does this even mean? > A lot of AI powered desktop apps are being written in Rust now. For example? And what do you mean by "AI powered desktop apps"?
- echelon 1y ago> In which world is Rust fantastic for writing desktop applications? Where are the mature Rust UI frameworks? Rust has come a remarkably long way [1] ! It's better than any language that isn't C/C++. We have bindings to all of the major UI toolkits, plus a lot of native toolkits. You can also use Electron/Tauri for Javascript, or Dioxus for something more performant. Egui is also really nice for dev tools. > What does this even mean? Rewrite It In Rust metrics tend to tell good stories. Developer blogs (links escaping me right now) show positive performance gains for lots of consumer desktop software written in whole or in parts using Rust. Discord, Slack, lots of other apps are starting to replace under-performing components in Rust. > For example? And what do you mean by "AI powered desktop apps"? Stuff like Zed [2] and the open source Photoshop-killer I'm working on (user-guided volumetric rendering, real time instructive Figma). The creator or egui works on Rerun [3], which is industrial / spatial visualization. Etc, etc. [1] https://areweguiyet.com/ https://areweguiyet.com/ [2] https://zed.dev/ https://zed.dev/ [3] https://rerun.io/ https://rerun.io/