←back to thread

153 points yar-kravtsov | 1 comments | | HN request time: 0.273s | 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 #
pjmlp ◴[] No.45718843[source]
WebGPU or WebGL is the answer.
replies(1): >>45720060 #
1. dgb23 ◴[] No.45720060[source]
I second that, having just relatively recently used the native browser APis for image processing. While it felt a bit awkward to use, it served its purpose pretty well.

If I needed more, I would probably not use Go anyways, but a sharper tool instead.