28 comments

[ 2.5 ms ] story [ 53.5 ms ] thread
All the Void Zero projects are super cool although I still wonder how they’re going to monetize all this.
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!
I'm surprised to see it's that much faster than SWC. Does anyone have any general details on how that performance is achieved?
One thing worth noting: beyond raw parse speed, oxc's AST is designed to be allocation-friendly with arena allocation. SWC uses a more traditional approach. In practice this means oxc scales better when you're doing multiple passes (lint + transform + codegen) on the same file because you avoid a ton of intermediate allocations.

We switched a CI pipeline from babel to SWC last year and got roughly 8x improvement. Tried oxc's transformer more recently on the same codebase and it shaved off another 30-40% on top of SWC. The wins compound when you have thousands of files and the GC pressure from all those AST nodes starts to matter.

This compiles to native binaries, as opposed to deno which is also in rust but is more an interpreter for sandboxed environments?
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?
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

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.

Thought this was something related to Oxide Computer - they might want to be careful with that branding.
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.

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.

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.
I'm using oxc_traverse and friends to implement on-the-fly JS instrumentation for https://github.com/antithesishq/bombadil and it has been awesome. That in combination with boa_engine lets me build a statically linked executable rather than a hodgepodge of Node tools to shell out to. Respect to the tools that came before but this is way nicer for distribution. Good times for web tech IMO.
whats the point of writing rust memory safe for js if js is already memory safe, ant u just write it in js???
It always comes as a surprise to me how the same group of people who go out of their way to shave off the last milliseconds or microseconds in their tooling care so little about the performance of the code they ship to browsers.

Not to discredit OP's work of course.

TBH I don't know how to do that work. If I'm in the backend it's very easy for me. I can think about allocations, I can think about threading, concurrency, etc, so easily. In browser land I'm probably picking up some confusing framework, I don't have any of the straightforward ways to reason about performance at the language level, etc.

Maybe once day we can use wasm or whatever and I can write fast code for the frontend but not today, and it's a bit unsurprising that others face similar issues.

Also, if I'm building a CLI, maybe I think that 1ms matters. But someone browsing my webpage one time ever? That might matter a lot less to me, you're not "browsing in a hot loop".

I personally met a lot of folks who care about both quite a bit.

But to be fair, besides the usual patterns like tree-shaking and DCE, "runtime performance" is really tricky to measure or optimize for

While using Electron in the process.
I thought oxfmt would just be a faster drop-in replacement for "biome format"... It wasn't.

Let this be a warning: running oxfmt without any arguments recursively scans directory tree from the current directory for all *.js and *.ts files and silently reformats them.

Thanks to that, I got a few of my Allman-formatted JavaScript files I care about messed up with no option to format them back from K&R style.

I assume you mean what’s more properly called Java style [1], where the first curly brace is on the same line as the function declaration (or class declaration, but if you’re using Allman style you’re probably not using classes; no shade, I’m a JS class hater myself) [2] or control statement [3], the elses (etc) are cuddled, and single statement blocks are enclosed in curly braces. Except I also assume that oxfmt’s default indentation is 2 spaces, following Prettier [4], whereas Java style specified 4.

So maybe we should call it JavaScript style? Modern JS style? Do we have a good name for it?

Also, does anyone know when and why “K&R style” [5] started being used to refer to Java style? Meaning K&R statement block style (“Egyptian braces” [6]) being used for all braces and single statement blocks getting treated the same as multi-statement blocks. Setting aside the eternal indentation question.

1: https://en.wikipedia.org/wiki/Indentation_style#Java

2: https://www.oracle.com/java/technologies/javase/codeconventi...

3: https://www.oracle.com/java/technologies/javase/codeconventi...

4: https://prettier.io/docs/options#tab-width

5: https://ia903407.us.archive.org/35/items/the-ansi-c-programm...

6: https://en.wikipedia.org/wiki/Indentation_style#Egyptian_bra...

- seeing this oxlint and oxfmt a lot lately

- how does it compare to biome?

- also biome does all 3 , linting, formatting and sorting, why do you want 3 libraries to do the job biome does alone?