HN in RSCserver-reason-react
top.mdnew.mdbest.mdask.mdshow.mdjobs.md
← Back to stories

Port of the TypeScript compiler, checker and lsp to Rust, by LLM

104 pointsby jcbhmr 17 hours ago196 comments

Discussion

Loading discussion
  • ingen0s · 17 hours ago

    Wait - you spent north of $400,000?

    • colomo · 17 hours ago

      $420,000 worth of tokens, though I'm pretty sure he used subs.

    • spense · 17 hours ago

      > I did over $400,000 in API priced tokens i'd bet this is a few subscriptions over a few months rather than paying directly for tokens.

      • TiredOfLife · 5 hours ago

        This was OpenAI provided unlimited usage for evaluation. The current working version made by Opus was the one that used a couple of 100$ subs

    • hedgehog · 17 hours ago

      Sibling dead comment said it already but that's likely an estimate of what it would cost via API and in practice it was a few hundred or thousand dollars of subscription fees.

    • JacobAsmuth · 16 hours ago

      Most of it was wasted on OpenAI tokens. It actually cost them $24k USD according to the github description.

      • LeFantome · 14 hours ago

        So, you could do it for a couple hundred bucks using DeepSeek.

        • scotty79 · 48 minutes ago

          If DeepSeek was smart enough. There's a huge risk that it isn't since the only model that ultimately succeeded was Opus 5.5 (sol and astra were tried before).

    • sghiassy · 16 hours ago

      Assuming he used $400,000 in tokens, but used subs I wonder how much AI companies lost on this? Edit: not that I’m worried about them, I’m just curious

      • esperent · 16 hours ago

        > I wonder how much AI companies lost on this? Probably zero, or even a profit. The idea that these companies are making a loss on subscriptions is an unsubstantiated HN fallacy. On the contrary, they're probably making a small profit on subscriptions, or at least break even, and absolute bank on API pricing. Anthropic recently reported an 80% gross profit margin, for example. https://www.reuters.com/business/retail-consumer/anthropic-t...

        • adrianvincent · 16 hours ago

          Profitable, if you just ignore how much money they spend

        • janalsncm · 16 hours ago

          Excited for their IPO just to put this to bed, one way or another.

          • rich_sasha · 12 hours ago

            It might, but also might not. I would imagine the economics are genuinely very tangled up even before you start obfuscating it - it’s very hard to fairly allocate fixed costs between training and inference. I think a clearer picture would be from inference-only orgs.

      • MBCook · 16 hours ago

        What are “subs”?

        • sghiassy · 16 hours ago

          Subscription

          • MBCook · 15 hours ago

            So you pay $20/mo, let it run for a long time, then claim you used the equivalent of $1/2 million?

            • scotty79 · 5 hours ago

              I think he has 5-10 of $200 subs, but yes, that's the general idea.

            • sghiassy · 4 hours ago

              Pretend you have an unlimited cell phone plan. Talk on it for hundreds of hours a month for free Then take the minutes you used and compare what it would’ve cost, if you paid by the minute

    • Rapzid · 16 hours ago

      People love to flex by using the API costs for their subscription tokens. I personally find it ridiculous. The cost is what you paid, not what someone else could have paid. Markets and all that. It would be like using spot instances on AWS but flexing by boasting about how much on-demand $$ compute you used.

      • Capricorn2481 · 16 hours ago

        In this case, I think they are just giving you an idea of what it cost to do this. They aren't saying it's prescriptive

        • Rapzid · 15 hours ago

          Except.. It doesn't really give you an idea what it cost? That's not what it cost. How much did it actually cost? Who knows! It's also TheoGG sooooo.. Those influencer instincts tho.

    • aizk · 16 hours ago

      No that's the theoretical token value cost based on chaining multiple 20x subs.

    • woozlewuzzle · 15 hours ago

      I wonder how that cost compares to paying a human programmer to produce the same end result.

    • pebal · 12 hours ago

      An absurd amount. The cost wouldn't exceed $500 under a subscription model.

  • fwlr · 17 hours ago

    # “The Slop Line" Everything below this was written by my LLMs, not me. I really appreciate this convention, thank you.

    • sitzkrieg · 15 hours ago

      imagine if they had the willingness to re-write it for human consumption. might a well delete it

  • DanRosenwasser · 17 hours ago

    TypeScript team member here - this is impressive work, and it's honestly crazy that 3 of these ports have popped up in the last week! I'm currently AFK but we're hoping to learn more and we'll have more to say on this soon.

    • vaughands · 16 hours ago

      Kudos for keeping up! Golang seemed like a very reasonable choice when you ported there originally but the world is changing _fast_.

      • zdragnar · 16 hours ago

        Why do you think Golang is no longer a reasonable choice?

        • lifthrasiir · 16 hours ago

          Presumably because Rust is more suitable than Go in agentic coding? (I'm not sure, but that seems the purported answer.)

          • lifeisloving · 16 hours ago

            Language and compiler design/ implementation is very much a human task. There's lots of nuances to consider. I doubt they want agent spaghetti code in their codebase either.

            • true_religion · 6 hours ago

              I don't know. Many people implementing DSLs were happy to live with whatever lexx and yacc spat out for years.

        • spankalee · 16 hours ago

          Rust is better at targeting WebAssembly

          • teki_one · 16 hours ago

            Why?

            • 0x696C6961 · 16 hours ago

              I think the main advantage is size. Rust doesn't need to include the runtime.

            • cmrdporcupine · 16 hours ago

              I'm assuming they mean because it doesn't need a garbage collector or much of a runtime at all. You can target direct to WASM and use I guess WASI, while Go brings with it a garbage collector and so on.

            • spankalee · 16 hours ago

              Wasm is a first-class target for Rust, which produces faster and smaller Wasm binaries. My understanding is that you need to use TinyGo to reasonably target Wasm with Go. Go having a garbage collector isn't necessarily bad, since Wasm has GC, but I think Go's GC can't easily use Wasm GC because Go has interior pointers.

              • win311fwg · 10 hours ago

                WASM is also a first-class target for Go (gc). However, it has a relatively large runtime, so TinyGo is often preferred when bundle size needs to be small.

                • pjmlp · 4 hours ago

                  With the caveat that Go cannot use WASM GC, because it is still a MVP and it does not support internal pointers, so languages like D, Go and C# have to keep shipping their own implementations.

          • cowsandmilk · 16 hours ago

            why would that be important? Having a typescript compiler in wasm seems like a pretty niche need.

            • viraptor · 13 hours ago

              Theo is making a new twist on the idea of IDE which hosts the application itself. I'm sure there's going to be a video about it soon. But the idea is to embed the whole compilation and type-check in wasm in the browser which then runs the app immediately, as the agents edit the code.

            • pjmlp · 9 hours ago

              Because you need to keep the compiler running here, - https://www.typescriptlang.org - https://code.visualstudio.com/docs/remote/vscode-web

            • Benjamin_Dobell · 8 hours ago

              It's extremely useful if your distribution platform is the web. However, I find it much more valuable as a type checker than a compiler. I use TypeScript extensively (in several projects) for defining schemas types. For example, in the Breaka Club ( https://breaka.club/ ) editor, which is not presently exposed to kids yet, we define behaviors for characters, props, mosaics (terrain tiles) and items in JSON. But the JSON has type checking and real-time completion as you type. Not naive property auto-suggestion, we have effect types and they're context aware in that you can refer to targets introduced higher in parent constructs of the JSON — and they're fully type checked. If you refer to a target that does not exist in a context, it won't validate and you cannot save the schema. We use tsgo for development, but the editor (runtime schema validation) is presently stuck on TypeScript 6 because there's no WASM support. Now, is it nutty that we're using TypeScript for JSON validation? A little. But it's extremely powerful. We're going far beyond what's capable with Zod or ArkType.

            • tcfhgj · 7 hours ago

              But it's not the only niche, see Typst compiler in wasm for live document generation in the browser.

        • vaughands · 16 hours ago

          I suppose my comment sort of implies this. I think the naive knee jerk reaction is that if you can spit out perfect machine level code against a specification, then logically being closer to bare metal would help with performance. However, without knowing the details of how things worked it is tough to say whether it is truly "reasonable" or not. But more importantly, the Typescript team themselves [1] picked Golang mostly out of ergonomics and ease of porting at the time. It is becoming more increasingly more to "taste" what ergonomics means. Notably, they did not pick it because they believed it to be the fastest option. But speed was on the mind, giving way to ergonomics and ease of porting. At least, this is my read. [1] https://github.com/microsoft/typescript-go/discussions/411

          • dunham · 16 hours ago

            The author of esbuild used Rust and later switched to Go. He describes some of his experience here: https://news.ycombinator.com/item?id=22336284 It is one person and one project, but I found it interesting to read about his experience. I like Go, but I probably would have tried Rust first because I want pattern matching when implementing languages.

            • e12e · 7 hours ago

              Very interesting. With rust's ocaml heritage, I'd imagine a straight port from typescript would be simpler and more idiomatic than a port to go. I guess not.

              • jitl · 5 hours ago

                Rust memory management is very different from GC heap memory management.

                • pjmlp · 4 hours ago

                  While true, it has not prevented other Microsoft teams to port Typescript, and .NET code into Rust. Notorious examples, the recent Github Copilot runtime, and the Microsoft 365 microservices.

          • andrewingram · 8 hours ago

            The notable thing that these LLM-generated ports aren't doing is _rewriting in Go_. TypeScript 7 is a lot faster than the JS/TS-based version 6, but memory use is a major bottleneck. However, it mostly represents a mechanical port of the old codebase to Go. What I haven't seen anyone do is try a true rewrite in Go optimized for performance (whilst keeping a strong emphasis on readability).

          • flohofwoe · 3 hours ago

            > then logically being closer to bare metal would help with performance Once you move beyond interpreters, performance is mostly a property of how much effort you want to put into profiling and optimization, not any specific properties of a programming language (YMMV of course).

            • spoiler · 3 hours ago

              I agree, but certainly language constraints or features make analysis easier (and some analysis which was previously impossible now suddenly is) which in turn unlocks/enables a whole world of optimisations the compiler can do for you!

        • conartist6 · 16 hours ago

          Was it ever a reasonable choice? At the time the choice was made the tooling ecosystem was already split between Rust and JS, and by putting TS in Go they chose to split it three ways. Why not split it 4 or 5 ways then? The pressure will always be towards less duplicated work. The only real choice of language to build the next generation of JS tools in is JS. Anything else is a vote of no confidence in ourselves.

          • dwattttt · 9 hours ago

            It's ok for a language (JS in this instance) to be good in a domain but not good in all domains. Pulling a language in every direction forces it to make compromises that hurt its applicability in specific areas.

            • conartist6 · 6 hours ago

              You seem sure like them that JS is not good. They didn't even bother to consider it as a choice! If you wanted to point to their evidence you couldn't because they don't have any.

              • dwattttt · 6 hours ago

                I'm suggesting that JS is not good for every possible use. And that is ok. I would not want a core internet router or a kernel to be implemented in JS. But I am happy it is used elsewhere.

                • conartist6 · 5 hours ago

                  So for context my beef with them is that they didn't try. I think you're being very "hand wavey" about why JS isn't a good host language, just as they were. If the argument is that it's not fast enough, JS is actually quite fast: https://mrale.ph/blog/2018-02-03-maybe-you-dont-need-rust-to... If the argument is "we need to show a 10x boost in raw throughput" then I think we first need to have an argument about why throughput is the right metric as a target for optimization. Throughput is the critical performance measure of a batch processing architecture . IDE's, like web UIs, "feel fast" when they're responsive , which is to say when they can start giving the user access to useful output (and interaction) at the soonest moment the program could possibly be ready to do so. In web perf we might measure this as INP: time from Interaction to Next Paint. JS won't be winning prizes for throughput, no, but if we completed the move away from a batch processing mindset to an incremental recomputation mindset, and at the same time switched to measuring responsiveness metrics like INP, suddenly the perf characteristics of JS seem a lot more helpful. It's the closest language to the DOM, so when your IDE's interface is built on web technology you'll optimize INP by keeping the data layer in JS: https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r... There's an even stronger reason than the DOM though to see JS as the "native" layer for perf: plugins. An IDE's selling point is integration, and users want to extend their IDEs by writing Javascript code. Like it or not, JS is the most natural and highly-performant native kernel language for a system of JS plugins.

                  • dwattttt · 4 hours ago

                    You may have missed the project history, this _was_ implemented in JS previously. I don't think they were interested in porting it back to a language it was originally written in.

                    • conartist6 · 3 hours ago

                      I know my history just fine. What I'm saying is: you can't say that it means that JS is a bad language to write tools in. That's would be like saying "our design had bad perf and it was implemented as JS, therefore no design implemented in JS can have good perf". I hope we agree this would be a faulty deduction, or at least an unfounded one.

              • Rapzid · 5 hours ago

                It was already in "JS". It was ported to Go.

              • mordv · 3 hours ago

                The case against JS was specific: data marshalling neglects the Web Workers performance boost for an "embarrassingly parallelizable" project. And it was stated clearly.

        • sreekanth850 · 15 hours ago

          Rust is more close to metal. No GC

          • pebal · 13 hours ago

            There is no connection. Rust has ARC which performs worse than the tracing GC.

            • saagarjha · 10 hours ago

              Than Go's GC? I think that is fairly unlikely in most cases.

              • pebal · 10 hours ago

                It depends on the workload. ARC can be more expensive than tracing GC, especially with heavily shared objects. But my main point was that the presence of a GC has nothing to do with how close a language is to the metal. Memory management strategy and low-level capabilities are two separate things.

                • sreekanth850 · 8 hours ago

                  I gave two separate reasons. Rust provides explicit control over memory allocation and management, and it has no garbage collector.

                  • pebal · 7 hours ago

                    Rust could just as well have an optional tracing GC for shared ownership instead of ARC, potentially improving performance rather than reducing it. Having a GC doesn't inherently make a language slower.

                    • josephg · 6 hours ago

                      > a GC doesn't inherently make a language slower. Yeah but let's be honest; GC languages (Go, Java, C#) usually are slower than systems languages. Systems languages just give you more, low level control over the computer from within your program. You can use that control to improve performance. Eg, you can control data locality, memory access patterns, the emitted assembler, and way more stuff. Of course you're right - if you misuse arc, you can make your program slow. So don't misuse arc then. Rust gives you lots of options for structuring memory. If you choose badly, that's on you.

            • legulere · 4 hours ago

              Not everything has to be ARC though and arenas are strictly better than GCs lacking synchronization issues for allocation and not needing any scanning for deallocation.

          • aka-rider · 10 hours ago

            GC doesn’t affect performance (at least visibly), memory allocations on critical paths do. Moreover, Rust ARC may cause memory fragmentation and perform worse than a GC. Writing Rust, Zig, or Go, you would still control memory manually, where it matters.

            • dwattttt · 9 hours ago

              It does have an impact. Discord blogged about unavoidable GC delays in go that occurred because go needed to traverse live memory, their only option (in go) for reducing that pause was to reduce the size of their data set.

              • legulere · 5 hours ago

                That seems like a latency rather than a throughput issue. In compilers I would expect latency to be a lesser problem.

            • sreekanth850 · 9 hours ago

              https://discord.com/blog/why-discord-is-switching-from-go-to... GC absolutely has performance costs, even with minimal allocations, because tracing collectors must scan live objects. This is exactly what this post says. Don't know if its really improved over time in real world cases.

      • galkk · 14 hours ago

        Now I want to see somebody to port it to c# :)

        • Rapzid · 5 hours ago

          I don't have 400k to burn(lol) but with union types now in C# 15... I wonder how few tokens it could be done in. Might be relatively easy work compared to Rust. Give it the goal of native AOT.. Have it profile and optimize after it gets a working version...

        • gzapp · 1 hour ago

          I'm doing this right now with Codex. It's currently working on porting the Binder. 7-11 phases to go and so far it looks like it might only cost $100. I'm focusing on efficient execution strategy minimizing token in/out, turns, and rework. Will prob post up something interesting when it's done.

    • aizk · 16 hours ago

      I think the future of this is -- get your AI agent to investigate this port for anything actually worthwhile, comparing it to the go version, and then take those good ideas and actually maybe bring them into the real compiler. Maybe. Who knows, it's all changing so fast!

  • elcritch · 17 hours ago

    I'm curious how much unsafe this uses? Are these ports making idiomatic code or just using unsafe all over. There doesn't seem to be anything in the readme.

    • dbalatero · 16 hours ago

      Have a look yourself: https://github.com/search?q=repo%3Apingdotgg%2Fts-rust+unsaf... Doesn't look like any on skim, also looks like an explicit goal was to avoid unsafe code: https://github.com/pingdotgg/ts-rust/blob/ad8f2746ea85a6354b...

  • bitpush · 16 hours ago

    Is this going to be a serious project? No. Is this going to be maintained? Nope Nevertheless this and many others are showing what is possible. Much akin to how someone ports doom onto a microwave. We'll look back at this time with great fondness when we collectively discovered a whole new gear.

    • BigJono · 14 hours ago

      > Nevertheless this and many others are showing what is possible. More unserious and unmaintained projects at 400k a pop. Sick.

  • pvillano · 16 hours ago

    I have to wonder if LLM reimplementations verified against years of human tests will have holes where original authors thought that tests are not necessary and common sense is enough. I have to wonder this to preserve my ego as a human. I wonder have to this because I sure as hell am never going to go through all that code to check.

    • LeFantome · 14 hours ago

      Of course they will. For about 3 days, and then it will get fixed. At this point, for software which has an extensive test suite (or a large body of interoperable software), humans are more likely to create these kinds of gaps than the LLMs are.

    • ghboo0927 · 3 hours ago

      I think these days agents leave almost no holes when there is an original program to compare against.

  • catlifeonmars · 16 hours ago

    This post should be titled “Rust port of Go rewrite of Typescript compiler”

  • fiatpandas · 16 hours ago

    Are there any specific harnesses or techniques to aid in porting stuff to Rust? Specialized in terms of token efficiency

    • hedgehog · 16 hours ago

      As much as possible mechanical (non-LLM) verification of equivalence that generates good diagnostic messages, mechanical translation steps that generate good diagnostic messages, a good memory system to reduce rework... (edit: and mechanical coverage measurement)

  • Gigachad · 16 hours ago

    I honestly have no idea what the future of tech will look like at this point. Too much has changed.

    • win311fwg · 10 hours ago

      It is beginning to look like the future is treating Rust as an optimization pass. Write your program in a higher-level language like Typescript, Go, Python, etc. and then have LLMs compile that to Rust.

      • pjmlp · 9 hours ago

        Not really, the future are natural languages, with some markdown files for formal specification, yaml or whatever, and then Assembly gets generated directly. 3 GLs are going to slowly fade out as LLM tooling improves, and coding looks increasingly as envisioned by 4 GLs advocates.

        • NewLogic · 9 hours ago

          Sounds awful, natural language sucks for describing complex problems and relationships. That's why people have historically reached for diagrams and pseudo code.

          • chasd00 · 6 hours ago

            :shrug: LLMs understand those too.

          • pjmlp · 6 hours ago

            Which you can provide on your Markdown files as well. These are not what-ifs, this is an active area of research currently, "CGO 2022 Keynote: Compiler 2.0" https://www.youtube.com/watch?v=w_sX9aZoZxg "Machine-Generated, Machine-Checked Proofs for a Verified Compiler" https://www.youtube.com/watch?v=Dmt0h99iOmM

      • Gigachad · 7 hours ago

        From the OP post it costs tens of thousands of dollars to do that compile.

        • rpozarickij · 7 hours ago

          Given the rate of progress, it's hard to argue why this couldn't be a reality. If in the future Taalas-type chips with baked in frontier models are commonplace, this should be quite different price-wise from what we have now. It's a bit dizzying to imagine that LLMs might even be able operate at speeds of chatjimmy.ai, but we already have working tech that does exactly this (albeit with less intelligence/capabilities).

      • chasd00 · 6 hours ago

        Just give the LLM requirements and have it output rust. Just like giving a compiler a text file and it outputs machine code.

        • win311fwg · 5 hours ago

          Theoretically the LLMs could go straight to machine code. No need for any intermediate language. However, the HN stories have made it clear that LLMs are not great at going directly to machine code or Rust. Rust is, time and time again, is being used used as an optimization intermediary. If LLMs were better to target it directly they wouldn't be reading report after report about translating to it from another language.

          • childintime · 3 hours ago

            Yesterday I asked Claude to make a RISCV emulator like qemu in x86 assembler. It runs about 5x slower than qemu. That's a pure interpreter vs one of the best JITs. Qemu can run many more instructions though.

    • pjmlp · 4 hours ago

      We have to accept that those of us that survive the AI layoff wave and want to work in IT, will have to work as technical architects, solution analysts, requirements management, or move into management roles. Coding as we knew it will be left to weekends and retro-computing handcraft fairs.

  • yoyohello13 · 16 hours ago

    Maybe there are just so many of these but at this point for vibe coded stuff like this I’m just like “who cares.” LLMs can make stuff like this now. Unless this reaches some critical mass of usage among developers why would I use it? It’s just a less maintained, less tested implementation. The more important question is “what does this teach us?” And idk the answer to that one.

    • rowanG077 · 16 hours ago

      Generally building something is not about "What does this teach us?" but rather "What can this be used for?". You don't build a house and as "What does this teach us?". It's honestly almost a perverse question to primarily ask for something that aims to have practical value. The clear reason this has worth is that it's much faster than TSC.

      • Capricorn2481 · 16 hours ago

        That's why the commenter said > It’s just a less maintained, less tested implementation Then they asked if it teaches something because it is a risky utility to them. You're trying to make it sound a lot weirder.

        • rowanG077 · 16 hours ago

          The point is that it's clearly not just a less maintained, less tested implementation. It's 1.61x faster for one in real world apps, in some case even almost 4x faster.

          • Onavo · 16 hours ago

            I am curious why it's faster. Golang isn't that much slower than Rust, aside from the garbage collector. 4x performance improvements is much bigger than what I expected.

          • Capricorn2481 · 16 hours ago

            If that was your point, why did you spend a whole paragraph saying "teach us? What a perverse question."

            • rowanG077 · 11 hours ago

              The comment I responded on put forth a generic argument that implied if we can not learn from it it has no value. That is what I was responding to.

      • bdelmas · 15 hours ago

        HN is going to be a weird place to be between people loving AI and the loss of loving tech. I don’t remember last time I watched a good tech dev video. At least the video game industry is a little bit shielded from this but soon it will be the same when we see the speed AI is advancing. No more joy crafting things as a dev…!

        • rowanG077 · 10 hours ago

          I don't see at all that this is stifling love of tech. Sure if you liked to engage in language wars or vim vs emacs or tabs vs spaces then yes that's over. But tech as we know it is currently exploding, a ton of stuff that simply was not practically possible before is now possible.

          • doc_ick · 5 hours ago

            Give us some examples of things that were not practically possible. Things are practically possible if the time or money is wisely spent, even if it takes a human a bit longer.

            • rowanG077 · 4 hours ago

              Money and time are precisely the point. Things are not practically possible of a X would cost 100K to develop and it's worth was 30K. But now that it costs 2K to develop it is suddenly practically possible. 1. A person building alternatives to photoshop single handedly: https://gizmodo.com/someone-vibe-coded-a-free-knockoff-of-ad... 2. The abundance of game decomps and recomps becoming available. Literally dozens of example in this space. 3. Reverse engineering of obscure software. A ton of oppertunities lie here. 4. As this posts indicate, severely accelerating existing software by re-writing it in language that are not terrible for performance. 5. Analyzing large volumes of unstructured information. 6. Creating one-off engineering and scientific tools. 7. Beating essentially all traditional Linux distribution, see Omarchy. 8. A personal example: I'm remaking the engine of an old game commercial game in rust. I'm honestly a bit taken aback that this question is even asked. The volume of software is exploding and the power of the individual has increased a hundredfold.

      • yoyohello13 · 13 hours ago

        I guess I’m just perverted then.

    • spankalee · 15 hours ago

      I think the difference here is that the original motivation for choosing Go over Rust was that Go was easier to port TypeScript to. LLMs change the calculus a lot, the result seems faster, and it's possible that the TypeScript team might want to change directions. It'd be a big deal, but I bet they'll at least discuss it.

      • criemen · 10 hours ago

        There is a long interview with Anders Hejlsberg here https://www.youtube.com/watch?v=cywK3XYYJ2o&pp=ygUbYW5kZXJzI... where he talks about that, in short from what he said 1-2 months ago, I doubt that they will change directions.

        • pjmlp · 4 hours ago

          Given the Typescript compiler rewrites that keep popping up, Next.js has one, this is another one, Angular just announced they are also going with theirs, eventually there will some community pressure on how the team will proceed. Note there is already a feedback post from them (currently top one), that they will need to react to this.

          • yoyohello13 · 1 hour ago

            Do we know why? Is there some hole the official one isn’t filling? Seems like having 10 different compiler implementations would be a portability nightmare. Now I can’t guarantee my typescript is going to run the same on node/angular/whatever

            • pjmlp · 1 hour ago

              Yes, one hole is no longer being able to just integrate the Typescript compiler into other tools. The team has posted reaching feature parity with broken workflows past 7.0 release. https://blog.angular.dev/an-update-on-angulars-typescript-7-... https://devblogs.microsoft.com/typescript/announcing-typescr...

    • joe-excom · 15 hours ago

      It teaches us the Rust community continues to be relentless in their efforts to rewrite virtually everything in Rust.

      • yoyohello13 · 13 hours ago

        Isnt the guy who made this a typescript developer?

        • viraptor · 13 hours ago

          Yes. This has nothing to do with people trying to rewrite things in Rust for fun. It's a part of his development project that I'm sure will get a video in the future.

          • CuriouslyC · 6 hours ago

            It got a video before it hit HN

      • epolanski · 6 hours ago

        I don't think the author even knows Rust.

    • pjmlp · 9 hours ago

      For me it removed all the fun to play with whatever projects are announced in HN, now it is all AI generated, why bother.

      • jckahn · 5 hours ago

        I don't understand why. Aren't the ideas and results the important parts?

        • pjmlp · 4 hours ago

          Not without the craft. We could use a Star Trek replicator then.

          • jckahn · 42 minutes ago

            And what's the problem with the (theoretical) replicator? Wouldn't it be better if more people got what they wanted and there was less scarcity?

        • globular-toast · 4 hours ago

          What ideas? This is just an AI rewrite. Would gold be valuable if anyone could create it at will? Sure, a few people would like the colour and the way it shines, but most would be indifferent. A lot of these things were cool because we knew they were difficult and had technical challenges to overcome. Now it's easy, I just don't care.

        • yoyohello13 · 1 hour ago

          In this case the idea here is ‘rewrite tsc in Rust” not exactly earth shattering. If somebody hand wrote that, then they could have gleaned some new insights about Rust or Typescript or something which could be interesting, but in this case they just had an LLM do it and didn’t even read the code. So it’s a big who cares. If it gets adopted by the official compiler team, then I’ll be interested. But right now you would be an idiot to use this for anything mission critical. When people post AI projects with genuinely new/interesting ideas, then I am interested.

  • hannibalhorn · 16 hours ago

    In the real world project section, compile times vs tsc7 were 1-3s less. Sometimes the percentages are far more impressive than absolutes.

  • shepherdjerred · 16 hours ago

    I wish Anthropic/OpenAI would give me free tokens so I could make random things like this I already pay for subs on both but the tokens are already spoken for with other projects

  • anonymous908213 · 15 hours ago

    LLMs have been trained to fix compile errors in a loop. Give them years of human labor worth of tests and they will fix compile errors until it works (as well as the tests can ensure). Now you have a codebase no one has read. Good luck adding new code to it. Let's also not forget that Bun was claiming a rewrite in 11 days or whatever it was, but actually spent three months of human labor fixing hundreds of issues their rewrite introduced before shipping it as a release.

    • epolanski · 6 hours ago

      > Good luck adding new code to it. Interestingly, your whole comment implicitly has the answer to this. In the future you don't add code or read it, you only add test cases and have the loops work on covering the new case.

      • mexicocitinluez · 5 hours ago

        I don't know that I agree, especially with LLMs as they are right now. Maintainability isn't just for humans. An LLM working in an unmaintainable codebase has the same problems we do. It doesn't necessarily follow that if your code can pass your tests today then it will be able to pass the tests of tomorrow. I'm in healthcare. Regulations and payor rules change constantly. I don't know what tomorrow will bring, but I do know that the code I have an LLM generate tends to focus on the here and now (at the expense of the future). Sometimes that's okay, though. I don't know much about writing a compiler, so it could theoretically work. This is by no means an anti-AI post (I use the hell out of these tools). But I can still see the cracks in them.

        • epolanski · 5 hours ago

          Your comment would've made sense in 2024, not now.

          • Rapzid · 4 hours ago

            Why doesn't their comment make sense?

            • epolanski · 2 hours ago

              Because there's no evidence LLMs struggle to maintain or add features to complex codebases.

      • anonymous908213 · 5 hours ago

        The existing test cases were created based on understanding the code. Creating good tests that cover every case you care about without understanding the code is not possible.

        • epolanski · 5 hours ago

          Either the current test suite covers the apis and expected behavior or it does not.

          • Rapzid · 4 hours ago

            These big ports we are hearing about are of projects with hundreds (prob thousands) of unit tests. Not only are the models typically trained with the original code bases in their dataset, but the test suites themselves have project architecture encoded in them.. Ultimately there isn't enough information on how to most effectively maintain and evolve large, complex software with LLMs yet. We aren't even a year out from Opus 4.5.

  • Capricorn2481 · 15 hours ago

    Why does it seem like this is falling off the front page really fast? There's older posts with less points that are way higher.

    • ncruces · 7 hours ago

      More comments than upvotes make it sink, because it's a contentious topic.

  • spankalee · 15 hours ago

    This was a lot of tokens to spend on a port. I wonder if all of the porting activity out there would be better supported by investing in really good deterministic automatic translators that do 90% of the job cheaply and delegate any decisions that have to be made back out to the AI agent?

  • Thaxll · 14 hours ago

    "In total I did over $400,000 in API priced tokens with GPT-5.6 Sol and GPT 6 Astra." wut?

    • scotty79 · 5 hours ago

      You can count tokens that were used on your subscriptions and mutliply them by token api prices to get a memeworthy very large number.

  • mkesper · 10 hours ago

    What a waste of power... $424.000 of API priced tokens amounts to how many kWh burned? And how would you trust this to build your code? Motivations says it all: Motivations Test model capabilities Make a fast TypeScript type checker Make a ts checker that can work in WASM with high performance Memes

    • epolanski · 6 hours ago

      > And how would you trust this to build your code? In the same way you trust any build of the official compiler: it passes all of the existing tests.

      • globular-toast · 4 hours ago

        Do you read the test suite of all the programs you run? I trust software because the authors have shown themselves to be competent and trustworthy. I expect authors to understand what they are doing, not just bashing into the guardrails until they get something that passes all the tests.

        • epolanski · 2 hours ago

          What are we arguing really? An LLM has reimplemented a 2 times faster version of a program developed by a team of dozens of brilliant engineers led by few of the biggest experts in compilers and programming languages in the world. While maintaining 100% test coverage and so far compiling every single project that the original compiler did. If your takeaway here is "yeah, but the other one has been checked by dozens of paid devs and an entire community", and still those dozens of devs with the backing of thousands of contributors could not make a compiler faster I can't buy say: "maybe we humans aren't as good as writing code as we thought and LLMs are exposing us".

    • scotty79 · 5 hours ago

      He uses it for his real code bases to speed up their compilation and opensourced it so the application might be wider than motivation.

    • Jcampuzano2 · 4 hours ago

      There are companies that spend the equivalent of that in a single day on tokens. Lets not wage war against one person here. Its the equivalent of telling individual people they are the problem when it comes to leaving their living room lights on when not in the room or they don't recycle all their stuff correctly when companies/corporations have orders of magnitude more waste.

  • wg0 · 10 hours ago

    Paraphrasing from README.md: >Spent over $400,000 in API priced tokens with GPT-5.6 Sol and GPT 6 Astra. They wrote over 1.3m lines of Rust over multiple months of /goal loops and never got past like 84% compat. Then they let Claude code lose on the problem: > I figured it'd be fun to throw Opus 5.5 at this. It had a working v0 in 10 hours. I assumed it kept using the code the Codex models wrote. I was wrong. Opus 5.5 started from scratch. It got further than Astra in 1/10th the time. In the warnings from README.md > Also worth mentioning: I've never read a line of this code.

    • orthogonal_cube · 9 hours ago

      They spent over $400k for an experimental project and published it without reading a single line of code?? I am so confused about the motivation behind this.

      • LelouBil · 8 hours ago

        They didnt actually spent 400k, that's in "API-priced" tokens, he spent ~$24,047

        • JBits · 7 hours ago

          How on earth does someone just randomly spend $20k? If he's not going to maintain the project, the whole thing seems completely pointless.

          • Rapzid · 5 hours ago

            Youtuber. It's content.

          • orthogonal_cube · 5 hours ago

            Looks like this is a company’s org which heavily relies on AI. Probably “the cost of doing business” and to see just what can be done with the new model.

            • owebmaster · 4 hours ago

              No, that's not the case. It's a click baity narrative made by an influencer.

        • chasd00 · 7 hours ago

          He didn’t spend that much either. That’s the equivalent API cost using his $200/month subscription. It took less than a day so I guess it cost about $7 in actual money.

        • orthogonal_cube · 5 hours ago

          Ok, that makes more sense. If the other comments are correct in saying this was done using a $200/mo personal subscription, I get this is more of a “what is possible, and how much would it cost without subsidized pricing” type of experiment. Thank you for clarifying on that.

      • epolanski · 8 hours ago

        > I am so confused about the motivation behind this Seems obvious, experimenting with what it's possible with LLMs.

      • jckahn · 5 hours ago

        The motivation was to see the result. Why is reading the code an important concern?

    • nialv7 · 8 hours ago

      throw away $400k on a failed attempt is crazy...

      • xedrac · 7 hours ago

        It wasn't $400k in real money.

        • globular-toast · 6 hours ago

          What was it then? Who paid the $400k?

          • true_religion · 6 hours ago

            It's theoretical money, because he used multiple subscription accounts that would have cost $400k in token pricing, if he were going via the API.

            • globular-toast · 5 hours ago

              What the hell is "theoretical money"? It sounds like either OpenAI took the $400k hit, or their API pricing is utterly bonkers and therefore completely pointless to quote. It would be like me saying my car is worth $400k in theoretical money because, yeah, I'd totally sell it to you for $400k.

          • dwattttt · 5 hours ago

            No one. Quoting sibling, it would have been about $7 usage of a $200/month subscription.

    • xnorswap · 6 hours ago

      I've been rinsing Opus 5.5 and I've been unable to get over 20% of my plan usage, it seems to use a tiny fraction of the usage that Opus4.8 or 5.0 used. I don't know if it's an accounting trick or genuinely less usage, but since 5.5 I've not had to think about limits at all.

      • wg0 · 5 hours ago

        What plan are we talking about?

  • benrutter · 9 hours ago

    > Spent over $400,000 in API priced tokens with GPT-5.6 Sol and GPT 6 Astra Tangent here, but I think this bit is super interesting! You could viably hire someone to do this work for that kind of money - I think the interesting thing is that substantially less interested/experimenting engineers would consider paying for a human to do this work, than would happily chuck a big amount of money into an LLM. I don't have any suggestion about why that exists, but it's a strange and interesting contract.

    • chadcmulligan · 9 hours ago

      I've had the same thought about the maths - they've spent millions on tokens, I can't recall anyone spending millions on mathematicians.

      • fiforpg · 6 hours ago

        To be fair, NSF grants for pure mathematicians were never as substantial as for applied sciences, but they would routinely reach 500k–1M territory. That's the amount going to a single proposal, and grant panels in, say, analysis would definitely spend millions per application season. NSF funding data is public and can be looked up. I'm using past tense because iirc NSF has recently reduced their funding volumes, although I'm not following the situation very closely.

      • binlog · 6 hours ago

        NSF by itself contributes $200-300M a year towards math grants. Universities spend a billion+. Add corporate funding and other sources (DoD, other government agencies, private foundations) and you’re easily looking at a few billion dollars a year just in the US going to mathematicians.

    • flossly · 9 hours ago

      I found the whole section super interesting... I'll copy it here: I used a lot of OpenAI models to try and complete this port. In total I did over $400,000 in API priced tokens with GPT-5.6 Sol and GPT 6 Astra. They wrote over 1.3m lines of Rust over multiple months of /goal loops and never got past like 84% compat. When I saw how little my Claude Code limits were burning, I figured it'd be fun to throw Opus 5.5 at this. It had a working v0 in 10 hours. I assumed it kept using the code the Codex models wrote. I was wrong. Opus 5.5 started from scratch. It got further than Astra in 1/10th the time. I let it keep going, and it definitely did. Total token spend was ~$24,047 of API spend over 2 weeks. I was using my Claude accounts, and it worked out to somewhere between 925% and 983% of my $200 plan weekly limits. Expensive, for sure, but not that bad considering how much work has went into typescript-go.

      • flossly · 9 hours ago

        Great advertisement for Claude Code...

      • Topfi · 8 hours ago

        > I assumed it kept using the code the Codex models wrote. I was wrong. Opus 5.5 started from scratch. It got further than Astra in 1/10th the time. Ouch, that is brutal and honestly, quite embarrassing but confirms what I have been seeing for a while. Personally, I find output from current OpenAI models still very hard to parse (though it has gotten better vs the pre-trains from both labs in mid/late 2025), thus hard to truly understand, verify and get comfortable maintaining vs current Anthropic models. I do occasionally see a higher ceiling in well scoped tasks with OpenAI models at the cost of (frequently) deviating from the original prompt in (sometimes) very destructive ways. Could be that this hard-to-read output doesn't just go over my limited capacity/skills but with current models can become simply impossible to untangle beyond a certain size even when one has (essentially) infinite resources via multiple subs and different models. Would also work with my suspicions for why OpenClaw (mainly build with Opus 4.5 and its post-trains) has been this hard to truly "fix", requiring highly paid Nvidia engineers, multiple months, (literally) infinite resources from OpenAI including access to internal models and yet still holds records for CVEs. Heck, another one was found just 7 days ago after what I'd argue was one of the most extensive hardening sessions any piece of software has ever undergone. Makes my (multiple) decisions to start from scratch more than once on a major reworking of the existing tabbing interface in Firefox a bit less painful. Learned with each, found gaps in my knowledge, thanked the amazing docs the Firefox devs have been maintaining for decades and while starting from 0 was painful, getting back to MVP is easier than ever. When I hit a point were I was starting to struggle to truly parse additions a model was making to the patches applied to Firefox source code (even if they worked), I always found that pushing even slightly beyond that would incur painful, but hard to notice regressions, introduce major DB maintenance burdens as some models struggle to understand that in development regressions and incompatibility are acceptable and schema transitions aren't needed pre-release (still a case with GPT-6.1 Sol, less so post Fable for Anthropic), make me uncomfortable concerning privacy/security/data loss prevention (especially as I have seen Fable 5 cut some privacy/proper data removal corners in simple CRUD) and simply take away my control about the implementation. Wouldn't feel right to release something in that state, what I have now is fully understandable and thus could be maintained even without models. Still expecting bugs of course, massively dreading security findings or even worse, possible data loss given browsers handle some of our most important personal+professional data and will surely have taken some embarrassing approaches that might have a much more performant solutions when implementing an infinite canvas of webpages, but still, rather that then also knowing I wouldn't even know where to start understanding a feature. More so if, like with ts-rust, even (nearly) infinite tokens couldn't get me unstuck.

        • Rapzid · 6 hours ago

          I think it's hard to know what to make of that. Observations with little insight. Maybe it just needed to be prompted differently? Maybe Astra starting from scratch could have done it? Maybe Opus was somehow trained more on the Golang implementation. It's curious, but again little insights.

          • Topfi · 5 hours ago

            Could be. Feel at 6k commits there is a lot to be learned here, might be useful to compare code quality, approach taken by each model and assess whether what Astra created was truly unsalvageable. Prompting wise, would be interesting to know how much steering truly happened across the project, if one wanted the model to truly work without detailed input, there isn't much that could be done to improve. How much was lined out and set I'd love to know, don't see it anywhere in the commits though, just the AGENTS.md and a few other docs files. "Port TS compiler, checker and LSP to Rust, never ask any questions" would be pretty funny though.

        • scotty79 · 5 hours ago

          > Ouch, that is brutal and honestly, quite embarrassing but confirms what I have been seeing for a while. What's most interesting is that Opus wasn't told to toss out the Codex crap. It decided to do that on its own. Which might mean that LLMs are actually getting a reasonable taste. I've seen on youtube that some guy implemnted game engine with Astra and Claude. Astra wasn't really given fair chance because it didn't decide to work as long as Claude and the guy didn't force it. But still, scripting code within the engine that came from Astra was chaotic, messy, piling up things, but the code that Claude made looked downright pleasant.

      • sreekanth850 · 6 hours ago

        Are we sure that he spend that much or he calculated the API pricing and used a subcription to implement this?

        • semiquaver · 6 hours ago

          We’re sure that he did not spend that much and did use (sharded) subscriptions, because he said so.

        • TiredOfLife · 5 hours ago

          The GPT ones were provided by OpenAI for evaluation. Claude ones were pooled subscriptions.

          • flossly · 4 hours ago

            > provided by OpenAI for evaluation Well that backfired. Now all geeks reading this know that Opus beats Astra's ass hands down.

    • ____mr____ · 9 hours ago

      This is Theo's project, and he has been very transparent about how he is only doing these things because api prices are heavily subsidized by subscription pricing. The reason people aren't willing to pay 400k to an engineer to do this work is because they aren't paying the AI this much. I don't think I've seen an enterprise paying API prices doing these sorts of rewrites, and honestly, I think until that happens I will remain skeptical about LLM AI's viability as a profitable business.

    • viraptor · 6 hours ago

      He's not paying that much in practice. But even if he did, you couldn't hire 3 engineers (I'm assuming you'd get 3x 133k each) that could do this work in anywhere close to this amount of time. It would be a multi-month long project. So "to do this work" is not really comparable.

      • true_religion · 6 hours ago

        He already said it was a multi-month project that used multiple models. So it feels very comparable to hiring multiple humans for multiple months.

  • ForHackernews · 6 hours ago

    Didn't they just get done porting this to Golang?

    • flohofwoe · 3 hours ago

      This is not related to the official compiler.

  • owebmaster · 4 hours ago

    The most interesting part if I got it right is that he got 400k of free GPT api to test and publicly concluded that 10 hours of Claude Code subscription is better. For anyone that knows this influencer, he's always been a paid shiller for Anthropic. It's funny that OpenAI still reached for him if that's true.

  • pmkary · 4 hours ago

    This officially proves how great the Go code is! I mean: You have easiness and friendliness and high level language of Go for only 50%~70% slower performance. I always thought what happens if they port to Rust? Will it also become an order of magnitude faster? Turns out it really is not worth the cost. Go is perhaps just the best language.

    • rowanG077 · 3 hours ago

      Go is not higher level. If anything I would consider Rust higher on the abstraction ladder than Go. Or rather it's perhaps better to say that Rust is higher level but can go down to a lower level than Go.

      • pmkary · 23 minutes ago

        I both agree with you and still think my initial idea was correct, and it means that I have expressed it very badly. What I meant by higher order was all the little niceties Go has that becomes a nightmare in Rust, the memory management, simple language; I mean just think about working with strings in Go vs Rust. The amount of boiler plate stuff always gives me a headache in Rust. But you're right, the map to C and C++ and go is orders of magnitude less developed in that terms.