Live data from Hacker News

The JavaScript Oxidation Compiler

oxc.rs

41–50 of 147 posts

Re: The JavaScript Oxidation Compiler

#43
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.

Re: The JavaScript Oxidation Compiler

#45

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!

For a couple of reasons:

* You need have a clean architecture, so starting "almost from scratch" * Knowledge about performance (for Rust and for build tools in general) is necessary * Enough reason to do so, lack of perf in competition and users feeling friction * Time and money (still have to pay bills, right?)

Re: The JavaScript Oxidation Compiler

#46

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

sounds impossible to even index and classify files so fast. What hardware?

Let's say 100k files is 300k syscalls, at ~1-2us per syscall. That's 300ms of syscalls. Then assume 10kb per file, that's 1GB of file, easily done in a fraction of a second when the cache is warm (it'll be from scanning the dir). That's like 600ms used up and plenty left to just parse and analyze 100k things in 2s.

Re: The JavaScript Oxidation Compiler

#47
post #20

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!

Because Rust makes developers excited in a way that C/C++ just doesn't.

C++ is pure trash

C is fine but old

Re: The JavaScript Oxidation Compiler

#48
post #20

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!

Because Rust makes developers excited in a way that C/C++ just doesn't.

Yeah, it is as if there were never other compiled languages before to rewrite JavaScripting tooling.

Re: The JavaScript Oxidation Compiler

#49

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!

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.

Some of us, already have all the speed we need with Java and .NET tooling, don't waste our time rewriting stuff, nor need to bother with borrow checker, even if it isn't a big deal to write affine types compliant code.

And we can always reach out to Scala or F# if feeling creating to play with type systems.

Re: The JavaScript Oxidation Compiler

#50

Earlier quoted context omitted.

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 prog…

I'm going to call it: a Rust implementation of JavaScript runtime (and TypeScript compiler) will eventually overtake the official TypeScript compiler now being rewritten in Go.

? Most JavaScript runtimes are already C++ and are already very fast. What would rewriting in Rust get us?
Post reply on HN