Goscript: Transpile Go to human-readable TypeScript

https://news.ycombinator.com/rss Hits: 2
Summary

GoScript What is GoScript? GoScript is an experimental Go to TypeScript compiler that translates Go code to TypeScript at the AST level. The goal is to enable sharing algorithms and business logic between Go backends and TypeScript frontends. Right now goscript looks pretty cool if you problem is "I want this self-sufficient algorithm be available in Go and JS runtimes". gopherjs's ambition, however, has always been "any valid Go program can run in a browser". There is a lot that goes on in gopherjs that is necessary for supporting the standard library, which goes beyond cross-language translation. โ€” nevkontakte, developer of GopherJS ๐ŸŽฏ Why GoScript? Write once, run everywhere. Share your Go algorithms, business logic, and data structures seamlessly between your backend and frontend without maintaining two codebases. Use cases: Sharing business logic between Go services and web apps Porting Go algorithms to run in browsers Building TypeScript libraries from existing Go code Go has powerful concurrency support and an excellent standard library. GoScript brings these capabilities to TypeScript with as simple and readable of a translation as possible. โœ… What works: Structs, interfaces, methods, and functions with full value semantics Channels and goroutines (translated to async/await with function coloring) Pointers and addressability (via VarRef system) Slices, maps, and built-in types Control flow (if, for, switch, select, range, defer, etc.) Type assertions and interface implementations Closures and anonymous functions ๐Ÿšง In progress: Reflection support Standard library coverage Generics Known limitations: Uses JavaScript number type (64-bit float, not Go's int types) type (64-bit float, not Go's int types) No pointer arithmetic ( uintptr ) or unsafe package ) or package No complex numbers ๐Ÿ“– Learn more: Design document | Architecture explainer | Compliance tests ๐Ÿ› Found an issue? Please open an issue. ๐Ÿš€ Try It Prerequisites GoScript requires Bun to be installed for r...

First seen: 2026-01-15 19:18

Last seen: 2026-01-15 20:18