3 ms·
I've also tried to naively improve a node build process and given up after realizing that, for the particular project I was working on, splitting up the build i
by chickenfries 9y ago
I've also tried to naively improve a node build process and given up after realizing that, for the particular project I was working on, splitting up the build into multiple processes actually slowed things down compared to the single threaded build process
Node's single threaded event loop works well for some use cases but makes it hard to parallelize build process.
I would absolutely use a module bundler developed in a better suited language and distributed on npm as a binary like flow.
- thangngoc89 9y agoThen you should consider fastpack. It’s written in OCaml and use Flow parser. Also, it should be distributed as a binary Fastpack: https://github.com/fastpack/fastpack https://github.com/fastpack/fastpack
- beckler 9y agoI would also consider bazel. https://bazel.build https://bazel.build
- lambdadmitry 9y agoHave you tried it to build web projects? Unfortunately there are very few experience reports out there.
- chrismorgan 9y agoI’ve thought in concrete terms about porting postcss to Rust before. It’s the sort of tool that is stuck with slow while it’s in JavaScript, but could be amazingly fast in Rust, for which it’s a really good match (especially algebraic data types). (Seriously, the sort of thing that typically takes a second or so in JavaScript with things like postcss I would expect to take under five milliseconds in well-written Rust, and under a hundred in badly-written Rust.) The real problem with all these sorts of things is network effects. People aren’t going to use the Rust port of postcss unless the plugin they want to use works in it, and it can be conveniently tied into their existing toolchain, and—— and—— This is why we can’t have fast, efficient things. I’m really looking forward to getting something of the pthread style in WebAssembly, because then, finally, blending the two should be easily feasible. You can already use things like Neon (https://www.neon-bindings.com https://www.neon-bindings.com) to write Node modules in Rust, but it’s not as easy as it should eventually be a few years down the track.
- chickenfries 9y ago> The real problem with all these sorts of things is network effects. People aren’t going to use the Rust port of postcss unless the plugin they want to use works in it, and it can be conveniently tied into their existing toolchain, and—— and—— I've never used postcss, but I don't think this is strictly for all js build tools. There's libsass, written in C++. I've mentioned flow. I'm sure there are others. I think you're right though that webassembly is going to be big for this kind of thing.