/top/
/new/
/best/
/ask/
/show/
/job/
^
slacker news
login
about
←back to thread
Show HN: Write Go code in JavaScript files
(www.npmjs.com)
153 points
yar-kravtsov
| 1 comments |
27 Oct 25 05:36 UTC
|
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
◴[
27 Oct 25 08:25 UTC
]
No.
45718527
[source]
▶
>>45717724 (OP)
#
Cool hack, just use JavaScript.
replies(2):
>>45718573
#
>>45718617
#
Cthulhu_
◴[
27 Oct 25 08:41 UTC
]
No.
45718617
[source]
▶
>>45718527
#
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
◴[
27 Oct 25 12:40 UTC
]
No.
45720349
[source]
▶
>>45718617
#
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!
ID:
GO
↑