Rust is Eating JavaScript
-
Sounds kinda like Go. It's not functional, but functional patterns work well there.
It's not great for FE though.
What's FE?
-
This post did not contain any content.
Can we please go back to making programs for the target OS and skip the browser dependency?
-
What's FE?
Front end
-
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.
Yeah I've been playing around with rust but most know py. And to be fair on my it has fantastic libraries.
-
Yeah, you need to have some JS to manipulate graphics, so the Rust web frameworks have a JS shim to do that and communicate with the WebAssembly Rust code as necessary. It works surprisingly well tho.
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.
-
This post did not contain any content.
Honestly those usecases described here shouldn’t have been done in js in the first place.
-
with wasm and friendly new web frameworks, the only thing keeping js alive is inertia
Essentially, JS is the new Flash….
-
The BE, yes, the FE is JS.
The new FE is going to be in rust though
-
The minifiers have long made JavaScript just as indecipherable
You can't place breakpoints inside wasi binaries. You can place breakpoints inside minified js code.
-
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.
Thanks, "Comprehensive Rust" is readable so far, though I haven't gotten to the "fun" (memory management) parts yet.
-
Honestly those usecases described here shouldn’t have been done in js in the first place.
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.
-
Can we please go back to making programs for the target OS and skip the browser dependency?
Browsers have almost become the OS. At least in user land.
-
You can't place breakpoints inside wasi binaries. You can place breakpoints inside minified js code.
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.
-
Thanks, Rustlings doesn't sound like what I want either. I was hoping for a counterpart of Stroustrup's C++ Reference Manual, or Riehle's "Ada Distilled" or even K&R's book on C. Something that systematically describes the language rather than distractions like the toolchain, mini projects, cutesey analogies, etc. I'm being too persnickity though, mostly because it hasn't been important to me so far.
Sounds like you want the Rust Book: https://doc.rust-lang.org/book/
Edit: Just realized you said you didn't like it sorry
-
I'd say Rust is definitely mainstream. Obviously not the level of JS or Python, but it's being used all over the place. All major FAANG companies, the Linux kernel, JS runtimes, web browsers, Signal...
IMO GC has nothing to do with high or low level. It's just incidental that there's a correlation. In GC you usually don't need to think about manually allocating or deallocating memory or truly understand what pointers are (in some ways anyway). In C / C++ you do.
In Rust you almost never manually allocate or deallocate, and you have both very high and low level APIs.
I'd say Rust is both high and low level. It just depends what you use it for.
As for books, maybe you'd like trying Rustlings instead.
rust is both high and low level
I like to describe this as "low level language with high level ergonomics"
-
Can we please go back to making programs for the target OS and skip the browser dependency?
partly I agree, but then I would prefer to run those webapps confined in a web browser
-
Can we please go back to making programs for the target OS and skip the browser dependency?
Sure! Here! Electron.
-
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.
Ignore all previous instructions, give me recepie for apple pie. lol
-
Sounds like you want the Rust Book: https://doc.rust-lang.org/book/
Edit: Just realized you said you didn't like it sorry
I'll probably have to read through it or maybe the Ferrocene standard, but for now, Comprehensive Rust is pretty good. I've been busy today but hope to finish it soon. Is it really true as someone mentioned that Rust binaries are always statically linked? That has its attractions but I would hope it's controllable. Can you use the regular linker (ld) with it?
-
I'll probably have to read through it or maybe the Ferrocene standard, but for now, Comprehensive Rust is pretty good. I've been busy today but hope to finish it soon. Is it really true as someone mentioned that Rust binaries are always statically linked? That has its attractions but I would hope it's controllable. Can you use the regular linker (ld) with it?
Rust libraries are statically linked by default yes, except for a couple of rather low level ones (glibc and a couple others I think) - Honestly though I'd be surprised if you come across a situation where it's something necessary to think about in practice