by k__ · 6y ago · 0 comments
Rust is a special case here, light weight, and loved by JS devs.
I'd still "flame" anyone who wants to drop a C# or Java VM on their users.
Is it? That's interesting, because to me the two languages seem to be polar opposites.
"loved by JS devs" is maybe a bit strong, as there are a LOT of JS devs, but we do enjoy a lot of JavaScript folks getting involved with and/or using Rust, and I and others have given a bunch of talks about Rust (with and without wasm) at JavaScript conferences that were well received.
Static checking etc. is nice but what's wrong with things like typescript? Do we really want web libraries fragmented into a million languages?
> randomly from the norm for no apparent reason other than to be different
This has been written about in a number of places, and I don't have time to get into it, but a lot of languages are trending in this direction with syntax because it is more regular in a language that contains pervasive type inference. It's not random.
> Static checking etc. is nice but what's wrong with things like typescript?
Typescript still has node (or deno, still V8) as a runtime, so you're still dealing with its runtime, and all the cons (and pros) there. Additionally, the guarantees you get out of TS and Rust are different, as they have pretty different type systems, even if they're both statically typed, and TS is closer to Rust than it is to JS.
- leaning on (some) pragmatic FP concepts
- modern tooling and dependency management
- very _approachable_ and solid documentation, books etc. (see MDN, Rust by Example, Rust Book, Eloquent Javascript...)
- both can target the browser (well)
- Mozilla has a very good name in the Web dev community. I think at least; this is definitely relevant to me.
I just remember having to do a lot of my college classes in C++, where some of our basic programs needed variables to be constantly cast into another type just to do something with it. I remember, man, I cannot wait to have to deal with this when I parse json data from an api request, bring it on.
I am JS developer, and apparently I love Rust.
In what world is Rust a lower level language compared to JavaScript at this point?
That seems like a much bigger minefield, but I’d be happy to be educated on this. I’d ask that part of that education include why I’d ever introduce this class of problems into web development.
The embedded one. Can't write bootloaders or kernels in JS. I mean, maybe you could but... why would you?
(On mobile here, bear with me if no newlines came through)
You’ll get all that (and more), and it’ll be higher level.
Additionally, these languages are designed to target the web, so they have a lot of libraries and bindings for JS libraries already written.
So you are missing a basic feature that a bazillion other languages can give you. I am still amazed how people think that the ML features in Rust somehow new inventions.
The onus is on you guys to tell me why I’d add cognitive overhead for simple webapps, and if it’s coming from the Rust community, I’m expecting to hear ‘performance’, in which case I’m game.
I have the same opinion on overheard in the JS churn cycle, it’s up to you to make the case why the overhead makes sense for the cruddiest of apps.
We shouldn’t coronate things willy nilly. If Rust is the one true blood prince of the C era, I expect him to reign in similar domains, but please don’t flex that power in domains where you are a sub standard solution.
All hail Rust, but jesus, slow down. That’s a simple js app.
And considering TypeScript is so favored as a way to "herd the cats" of JavaScript typing, it seems not everybody shares your opinion.
People go to Rust not necessarily because it's "fast" or "low-level", but possibly because it has a expressive type system that lets you be precise and correct without having to be verbose.
Sure, the fact that it can be used at the low-level and for performance-intensive applications can be a very good thing, but it is far from Rust's only merit.
I realize this is an unpopular opinion, but JS/TS is WAY more human readable than Rust is. It's almost the equivalent of programming in C for the browser. Plus, literally anything you could ever want to use in already in the JS ecosystem and doesn't have to be reinvented in Rust.
Also, explicitly borrowing in method signatures is a BIG plus for me as its a lot easier to understand an API when its clear whether it mutates or not an argument, as opposed to JS where number arguments just cannot be mutated and pointer arguments (such as arrays) always can be mutated. I find understanding random github projects a lot easier in rust than js or python.
I'm not saying you should use rust, but many like rust specifically because of its readability and even find they're more productive in the long term because of its "high level" features and explicitness (although LEARNING it is a lot harder).
...so but how's the quality of npm ecoshitstem? last time I heard you guys had some trouble in paradise, plus everything noteworthy is owned by either facebook or google, both having huge antitrust issues lately
Rust certainly has an advantage here, as it was design to not require a runtime system.
Tiny Go, D and AssemblyScript all manage small enough download sizes.
Then just like with native apps, one doesn't necessarily need to download everything at once.
Is there any data on that?