The JavaScript Oxidation Compiler(oxc.rs)
112 points bymodinfo4 hours ago |14 comments
pier252 hours ago
All the Void Zero projects are super cool although I still wonder how they’re going to monetize all this.
rk062 hours ago
they are going to use vite plus for monetization
wangzhongwang1 hour ago
Interesting to see more Rust-based JS tooling. The performance gains are real but I'm curious about the ecosystem compatibility - does it handle all the weird edge cases that existing tools have learned over the years?

Also wondering if this could eventually replace parts of the webpack/vite pipeline or if it's more focused on the compilation step.

VPenkov30 minutes ago
Oxc is not the first Rust-based product on the market that handles JS, there is also SWC which is now reasonably mature. I maintain a reasonably large frontend project (in the 10s of thousands of components) and SWC has been our default for years. SWC has made sure that there is actually a very decent support for JS in the Rust ecosystem.

I'd say my biggest concern is that the same engineers who use JS as their main language are usually not as adept with Rust and may experience difficulties maintaining and extending their toolchain, e.g. writing custom linting rules. But most engineers seem to be interested in learning so I haven't seen my concern materialize.

silverwind3 minutes ago
Depends on how conservative their minifier is. The more aggressive, the more likely bugs are. esbuild still hits minifier bugs regularily.
chronicom39 minutes ago
The goal is for Vite to transition to tooling built on Oxc. They’ve been experimenting with Rolldown for a while now (also by voidzero and uses oxc) - https://vite.dev/guide/rolldown
galaxyLogic24 minutes ago
Does oxc-parser make it easy to remove comments from JavaScript?

In other words does it treat comments as syntactic units, or as something that can be ignored wince they are not needed by the "next stage"?

The reason to find out what the comments are is of course to make it easy to remove them.

root_axis2 hours ago
I'm surprised to see it's that much faster than SWC. Does anyone have any general details on how that performance is achieved?
ameliaquining1 hour ago
They wrote a post (https://oxc.rs/docs/learn/performance) but it doesn't include direct comparisons to SWC.
syspec1 hour ago
Their main page says 3x fast than SWC
ameliaquining27 minutes ago
Yeah, but not how their implementation techniques differ from SWC's to produce those results.
apatheticonion1 hour ago
I wrote a simple multi threaded transpiler to transpile TypeScript to JavaScript using oxc in Rust. It could transpile 100k files in 3 seconds.

It's blisteringly fast

iberator36 minutes ago
sounds impossible to even index and classify files so fast. What hardware?
ido9 minutes ago
I’m assuming they meant 100kloc rather than 100,000 files of arbitrary size (how could we even tell how impressive that is without knowing how big the files are?)
hu344 minutes ago
I expected a coparison to `bun build` in the transformer TS -> JS part.

But I guess it wouldn't be an apples to apples com parison because Bun can also run typescript directly.

Jarred4 minutes ago
You can find a comparison with `bun build` on Bun's homepage. It hasn't been updated in a little while, but I haven't heard that the relative difference between Bun and Rolldown has changed much in the time since (both have gotten faster).

In text form:

Bundling 10,000 React components (Linux x64, Hetzner)

  Bundler                    Version                  Time
  ─────────────────────────────────────────────────────────
  Bun                        v1.3.0               269.1 ms
  Rolldown                   v1.0.0-beta.42       494.9 ms
  esbuild                    v0.25.10             571.9 ms
  Farm                       v1.0.5             1,608.0 ms
  Rspack                     v1.5.8             2,137.0 ms
sankalpmukim2 hours ago
I wonder why did it take so long for someone to make something(s) this fast when this much performance was always available on the table. Crazy accomplishment!
chrysoprace51 minutes ago
I believe it goes back a few years to originally being just oxlint, and then recently Void Zero was created to fund the project. One of the big obstacles I can imagine is that it needs extensive plugin support to support all the modern flavours of TypeScript like React, Vue, Svelte, and backwards compatibility with old linting rules (in the case of oxlint, as opposed to oxc which I imagine was a by-product).
WD-421 hour ago
Because Rust makes developers excited in a way that C/C++ just doesn't.
nullsanity47 minutes ago
It takes a good programmer to write it, and most good programmers avoid JavaScript, unless forced to use it for their day job. in that case, there is no incentive to speed up the part of the job that isn't writing JavaScript.
RealityVoid20 minutes ago
For the love of god, please stop naming Rust projects with "corrosion" and "oxidation" and the cute word pwns related to Rust because they are currently overplayed.
zdw2 hours ago
This compiles to native binaries, as opposed to deno which is also in rust but is more an interpreter for sandboxed environments?
38362936481 hour ago
Deno is a native implementation of a standard library, it doesn't have language implementation of its own, it just bundles the one from Safari (javascriptcore).

This is a set of linting tools and a typestripper, a program that removes the type annotations from typescript to make turn it into pure javascript (and turn JSX into document.whateverMakeElement calls). It still doesn't have anything to actually run the program.

ameliaquining1 hour ago
Deno uses V8, which is from Chrome. Bun uses JavaScriptCore.
ameliaquining1 hour ago
Oxc is not a JavaScript runtime environment; it's a collection of build tools for JavaScript. The tools output JavaScript code, not native binaries. You separately need a runtime environment like Deno (or a browser, depending on what kind of code it is) to actually run that code.
nine_k1 hour ago
No, it it a suite of tools to handle Typescript (and Javascript as its subset). So far it's a parser, a tool to strip Typescript declarations and produce JS (like SWC), a linter, and a set of code transformation tools / interfaces, as much as I can tell.
latchkey1 hour ago
I've played with all of these various formatters/linters in my workflow. I tend to save often and then have them format my code as I type.

I hate to say it, but biome just works better for me. I found the ox stuff to do weird things to my code when it was in weird edge case states as I was writing it. I'd move something around partially correct, hit save to format it and then it would make everything weird. biome isn't perfect, but has fewer of those issues. I suspect that it is hard to even test for this because it is mostly unintended side effects.

ultracite makes it easy to try these projects out and switch between them.

sneak52 minutes ago
Thought this was something related to Oxide Computer - they might want to be careful with that branding.
robofanatic1 hour ago
oxidation is a chemical process where a substance loses electrons, often by reacting with oxygen, causing it to change. What does it have to do with JavaScript?
nine_k1 hour ago
Oxidation of iron produces rust. Rust is the language of implementation of that compiler, and of the entire Oxc suite.
ayhanfuat1 hour ago
It is written in Rust…