← Back to context

Comment by conartist6

8 days ago

Haha TS7 is the next biggest example of, "Let's just do a line by line port to another language instead of seriously examining our architecture"

This is the correct approach (I dare to say the only correct approach) when porting to another language. You can examining the architecture later.

  • If you can lock down a test suite that ensures parity, then who cares what shape the lift ultimately looks like.

    A full rewrite in different language that fails to be idiomatic is a step backward operationally, even if you stand to gain on issues the new language just eats for free

    • I like your fair-mindedness but for folks who are anti-LLM-anything, your argument is not the point.

      Evidence: see the amount of nonsense in the postgres rewritten in Rust story - https://news.ycombinator.com/item?id=48841676 where there are two contradictory claims made:

      "postgres is so stable I will never trust a rewrite."

      "covering 100% of postgres regression suite doesn't guarantee you have replicated every behavior."

      Folks who are okay with LLMs think the regression test suite is the spec and is the guarantee of stability. How else can it be? If you are depending on some behavior not covered in the regression tests, how do you know the next minor release won't break you?

      Folks who are against seem to imagine a platonic ideal of PG which conveniently is the original PG implementation by tautological definition. So no rewrite can ever meet their bar.

      8 replies →

Indeed as much I dislike the approach Bun took, at least the port appears to be working. TS7 is going to cause problems for downstream users because Go is the wrong language to use for something that has to run in WASM.

  • > TS7 is going to cause problems for downstream users because Go is the wrong language to use for something that has to run in WASM.

    Is there a huge need to run that typechecking on browsers?

    • First, yes, the demand to be able to code natively in a browser is, I have reason to suspect, very large. It's just difficult to measure demand when nobody has ever offered a really compelling product. In engineering terms it's like getting a full-scale reading. The real level could be 1% above a full-scale reading, or the real level could be 100x higher than the full-scale reading.

      Secondly, WASM isn't the right target for the browser anyway, JS and the DOM have to be what you consider "native", for the most rigorous UI projects at least (which building an IDE is). If you want to build a cross-platform UI product that doesn't require installation and has Emacs-like levels of extensibility, JS is the end of the line in terms of language selection. There are no other candidates.

      2 replies →

    • Yes, in the Monaco editor (https://microsoft.github.io/monaco-editor/).

      It's not just typechecking, the typescript library is also the reference parser for TypeScript and reference emit. Emitting JS from TypeScript is non-trivial and non-local.

      It's not just in browsers, you might want to run the typescript library on the edge or in some restricted environment where JS/WASM is OK but native code is not.

      You may want to use the typescript library as a dependency in your own package. TypeScript becoming non-pure JS means that your library also becomes non-pure JS.

      2 replies →

  • Didn't WASM got a GC proposal that Go and other managed languages can use it? So it might be an issue in most browsers right now, but soon it might not.