Goscript: Transpile Go to human-readable TypeScript
1–10 of 13 posts
Re: Goscript: Transpile Go to human-readable TypeScript
#2Re: Goscript: Transpile Go to human-readable TypeScript
#3Re: Goscript: Transpile Go to human-readable TypeScript
#4Interesting I feel like I'd rather go the other way, write something in a language with nice syntax and features, then transpile to go
Javascript was a weird exception, being rigidly the only thing available in the browser for so long and thus the only acceptable "compile target" for anything you want to run in the browser. In general I can't name very many instances of "write in X and compile it to Y", for some Y that isn't something you are forced to use by a platform, being all that successful. (See also assembler itself.) The Javascript world gives a false signal of this being a viable approach to a project; in general it doesn't seem to be.
(Note this is a descriptive claim, not a normative one. I'm not saying this is how it "should" be. It just seems to be the reality. I love people trying to buck the trend but I am a big believer in realizing you are trying to buck a trend, so you can make decisions sensibly.)
Re: Goscript: Transpile Go to human-readable TypeScript
#5Interesting I feel like I'd rather go the other way, write something in a language with nice syntax and features, then transpile to go
The other option is to evolve static python into such a language. Looking forward to the PEP that proposed DSLs in Python.
Re: Goscript: Transpile Go to human-readable TypeScript
#6- https://github.com/danielgtaylor/huma then OpenAPI -> TS
- https://github.com/gzuidhof/tygo
- https://github.com/coder/guts
guts also does some AST stuff.
It seems like this project could help with this and then some.
Re: Goscript: Transpile Go to human-readable TypeScript
#7Interesting I feel like I'd rather go the other way, write something in a language with nice syntax and features, then transpile to go
There are a number of little projects like that but I'm not aware of any that have attained liftoff. Javascript was a weird exception, being rigidly the only thing available in the browser for so long and thus the only acceptable "compile target" for anything you want to run in the browser. In general I can't name very many instances of "write in X and compile it to Y", for some Y that isn't something you are forced…
Re: Goscript: Transpile Go to human-readable TypeScript
#8Re: Goscript: Transpile Go to human-readable TypeScript
#9Earlier quoted context omitted.
There are a number of little projects like that but I'm not aware of any that have attained liftoff. Javascript was a weird exception, being rigidly the only thing available in the browser for so long and thus the only acceptable "compile target" for anything you want to run in the browser. In general I can't name very many instances of "write in X and compile it to Y", for some Y that isn't something you are forced…
I keep waiting for a LLVM IR reverser. If there's a LLVM IR to foo reverser written, you would be able to use any language supported by LLVM and convert them to foo. It seems like a much better solution than all the disparate one-offs that exist today.
I did some reverse engineering of compiled C code back in the day. Back when compilers and CPUs were simpler, and optimizations were fewer, it was relatively straightforward for a human to do. That's no longer true. I suspect an LLM would have difficulty with it as well, plus the non-determinism that would introduce would be likely to be problematic.