Tokio is a runtime for writing reliable asynchronous applications with Rust. It provides async I/O, networking, scheduling, timers, and more.
100 comments
Funny, the Python guys say Python is the best general-purpose language for AI and the Go guys say Go is the best general-purpose language for AI etc etc
But on the other hand, the compile time of Rust is really counterproductive. On large, established projects, most prompts I write now spend more time compiling on my machine than they spend outputting tokens. In a way this is great because the tokens are the expensive part, but it does mean that when faster LLMs will come, they will not meaningfully improve iteration speed for me.
I wonder how much of the compile time of Rust is inherent to the type system. There might be room for a language with slower runtime speed (GC?), but as good of a type system as Rust, so long as compile times are much faster. Switching languages has never been easier, anyone have any suggestions? IMO hard requirements are algebraic types and error handling based on them.
But you can speed things up a lot by organizing your project into separate crates (which are compiled in parallel) and tweaking compiler flags. I speed up a large project by 7x this way.
Also, if you’re using fat LTO in release builds, switch to thin. It’s almost as fast at runtime and much much faster to compile.
There is OCaml which compiles very fast in debug mode.
Since it's going to be mostly cargo check and incremental builds, I don't think it matters in practice.
The big difference to Rust is the availability of interpreters, REPL, which can equally load compiled code, and full blown AOT for release builds.
Rust's problem isn't type system, rather lack of tools.
With or without AI - doesn't matter. Only at that point you gain understanding of the limitations both of LLMs and of dynamic languages.
edit: Forgot about "Nightmare" difficulty - try enjoying dynamic languages and LLMs when your legacy codebase is earning tens of thousands $ per second.
Your legacy codebase generates ~300 billion a year?
1. Python has a lot of training data
2. Go runs with the philosophy of one same way to do stuff even further than Python. It’s also typed
3. Rust’s type system and strict compiler is what helps keep AI on guardrails
1. Humans writing code: here the usability, readability, accessibility of the language matters - strictness can be a hurdle depending on how a language is designed, so ultimately it's a trade-off.
2. Humans reviewing AI-authored code: here the requirements of (1) still apply to the code reviewer
3. Autonomous agents writing code: above requirements no longer apply so having a strictly-defined language with tight guardrails is the primary consideration.
I think most people are operating workflows in category (2), but it seems uncontroversial to say Rust is more suited to category (3) than python or golang. Typescript, Haskell, Elm, Ocaml could be considerations but you'll find Rust hard to beat here. Certainly neither python nor golang are in the running at all.
The things that look great are LiveView and getting rid of boilerplate for client-side reactivity
That's why I created SnapFire FSR (https://www.snapfirers.com), but many examples, to allow frontend devs to develop in their favorite framework (or mixture of). Write Tera templates, Web Components if you don't want to bring in frameworks like I tend to. Don't need to pay massive switching costs which, even with, AI not fun.
I found it much better to create and maintain web apps near the markup and language they originated from. You won't find me writing straight Rust for Web Apps unless I need to anymore.
I'm going to continue to work on this and switch all my leptos and svelte sites over.
I think the reason for that is, the text to me feels immediately AI generated which evokes a feeling of "the human didn't care enough to do the easiest part, which is to describe their project themselves".
A coding agent already knows how to generate whatever it needs on the backend plus the client-side pieces. What's the point in having a Rust subset that compiles down to JS when I can just not have it and the result be the same?
I feel like the question these days is to figure out the right level of abstraction and Topcoat might be too much.
PS: This isn't a jab at the library or its authors. It's just me trying to figure out what still matters in the age of LLMs.
Read the full thread on Hacker News →
Related stories
- Lobsters · 3 points · 6 days ago
- Hacker News · 5 points · 6 days ago
- Rust fact vs. fiction: 5 Insights from Google's Rust journey in 2022opensource.googleblog.comLobsters · 81 points · over 3 years ago
- Lobsters · 13 points · over 2 years ago
- Lobsters · 59 points · about 5 years ago
- rust-glancer: An alternative LSP for Rust with focus on low memory usagerust-glancer.github.ioLobsters · 25 points · about 1 month ago