Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I work on the D2 project ([0]) and we switched from other Javascript runners (v8go) to Goja. Using a JS runtime with a dependency on cgo means your Go program loses the (huge) benefit of cross-compiling to different architectures, since at build time it gets linked to the current system's libc.

If you're interested in some production code with Goja, this is our code for calling RoughJS ([1]) from Go in order to produce the hand-drawn diagram look: [2]

[0] https://github.com/terrastruct/d2

[1] https://roughjs.com/

[2] https://github.com/terrastruct/d2/blob/master/d2renderers/d2...



It is quite easy to cross-compile cgo program to most architectures - just use Zig for this:

  CC="zig cc -target aarch64-linux"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: