←back to thread

153 points yar-kravtsov | 1 comments | | HN request time: 0s | 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. hollowturtle ◴[] No.45718863[source]
Better performance? For javascript code that calls into native platform apis provided by the browser it's been alteady proven that performance is an order of magnitude better than calling into wasm and doing all the sheningans to move bytes from and to wasm