19 comments

  • owickstrom5 hours ago
    I&#x27;m using oxc_traverse and friends to implement on-the-fly JS instrumentation for <a href="https:&#x2F;&#x2F;github.com&#x2F;antithesishq&#x2F;bombadil" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;antithesishq&#x2F;bombadil</a> 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.
  • philippta3 hours ago
    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.<p>Not to discredit OP&#x27;s work of course.
    • wiseowise3 hours ago
      People shaving off the last milliseconds or microseconds in their tooling aren&#x27;t the same people shipping slow code to browsers. Say thanks to POs, PMs, stakeholders, etc.
      • littlestymaar2 hours ago
        Sometimes they are the same person.<p>It just take someone to have poor empathy towards your users to ship slow software that you don&#x27;t use.
        • wiseowise1 hour ago
          I&#x27;ve never met a single person obsessed with performance who goes half the way. You either have a performance junkie or a slob who will be fine with 20 minutes compile times.
          • littlestymaar5 minutes ago
            I have. They cared a lot about performance <i>for them</i> because they hated waiting, but gave literally no shit about anyone else.
  • Grom_PE3 hours ago
    I thought oxfmt would just be a faster drop-in replacement for &quot;biome format&quot;... It wasn&#x27;t.<p>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.<p>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&amp;R style.
    • tomashubelbauer3 hours ago
      &gt; running oxfmt without any arguments recursively scans directory tree from the current directory for all <i>.js and </i>.ts files and silently reformats them<p>I&#x27;ve got to say this is what I would have expected and wanted to happen. I&#x27;d say it is wise to not run tools designed to edit files on files you don&#x27;t have a backup for (like Git) without doing a dry-run or a small scope experiment first.
      • vladvasiliu2 hours ago
        While I can get behind things such as &quot;use version control,&quot; &quot;use backups&quot;, etc. this is definitely <i>not</i> what I&#x27;d expect from a program run without arguments, especially when it will go and change stuff.
    • nindalf2 hours ago
      &gt; with no option to format them back<p>Try git reset --hard, that should work.
    • jagged-chisel3 hours ago
      These files are under version control, right? Or backed up. Right?
    • Sammi2 hours ago
      This is user error. oxfmt did what you asked it to do.
      • rk062 hours ago
        I don&#x27;t think so. If someone runs a tool without args, the tool should do equivalent of &quot;tool --help&quot;<p>It is bad ux.
        • Sammi2 hours ago
          I expect a file formatter to format the files when I call it. Anything else would be surprising to me.
          • rk061 hour ago
            a new user should not expected to know whether to use &quot;--info&quot;, &quot;--help&quot;, or &quot;-info&quot; or &quot;&#x2F;info&quot;<p>A power user can just pass the right params. Besides, it is not that hard to support &quot;--yolo&quot; parameter for that use case
            • xigoi1 hour ago
              Would you enjoy writing `rm --yolo file` instead of `rm file` every time?
              • user39393821 hour ago
                Not taking a position but the design of rm strengthens the position that recursive by default without flags isn’t ok. rm makes you confirm when you want changes to recurse dirs.
    • monster_truck1 hour ago
      You couldn&#x27;t waterboard this outta me
    • ramon1563 hours ago
      Do you not use a VCS?
    • phplovesong3 hours ago
      Git undo?
  • pier258 hours ago
    All the Void Zero projects are super cool although I still wonder how they’re going to monetize all this.
    • rk068 hours ago
      they are going to use vite plus for monetization
      • pier252 minutes ago
        Yes but is that going to be enough?<p>Doesn’t look super interesting to me tbh.
      • conartist63 hours ago
        The vite plus idea is that you&#x27;ll pay for visual tools. What&#x27;s odd to me is it makes their paid product kind of a bet against their open product. If their open platform were as powerful as it should be, it would be easy to use it to recreate the kinds of experiences they propose to sell.<p>The paradox gains another layer when you consider that their whole mission is to build tools for the JavaScript ecosystem, yet by moving to Rust they are betting that JS-the-language is so broken that it cannot even host its own tools. And because JS is still a stronger language for building UIs in than Rust, their business strategy now makes them hard-committed to their bet that JS tools in JS are a dead end.
        • nindalf2 hours ago
          &gt; it cannot even host its own tools<p>You say this like this is the basic requirement for a language. But languages make tradeoffs that make them more appropriate for some domains and not others. There&#x27;s no shade if a language isn&#x27;t ideal for developer tools, just like there&#x27;s no shade if a language isn&#x27;t perfect for web frontends, web backends, embedded development, safety critical code (think pacemakers), mobile development, neural networks and on and on.<p>Seriously, go to <a href="https:&#x2F;&#x2F;astral.sh" rel="nofollow">https:&#x2F;&#x2F;astral.sh</a> and scroll down to &quot;Linting the CPython code base from scratch&quot;. It would be easy to look at that and conclude that Python&#x27;s best days are behind it because it&#x27;s so slow. In reality Python is an even better language at its core domains now that its developer tools have been rewritten in Rust. It&#x27;s the same excellent language, but now developers can iterate faster.<p>It&#x27;s the same with JavaScript. Just because it&#x27;s not the best language for linters and formatters doesn&#x27;t mean it&#x27;s broken.
        • panstromek1 hour ago
          I don&#x27;t see the idea is visual tools, I never even heard somebody to talk about it like that. The plan is to target enterprise customers with advanced features. I feel like you should just go and watch some interviews or something where talk about their plan, Evan You was recently on a few podcasts mentioning their plans.<p>Also, the paradox is not really even there. JS ecosystem largely gave up on JS tools long time ago already. Pretty much all major build tools are migrating to native or already migrated, at least partially. This has been going on for last 4 years or something.<p>But the key to all of this is that most of these tools are still supporting JS plugins. Rolldown&#x2F;Vite is compatible with Rollup JS plugins and OXLint has ESLint compatible API (it&#x27;s in preview atm). So it&#x27;s not really even a bet at all.
        • rk063 hours ago
          &gt; they are betting that JS-the-language is so broken that it cannot even host its own tools.<p>Evan wallace proved it by building esbuild. this is no longer bet.<p>&gt; If their open platform were as powerful as it should be, it would be easy to use it to recreate the kinds of experiences they propose to sell.<p>you would be surprised to know that tech companies may find it cheaper to pay money than developer bandwidth for stuff beyong their core compentency.<p>dropbox was also considered to be trivially implementable, but end users rarely try to re-invent it.
          • lioeters3 hours ago
            &gt; esbuild<p>Another example is the TypeScript compiler being rewritten in Go instead of self-hosting. It&#x27;s an admission that the language is not performant enough, and more, it can <i>never</i> be enough for building its own tooling. It might be that the tooling situation is the problem, not the language itself, though. I do see hopeful signs that JavaScript ecosystem is continuing to evolve, like the recent release of MicroQuickJS by Bellard, or Bun which is fast(er) and really fun to use.
            • MrJohz1 hour ago
              I don&#x27;t think that&#x27;s necessarily a bad thing, though. JavaScript isn&#x27;t performant enough for its own tooling, but that&#x27;s just one class of program that can be written. There are plenty of other classes of program where JavaScript is perfectly fast enough, and the ease of e.g. writing plugins or having a fast feedback loop outweighs the benefits of other languages.<p>I quite like Roc&#x27;s philosophy here: <a href="https:&#x2F;&#x2F;www.roc-lang.org&#x2F;faq#self-hosted-compiler" rel="nofollow">https:&#x2F;&#x2F;www.roc-lang.org&#x2F;faq#self-hosted-compiler</a>. The developers of the language want to build a language that has a high performance compiler, but they don&#x27;t want to build a language that one would use to build a high performance compiler (because that imposes a whole bunch of constraints when it comes to things like handling memory). In my head, JavaScript is very similar. If you need a high performance compiler, maybe look elsewhere? If you need the sort of fast development loop you can get by having a high performance compiler, then JS is just the right thing.
              • lioeters43 minutes ago
                True, I agree. It&#x27;s a good thing to accept a language&#x27;s limitations and areas of suitability, without any judgement about whether the language is good for <i>all</i> purposes - which is likely not a good goal for a language to have anyway. I like that example of Roc, how it&#x27;s explicitly planned to be <i>not</i> self-hosting. It makes sense to use different languages to suit the context, as all tools have particular strengths and weaknesses.<p>Off topic but I wonder if this applies to human languages, whether some are more suited for particular purposes - like German to express rigorous scientific thinking with compound words created just-in-time; Spanish for romantic lyrical situations; or Chinese for dense ideographs. People say languages can expand or limit not only what you can express but what you can think. That&#x27;s certainly true of programming languages.
    • shawn_w5 hours ago
      Why should it be monetized?
      • pier253 minutes ago
        It’s a private company with VC money.
      • leosanchez5 hours ago
        IIRC they tool VC money
    • hiuioejfjkf5 hours ago
      attention is money
      • carlos224 hours ago
        in the beginning yes, but VCs want to cash out eventually. Look at mongodb, redis and whatnot that did everything to get money at a certain point. For VCs open source is a vehicle to get relevant in a space you would never be relevant if you won&#x27;t do open source.
  • apatheticonion7 hours 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.<p>It&#x27;s blisteringly fast
    • iberator6 hours ago
      sounds impossible to even index and classify files so fast. What hardware?
      • AYBABTME5 hours ago
        Let&#x27;s say 100k files is 300k syscalls, at ~1-2us per syscall. That&#x27;s 300ms of syscalls. Then assume 10kb per file, that&#x27;s 1GB of file, easily done in a fraction of a second when the cache is warm (it&#x27;ll be from scanning the dir). That&#x27;s like 600ms used up and plenty left to just parse and analyze 100k things in 2s.
      • ido6 hours 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?)
  • root_axis8 hours ago
    I&#x27;m surprised to see it&#x27;s that much faster than SWC. Does anyone have any general details on how that performance is achieved?
    • snowhale6 minutes ago
      arena allocation is a big part of it, but also oxc benefits from not having to support the same breadth of legacy transforms that swc accumulated over time. swc has a lot of surface area from being the go-to babel replacement -- oxc could design the AST shape from scratch with allocation patterns in mind. the self-hosting trap (writing js tooling in js) set a performance ceiling for so long that when you finally drop down to Rust and rethink the data layout, the gains feel almost unfair
    • grabshot_dev2 hours ago
      One thing worth noting: beyond raw parse speed, oxc&#x27;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&#x27;re doing multiple passes (lint + transform + codegen) on the same file because you avoid a ton of intermediate allocations.<p>We switched a CI pipeline from babel to SWC last year and got roughly 8x improvement. Tried oxc&#x27;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.
    • ameliaquining7 hours ago
      They wrote a post (<a href="https:&#x2F;&#x2F;oxc.rs&#x2F;docs&#x2F;learn&#x2F;performance" rel="nofollow">https:&#x2F;&#x2F;oxc.rs&#x2F;docs&#x2F;learn&#x2F;performance</a>) but it doesn&#x27;t include direct comparisons to SWC.
      • syspec7 hours ago
        Their main page says 3x fast than SWC
        • ameliaquining6 hours ago
          Yeah, but not how their implementation techniques differ from SWC&#x27;s to produce those results.
  • sankalpmukim8 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!
    • WD-427 hours ago
      Because Rust makes developers excited in a way that C&#x2F;C++ just doesn&#x27;t.
      • pjmlp5 hours ago
        Yeah, it is as if there were never other compiled languages before to rewrite JavaScripting tooling.
        • dwattttt4 hours ago
          The word &#x27;excited&#x27; in GP&#x27;s post isn&#x27;t decorative.
          • pjmlp4 hours ago
            I am fully aware of it, there have been many &#x27;excited&#x27; posts in HN history about various programming languages, with related rewrite X in Y, the remark still stands.
      • grougnax5 hours ago
        C++ is pure trash<p>C is fine but old
        • phplovesong3 hours ago
          You dont need C(++) for building performant software.
      • phplovesong3 hours ago
        We had many languages that are faster that are not c&#x2F;c++.<p>Compare Go (esbuild) to webpack (JS), its over 100x faster easily.<p>For a dev time matters, but is relative, waiting 50sec for a webpack build compared to 50ms with a Go toolchain is life changing.<p>But for a dev waiting 50ms or 20ms does not matter. At all.<p>So the conclusion is javascript devs like hype, and flooded Rust and built tooling for JS in Rust. They could have used any other compiled languge and get near the same peformance computer-time-wise, or the exact same time human-timewise.
        • wiseowise3 hours ago
          &gt; But for a dev waiting 50ms or 20ms does not matter. At all.<p>It absolutely does:<p><a href="https:&#x2F;&#x2F;mail.python.org&#x2F;pipermail&#x2F;python-dev&#x2F;2018-May&#x2F;153296.html" rel="nofollow">https:&#x2F;&#x2F;mail.python.org&#x2F;pipermail&#x2F;python-dev&#x2F;2018-May&#x2F;153296...</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16978932">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16978932</a>.
          • pjmlp58 minutes ago
            To win benchmark games it does, in a world where people keep shipping Electron crap, not really.
        • pjmlp57 minutes ago
          No worries, when Zig hits 1.0, the RIZ projects from JavaScript, Python and Ruby tooling will start hitting HN frontpage.
    • chrysoprace6 hours 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).
    • TheAlexLichter5 hours ago
      For a couple of reasons:<p>* You need have a clean architecture, so starting &quot;almost from scratch&quot; * 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?)
    • throw567643u84 hours ago
      Fractured ecosystem. Low barrier to entry, so loads of tooling.
    • nullsanity6 hours 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&#x27;t writing JavaScript.
      • pjmlp5 hours ago
        Some of us, already have all the speed we need with Java and .NET tooling, don&#x27;t waste our time rewriting stuff, nor need to bother with borrow checker, even if it isn&#x27;t a big deal to write affine types compliant code.<p>And we can always reach out to Scala or F# if feeling creating to play with type systems.
      • wiseowise3 hours ago
        &gt; It takes a good programmer to write it, and most good programmers avoid JavaScript, unless forced to use it for their day job.<p>Nonsense.
  • galaxyLogic6 hours ago
    Does oxc-parser make it easy to remove comments from JavaScript?<p>In other words does it treat comments as syntactic units, or as something that can be ignored wince they are not needed by the &quot;next stage&quot;?<p>The reason to find out what the comments are is of course to make it easy to remove them.
    • xixixao6 hours ago
      Should be easy with any standard parser. See astexplorer.net
  • wiseowise3 hours ago
    So uv for JavaScript? Nice.
    • silverwind2 hours ago
      No, that would probably be pnpm, even thought it&#x27;s not nearly as fast because it&#x27;s written in JS.
      • yla922 hours ago
        I thought it&#x27;s mainly written in Rust <a href="https:&#x2F;&#x2F;github.com&#x2F;oxc-project&#x2F;oxc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oxc-project&#x2F;oxc</a> . Which oxc project is written in JS ?
        • littlestymaar2 hours ago
          They are talking about pnpm (which they said would be the uv equivalent for node, though I disagree given that what pnpm brings on top of npm is way less than the difference between uv and the status quo in Python).
  • hu36 hours ago
    I expected a coparison to `bun build` in the transformer TS -&gt; JS part.<p>But I guess it wouldn&#x27;t be an apples to apples com parison because Bun can also run typescript directly.
    • Jarred6 hours ago
      You can find a comparison with `bun build` on Bun&#x27;s homepage. It hasn&#x27;t been updated in a little while, but I haven&#x27;t heard that the relative difference between Bun and Rolldown has changed much in the time since (both have gotten faster).<p>In text form:<p>Bundling 10,000 React components (Linux x64, Hetzner)<p><pre><code> 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</code></pre>
  • zdw8 hours ago
    This compiles to native binaries, as opposed to deno which is also in rust but is more an interpreter for sandboxed environments?
    • ameliaquining7 hours ago
      Oxc is not a JavaScript runtime environment; it&#x27;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.
    • jeswin2 hours ago
      If you want native binaries from typescript, check my project: <a href="https:&#x2F;&#x2F;tsonic.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tsonic.org&#x2F;</a><p>Currently it uses .Net and NativeAOT, but adding support for the Rust backend&#x2F;ecosystem over the next couple of months. TypeScript for GPU kernels, soon. :)
    • 38362936487 hours ago
      Deno is a native implementation of a standard library, it doesn&#x27;t have language implementation of its own, it just bundles the one from Safari (javascriptcore).<p>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&#x27;t have anything to actually run the program.
      • ameliaquining7 hours ago
        Deno uses V8, which is from Chrome. <i>Bun</i> uses JavaScriptCore.
      • lioeters5 hours ago
        I&#x27;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.
        • 38362936481 hour ago
          In popularity or actually take over control of the language?
          • lioeters24 minutes ago
            Eventually I imagine a JS&#x2F;TS runtime written in Rust will be mainstream and what everyone uses.
        • madeofpalk5 hours ago
          ? Most JavaScript runtimes are already C++ and are already <i>very fast</i>. What would rewriting in Rust get us?
          • lioeters3 hours ago
            Nothing, but it will happen anyway. Maybe improved memory safety and security, at least as a plausible excuse to get funding for it. Perhaps also improved enthusiasm of developers, since they seem to enjoy the newness of Rust over working with an existing C++ codebase. Well there are probably many actual advantages to &quot;rewrite it in Rust&quot;. I&#x27;m not in support or against it, just making an observation that the cultural trend seems to be moving that way.
    • nine_k7 hours ago
      No, it it a suite of tools to handle Typescript (and Javascript as its subset). So far it&#x27;s a parser, a tool to strip Typescript declarations and produce JS (like SWC), a linter, and a set of code transformation tools &#x2F; interfaces, as much as I can tell.
  • lerp-io4 hours ago
    whats the point of writing rust memory safe for js if js is already memory safe, ant u just write it in js???
    • throw567643u84 hours ago
      Too slow. Different people implemented linter, bundler, ts compiler in JS. That means three different parsers and ASTs, which is inefficient. These guys want a grand unified compiler to rule them all.
  • sneak6 hours ago
    Thought this was something related to Oxide Computer - they might want to be careful with that branding.
    • swiftcoder5 hours ago
      There are like 50 rust projects named by oxidation puns. This is hardly the first
  • latchkey7 hours ago
    I&#x27;ve played with all of these various formatters&#x2F;linters in my workflow. I tend to save often and then have them format my code as I type.<p>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&#x27;d move something around partially correct, hit save to format it and then it would make everything weird. biome isn&#x27;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.<p>ultracite makes it easy to try these projects out and switch between them.
    • AbuAssar5 hours ago
      oxc formatter is still alpha, give it some time
  • wangzhongwang7 hours ago
    [dead]
    • VPenkov6 hours 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.<p>I&#x27;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&#x27;t seen my concern materialize.
      • saghm4 hours ago
        It&#x27;s not like JS isn&#x27;t already implemented in a language that&#x27;s a lot more similar to Rust anyhow though. When the browser or Node or whatever other runtime you&#x27;re using is already in a different language out of necessity, is it really that weird for the tooling to also optimize for the out-of-the-box experience rather than people hacking on them?<p>Even as someone who writes Rust professionally, I also wouldn&#x27;t necessarily expect every Rust engineer to be super comfortable jumping into the codebase of the compiler or linter or whatever to be able to hack on it easily because there&#x27;s a lot of domain knowledge in compilers and interpreters and language tooling, and most people won&#x27;t end up needing experience with implementing them. Honestly, I&#x27;d be pretty strongly against a project I work on switching to a custom fork of a linting tool because a teammate decided they wanted to add extra rules for it or something, so I don&#x27;t see it as a huge loss that it might end up being something people will need to spend personal time on if they want to explore.
    • chronicom6 hours 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) - <a href="https:&#x2F;&#x2F;vite.dev&#x2F;guide&#x2F;rolldown" rel="nofollow">https:&#x2F;&#x2F;vite.dev&#x2F;guide&#x2F;rolldown</a>
    • silverwind6 hours ago
      Depends on how conservative their minifier is. The more aggressive, the more likely bugs are. esbuild still hits minifier bugs regularily.
      • leptons5 hours ago
        Over-minifying is kind of pointless, just do a basic minify and then gzip and call it a day.
  • Ecko1238 hours ago
    [dead]
  • zenon_paradox10 hours ago
    [dead]
  • RealityVoid6 hours ago
    For the love of god, please stop naming Rust projects with &quot;corrosion&quot; and &quot;oxidation&quot; and the cute word pwns related to Rust because they are currently overplayed.
    • hiuioejfjkf5 hours ago
      what next, stop using py prefix?
      • RealityVoid2 hours ago
        I said nothing about the rs prefix. But making oxide ferrous, Fe203 or whatever your whole shtick tells me nothing about your package and the pwn space is so so so very crowded at this point it just makes for a bad naming scheme.
  • robofanatic7 hours 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_k7 hours ago
      Oxidation of iron produces rust. Rust is the language of implementation of that compiler, and of the entire Oxc suite.
    • ayhanfuat7 hours ago
      It is written in Rust…