Our great sponsors
-
If you have some scripting you want to do in javascript permanently (or even just for a while) after having your main project running in Go, it might be useful to look at embedding v8 or quickjs since those options would give you a fully featured runtime, but they would mean cgo. If you want pure Go, you might be able to use https://github.com/dop251/goja (which can even run a typescript compiler and/or babel if you need) but your use case is still important. A lot of what you are doing might be from the os and fs libraries, etc, which are not part of the runtime but rather libraries, and in the case of many, they might be written in C. Hopefully you can add the little bit you need or ignore it and do that work in Go.
-
Everything said above is valid, but if you do think you have a need to transpile... consider running any Go frontend code as WASM rather than Javascript. A few years ago I started doing my frontends and backends all in Go and its been wonderful. I even wrote a library so I could use gRPC from my WASM/Go frontends rather than REST: https://github.com/tarndt/wasmws . Extra wonderful, at least for my tastes. Once caveat is if your brotli compressed, CDN/browser cached, etagged Go WASM is still to big, you can usually make it even smaller by using tinygo rather than the std tool chain for the compiling to WASM.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-