Rust is Eating JavaScript
-
Rust makes multi threading very easy you can just use
thread::spawn();
But rust makes Async difficult because it's naturally stackless so you need to create your own scheduler or use someone else's like Tokio. Also, people have a bad habit of conflating async with concurrency which makes it more confusing.
-
Maybe give it a try; it's my favorite language to write programs in now, it has an extremely good standard library, and for everything else there's a mass of high quality crates, its build system is actually competent and makes compiling on Windows or Linux trivial, plus many, many more quality of life features.
-
Thank god.
-
Sure you can spawn threads but now you have all the hazards of shared memory and locks, giving the 2.0 version of aliasing errors and use-after-free bugs. Also, those are POSIX threads, which are quite heavyweight compared to the in-process multitasking of Golang etc. So I would say that's not really an answer.
-
Purescript targeting the Erlang VM
Have you tried Gleam?
-
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.
-
No I haven't, I'll take a look at it, though I felt suspicious of "task.async" as shown on the front page of gleam.run.
-
Yes it's on my infinite todo list. I'm just being too much of a curmudgeon about the available textbooks, and had a sinking feeling when the main one didn't get "hello world" out of the way on page 1, and shift to the specifics of the language.
-
Nom nom nom
-
I’ve used it the last few years to do Advent of Code (https://adventofcode.com/) and that’s been fun and challenging. Definitely recommend it. Better than trolling through a book of “now do this” examples if you’ve done other languages in the past.
-
I don't know but I don't think rust has that problem. In fact I've always thought its data ownership paradigm is literally the most optimal approach to concurrency and parallelism. I really love using rayon in rust for instance.
-
Go routines are certainly special and hard to match, but rust has all the normal abstractions of a language like C, just with a borrow checker so you can avoid memory leaks, write after read, etc.
-
If Rust had been around when I was an underclassman, I would have been totally locked into the full CompSci track. Instead, I got introduced to Java and C (and calculus…) and that looked like a nightmare compared to what I had been playing with in JS/Python land, so I noped on out of there and got a Comp Sci Lite degree.
Years later, I’m just completely in love with Rust.
-
I think there's room for a rust-lite language that is GCed. Something with a functional-style type system and that compiles to machine code.
Roc is a candidate for this language. Basically Elm that compiles to machine code, but with a number of tweaks to make it work for more than just a web front end. Like Elm, the type system is haskell like, but simplified.
-
Thanks, I was looking for a more straightforward academic-style textbook for non-beginning programmers, but I'll make do with what is out there.
-
True, but of course it's always a trade-off. At a certain point I have to defer to your judgment, at least until I've written some Rust code. But I've written a fair amount of C++ and a little bit of Ada and don't find them all that convenient compared to Python or Haskell or whatever. We'll see.
-
Thanks, Roc sounds interesting. Ocaml also maps more closely to machine operations than Haskell does, so it has always seemed like another alternative. AMD has something called ROCm which is their version of CUDA, but I assume that is unrelated.
-
IME a language is as good as its package manager and libraries, and cargo is great.
-
The JS tooling universe has always seemed like a Lovecraftian hellscape to me.
That's most of any programming of today for me.
If it can't be grasped in a couple of days - then na-ah.
I can patch something I need working which doesn't, written in C.
autotools ftw
-
This is what I've been going through, sold as teaching rust to people who already know other languages. I'm not very far in at all, but it seems decent? https://google.github.io/comprehensive-rust/