5 ms·
You know what’s even more interesting? Using a low level language for no obvious performance reasons in the browser (as in, what performance critical thing are
by runawaybottle 6y ago
You know what’s even more interesting? Using a low level language for no obvious performance reasons in the browser (as in, what performance critical thing are you solving?).
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.
- steveklabnik 6y agoJust because that was your C++ college experience, does not mean that reflects the experience of C++ today, let alone Rust today.
- runawaybottle 6y agoLook, that web app in that tutorial is roughly 200-300 lines of code in regular js/css/html, maybe less. 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.
- steveklabnik 6y agoI don't know what to tell you. It's a blog post. Simple apps are how you start to learn things. Nobody is saying that doing this is the most amazing end all be-all JS is dead and over lololol. Some people like Rust. Some people like web apps. Some people want to use Rust to write web apps. If you don't, there are tons of other technologies you can (and should!) use to do that, and someone saying "hey if you're interested, here's how with a small example" isn't a threat to any of that.
- runawaybottle 6y agoFair enough. The thing about the developer community is that many of the best and worst trends came from innocuous blog posts. From innocuous conference talks. It’s a blessing and a curse. I no longer treat these posts as banal.
- dmit 6y agoI start missing Rust approximately 30 minutes into every new Typescript project I work on because there's no good alternative to Rust enums (and other benefits that come with them, like pattern matching). I can't derive basic traits for my data, like specifying equality or a canonical ordering. I can't define math operations for my calendar types, my units of measure, or my 3D graphics structs. (De)serialization of data is a minefield. In what world is Rust a lower level language compared to JavaScript at this point?
- _underfl0w_ 6y ago> In what world is Rust a lower level language compared to JavaScript at this point? 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)
- dmit 6y agoI see your point, but I think it only exposes the weakness of the terms "high-level" and "low-level" when used to describe programming languages. Rust is both low-level in that it can be used to write code for very small computers, but also high-level thanks to all the useful abstractions it provides. There is no axis on which JavaScript (with or without Typescript) is a higher-level language than Rust in 2020. Rust offers a richer standard library, much MUCH more powerful facilities for modeling data, state-of-the-art (de)serialization that's one crate import and a one-liner annotation away. I don't know who came up with asm.js, but that person definitely knew. JavaScript's destiny is to be a building block. Yes, it feels nice to write plain JS without importing any libraries. It's nice knowing the difference between `Array#slice` and `Array#splice` without looking it up on MDN. But it felt just as nice for ASM coders in the 80s to bypass a C compiler, and look where we are now.
- StreamBright 6y ago>> no good alternative to Rust enums 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.
- GordonS 6y agoPersonal opinion: Rust seems as bizarre choice as C/C++ would be for web apps, regardless whether it's for the frontend or backend - I'd personally much prefer to use a higher-level language like C#, F#, Go, Scala or Kotlin.
- k__ 6y agoWell, Rust is higher level than C, but not nearly as heavy as the others you mentioned.
- StreamBright 6y agoF# turned out to be a great option for us, we combine it with Elm and they work very well together.
- Nelkins 6y agoIf you feel comfortable, consider making a PR to this repo of companies using F#: https://github.com/Kavignon/fsharp-companies https://github.com/Kavignon/fsharp-companies . Always good to have another success story!
- pjmlp 6y agoActually that is how we were writing web apps in 2000, with Apache and IIS plugins written in C and C++ plus some scripting language like Tcl, but I wouldn't do it today, besides providing Web UI for IoT devices.
- GordonS 6y agoI was there :) I have memories of writing CGI apps, and it's not something I'd relish a return to.
- kroltan 6y agoThe qualms you describe are with static typing, not necessarily low-level languages. 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.
- deleted 6y ago[deleted]