Rust is Eating JavaScript
-
Can I just say how beautiful that page is? Such a delight to read the text on it. The legibility. The simplicity.
-
I know that the "project" approach to learning a language works for some people, but I've found l greatly prefer to read a book from beginning to end before undertaking any projects. It helps me start out with a clear picture. I'm finding "Comprehensive Rust" to be fairly good so far. Thanks for all the help, everyone.
-
with wasm and friendly new web frameworks, the only thing keeping js alive is inertia
-
Fun fact! Lemmy is made in Rust!
-
I thought python has kinda exploded lately...
-
Because corporations doesn't want web to be open, everyone can javascript, not everyone can read webassembly.
-
Is this a 2yo write up, considering the last update was in 2023?
-
Eventually?
-
The minifiers have long made JavaScript just as indecipherable
-
- It's statically compiled and isn't dependent on system binaries and won't break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps
You can do that with C++ too.
- Still produces fairly small binaries unlike languages like Java or C# (because of the VM)
I mean, the jars are actually pretty small; but also I really don't get the storage argument. I mean we live in a world where people happily download a 600 MB discord client.
- Is a modern language with a good build system (It's like night and day compared to CMake)
Meson exists ... as do others.
- And I just like how the language works (errors as values etc.)
Fair enough; though why? What's wrong with exceptions?
I work in a code base where I can't use exceptions because certain customers can't use exceptions, and I regularly wish I could because errors as values is so tedious.
-
Can browsers run rust in the front end instead of javascript, or is it limited to transpile time and backend?
-
Sort of, browsers can run rust code through webassembly. But i dont think this is a full replacement for JavaScript as of yet.
-
You can deminify, decompiling is a bit harder.
-
the close tie to Google.
Guess who's one of the rounders of the Rust Foundation...
-
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.
-
The BE, yes, the FE is JS.
-
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.