7 ms·
Funny, I actually view it as the opposite. swc is distributed via npm as a native extension, so you need to have the right rust version installed in order for i
by alangpierce 8y ago
Funny, I actually view it as the opposite. swc is distributed via npm as a native extension, so you need to have the right rust version installed in order for it to work. I tried `yarn add --dev swc` like in the instructions, but it failed. I already had rust installed but I guess it wasn't the right rust. I'd be hesitant to tell my team to use it because of the extra dev environment setup.
JS is a universal binary format that tends to just work from my experience. You do occasionally run into issues if you're on an old node version, but other than that it has been pretty reliable for me. But it may just be a difference in familiarity.
- steveklabnik 8y agoThis is one area where wasm may shine; you can distribute it pre-compiled, nobody using JS needs a rust toolchain installed. This is something the webpack team has indicated interest in, for example. Of course, wasm will need threading first for this project.
- jahewson 8y agoOoh I like it - yet another reason to get excited about wasm, thanks Steve!
- ori_b 8y agoHow do you verify that the distribution matches the source?
- steveklabnik 8y agoThe same way you would with anything else.
- ori_b 8y agoI do it by downloading it and building it myself, or trusting a large beaurocracy running the project to audit the source and produce signed packages, on behalf of the third party developers. Debian style. So, is npm getting a wasm build infrastructure to support this?
- steveklabnik 8y agoIt doesn't need any; you build it locally, and then put the wasm in the package when you publish.
- ori_b 8y agoThat makes auditing that the wasm matches the code pretty hard. (It's also a problem with adding minified JS). Auditing just the code is hard enough as is. :(
- PascalW 8y agoTypically Rust programs are distributed in pre-compiled form so you don't have to have a Rust compiler installed. I'm not sure why this project ships source code currently, but it could probably ship binaries too.
- nicoburns 8y agoApparently that's what the author is currently working on: https://www.reddit.com/r/rust/comments/a8i3sd/v100alpha_release_of_swc_superfast_alternative/ecb68ey/ https://www.reddit.com/r/rust/comments/a8i3sd/v100alpha_rele...
- zmw 8y agoYou mean typically “available” in pre-compiled form, right? Because Rust doesn’t have a binary distribution system per se, it is at the mercy of package managers to build and distribute binaries, or maintainers need to upload build artifacts to, say, GitHub releases (and installation process would be nonstandard as a result). I get most of my Rust binaries through cargo when on Ubuntu, except in a few cases when I really want rg (still not available in Ubuntu 18.04) but don’t want to waste 25% storage on the Rust tool chain.