←back to thread

153 points yar-kravtsov | 1 comments | | HN request time: 0.321s | source

I built a Vite plugin that lets you write Go code directly in .js files using a "use golang" directive. It compiles to WebAssembly automatically.
Show context
pjmlp ◴[] No.45718527[source]
Cool hack, just use JavaScript.
replies(2): >>45718573 #>>45718617 #
Cthulhu_ ◴[] No.45718617[source]
99 times out of a hundred, sure. But sometimes you need better performance or a library that isn't available in JS.
replies(3): >>45718843 #>>45718863 #>>45720349 #
1. ramses0 ◴[] No.45720349[source]
Or even "use server.physics.go", which is where my mind went to (and where I've messed around with language interoperability with tinygo before).

This is such a wonderfully blursed and "smooth" implementation!