Rust is Eating JavaScript
-
I use it at work, and it's finally getting an optimization pass.
I wish I did Rust for work, but options are limited and I like my team. So I use it for hobbies until I have a reason to leave.
-
That's why French food is world renounced, it has copious amounts of butter.
-
Sounds kinda like Go. It's not functional, but functional patterns work well there.
It's not great for FE though.
-
The GC in Go is fantastic IMO since it runs in a separate thread. I used it since 1.0 (switched our product from node.js), and dealt with all the the pain of an imprecise GC (fixed in 1.5?) and all the little improvements to arrive at it's current state.
The main issues I have with it are pretty core to the language, unfortunately, such as:
interface{}
is basically avoid*
, but since it's a fat pointer, it can holdnil
without itself beingnil
, which can happen by accident- runtime reflection is a bad habit, but it's unfortunately really common
- it's really easy to deadlock by making stupid mistakes; if it had automatic unlocking based on scope (like Rust, or something like Python's context managers), we could solve this, but
defer
just isn't good enough - no destructors - with destructors, we could build a solution to deadlocks
Maybe they fixed some of those issues, idk, I haven't used it for several years. I did use it for about 10 years though.
-
Go is fine, but it has its flaws. I prefer Rust because:
- memory safety is a compiler check, not a runtime check, so you catch issues earlier
- locks contain their values, so you can't accidentally do anything unsafe
- no nil (
()
is semantically different), so no surprises with contracts - everything is an expression, which lends itself really well to FP concepts
- actual dependency management at 1.0
- pretty much no runtime, so calling from another language is super easy
- targets WASM and microcontrollers
- no pointers (not exactly true)
It takes longer to learn, but I'm about as productive with both now.
-
What's FE?
-
Can we please go back to making programs for the target OS and skip the browser dependency?
-
Front end
-
Yeah I've been playing around with rust but most know py. And to be fair on my it has fantastic libraries.
-
Wasm bindgen is an absolute nightmare of auto-generated function names. From a purely performance/functionality perspective it works but it's hella ugly. I hope some alternative arrives at some point.
-
Honestly those usecases described here shouldn’t have been done in js in the first place.
-
Essentially, JS is the new Flash….
-
The new FE is going to be in rust though
-
You can't place breakpoints inside wasi binaries. You can place breakpoints inside minified js code.
-
Thanks, "Comprehensive Rust" is readable so far, though I haven't gotten to the "fun" (memory management) parts yet.
-
Well I see huge benefits in building the tools used by a community with the technology this community masters. IMO the Python's stdlib sucks because it's written in C which is a huge barrier to entry.
-
Browsers have almost become the OS. At least in user land.
-
I mean, maybe it's not easy because they don't provide debug information, but a sufficiently motivated person can debug a web assembly binary.
-
Sounds like you want the Rust Book: https://doc.rust-lang.org/book/
Edit: Just realized you said you didn't like it sorry
-
rust is both high and low level
I like to describe this as "low level language with high level ergonomics"