Hacker News new | ask | show | jobs
by tomphoolery 606 days ago
> SWC was one of the earlier Rust builders, which then became absorbed into Vercel and turned into Turbopack (is my understanding)

SWC and Turbopack aren't related in the sense that one is the "successor" of the other. They both do different things, and compliment each other. SWC is more lower-level, it's a compiler for JS (and other web tools) that converts your syntax into something any browser can understand. Turbopack is a bundler, it takes that compiled code and minifies/concatenates it together in various ways so it can be distributed to a browser efficiently. I believe Turbopack does in fact use SWC (if you're using Next that is) to do the "dirty" work of compiling TypeScript code into JavaScript quickly, but its main feature is the use of the Turbo engine to cache function calls at a very low level. From what I read, Turbopack's potential to make building JS apps incredibly efficient should be a really neat thing to work with in the future!

1 comments

Ah gotcha, yeah I was always a bit confused about the whole thing but that makes sense. I've only used SWC directly as a WASM bundle to do in-browser realtime compilation and analysis of .tsx files, which works great, but that was pre-Vercel times when only 강동윤 was working on it.