Hacker GitHub

← All repos

alangpierce/sucrase

View on GitHub ↗ ★ 5,875 TypeScript

Super-fast alternative to Babel for when you can target modern JS runtimes

34 mentions on Hacker News by 20 people: 3 stories, 31 comments · first 2017-12-29 · latest 2025-07-25

Mentions per year 34 mentions · busiest year 2021 (11)
20082026
  1. …sucrase seems to be no longer maintained. [1]: https://github.com/altbdoor/sucrase-build-iife [2]: https://github.com/alangpierce/sucrase
  2. …JS runtime boundary. SWC abandoned plugins in JS for this reason. The dirty secret is, as Sucrase ( https://github.com/alangpierce/sucrase ) reveals, just that Babel is slow and the codebase really pays homage to the project name. Simply…
  3. …an easier way for users to do this (though I don't know if they want that as core functionality). https://github.com/alangpierce/sucrase/issues/730 JS JIT creators don't get enough credit for their string implementations. Not much comes…
  4. …than SWC and esbuild in single-threaded performance and something like 20x faster than babel. https://github.com/alangpierce/sucrase The real issue isn't JS, but is the lack of profiling (as shown here) combined with wanting to be…
  5. …to run all tools in parallel, which should be more convincing despite the added variability: https://github.com/alangpierce/sucrase/issues/730 . In an ideal environment, the results are pretty much the same as a per-core benchmark, but I…
  6. Yes, you technically can write high-perf JavaScript code... https://github.com/alangpierce/sucrase/blob/153fa5bf7603b9a5... But freaking SIGH I don't want to. I prefer coding in environments that don't require unrolling loops by hand.
  7. but the benchmark is stupid: https://github.com/alangpierce/sucrase/blob/main/benchmark/b... > Like all JavaScript code run in V8, Sucrase runs more slowly at first, then gets faster as the just-in-time compiler applies more optimizations.…
  8. Sucrase is written in JS and boasts the highest line throughput of any competing transpiler https://github.com/alangpierce/sucrase Time Speed Sucrase 0.57 seconds 636975 lines per second swc 1.19 seconds 304526 lines per second esbuild…
  9. Sucrase is faster or really close to SWC (see rhe benchmarks https://github.com/alangpierce/sucrase ). Everyone still uses Babel because of the transforms. And yes, Babel can also be made faster if enough effort is dedicated into it. it's…
  10. …compared to sucrase (written in JS, currently faster than SWC and esbuild but doing somewhat less - https://github.com/alangpierce/sucrase ) tsc has in fact been designed with speed in mind (I've been following the project since before it…
  11. That's basically what Sucrase.js is: https://github.com/alangpierce/sucrase
    comment by acemarke · 2021-10-26 · in Next.js 12
  12. …allow this makes JS transpilers look much worse than they actually are in real-world projects. https://github.com/alangpierce/sucrase https://github.com/alangpierce/sucrase/blob/main/benchmark/b...
  13. …Rust https://swc.rs/ But there is also sucrase which is fast because.. its written in TypeScript? https://github.com/alangpierce/sucrase
  14. …depending on how you manipulate them). These caveats are not reflected in Sucrase's benchmark. [0] https://github.com/alangpierce/sucrase#motivation
    comment by lhorie · 2021-05-04 · in Announcing Rome Tools, Inc.
  15. …(written in TypeScript) has done a great job of being in the same ordinal of perf as esbuild: https://github.com/alangpierce/sucrase#sucrase
    comment by orta · 2021-05-04 · in Announcing Rome Tools, Inc.
  16. …you need tramspiling for, you might want to look at Sucrase [1] as a fast alternative to Babel. https://github.com/alangpierce/sucrase
    comment by inbx0 · 2021-04-28 · in Why we switched from Webpack to Vite
  17. The non-Twitter link: https://github.com/alangpierce/sucrase#readme
  18. …files as objects during development, and compiling them into one big binary for production. [0]: https://github.com/alangpierce/sucrase
    comment by crazypython · 2021-02-16 · in Why Is Esbuild Fast?
  19. …that loads it directly from the filesystem, using a single-pass annotation remover such as https://github.com/alangpierce/sucrase A single-pass transpiler doesn't build an AST, instead just looping over everything once, which will surely…
    comment by crazypython · 2021-02-16 · in Why Is Esbuild Fast?
  20. …but retain type checking when you do a full build. EDIT: Sucrase! That’s what I was thinking of: https://github.com/alangpierce/sucrase#transforms
  21. I think that’s the point. No plugin system. Compare Babel to Bublé or even Sucrase for example: https://github.com/alangpierce/sucrase Preparing data for external use always takes extra effort. You can build an efficient self-contained…
    comment by turnipla · 2020-04-23 · in Incremental Builds in Gatsby Cloud
  22. …/github.com/gristlabs/ts-interface-builder https://github.com/gristlabs/ts-interface-checker Example: https://github.com/alangpierce/sucrase/pull/468/files
  23. …computations and often slower than JS when V8 is given multiple seconds to fully warm up the JIT: https://github.com/alangpierce/sucrase/issues/216 So really, it depends a lot on the use case. In my case, it's often a short-lived node…
    comment by alangpierce · 2019-02-15 · in Replacing JavaScript Hot Path with WebAssembly
  24. I'd love to see Sucrase ( https://github.com/alangpierce/sucrase ) included in the performance comparison.
  25. For those worried about compile time for large projects, tools like https://github.com/alangpierce/sucrase can go a long way for the transpilation (remove types), while you can use the TypeScript compiler in parallel only for the type…
    comment by kiliancs · 2019-01-25 · in The TypeScript Tax
  26. Yep! Issue (already linked above): https://github.com/alangpierce/sucrase/issues/216 Most recent prototype branch (doesn't include some patches to AssemblyScript to get it working): https://github.com/alangpierce/sucrase/commits/assemblyscr…
  27. I've been working on a very similar tool, interesting to see some competition. :-) https://github.com/alangpierce/sucrase In my case, it's still running as JS, but rearchitected to solve the more straightforward problem where you don't…
  28. …and doing other nontrivial transformations. Regarding Browserify support, PRs are welcome. :-) https://github.com/alangpierce/sucrase/tree/master/integrati...
  29. See https://github.com/alangpierce/sucrase/issues/216 for some investigation I did into webassembly. V8 seems to be pretty good at optimizing your JS code if you give it long enough and write relatively C-like JavaScript in the first…
  30. Is there a good way to use this from Webpack? Edit: https://github.com/alangpierce/sucrase/blob/master/integrati...
  31. …problem here. I've actually been hacking on a faster alternative to babel/tsc for simple use cases: https://github.com/alangpierce/sucrase . It has a built-in benchmark (`yarn run benchmark`) with at least one example of where typescript…
    comment by alangpierce · 2017-12-29 · in Nearing the Babel 7.0 Release