logoalt Hacker News

Goscript: Transpile Go to human-readable TypeScript

20 pointsby aperturecjslast Sunday at 9:20 AM8 commentsview on HN

Comments

tdarontoday at 9:35 PM

hey ! i like the idea but I don't get why not using WASM instead of transpiling ? (I get the "transpiled typescript might be more readable" argument, but it seems less bullet proof / prone to unexpected behavior)

nzoschketoday at 8:43 PM

Neat! I have experimented with various ways to convert Go structs to/from TypeScript interfaces.

- https://quicktype.io/

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

lowmagnettoday at 9:17 PM

Wait, go isn't human readable?

show 1 reply
tayo42today at 7:13 PM

Interesting I feel like I'd rather go the other way, write something in a language with nice syntax and features, then transpile to go

show 2 replies