Write certain operations (like math- or string-heavy functions) in c and bundle that as a shared library. AFAIK this is what vscode does and why it runs so fast.
Could you point to a resource or a doc? Would it be possible to do something like that but in Go?
I'm not quite sure how it works in javascript, but I would look up javascript cffi or electron cffi or something like that to find how to do it. As for go, it might be possible, but it'll definitely be harder. You'll have to find how to expose a c api to your go code.
You could do it via Node.js native modules.
I write in rust, look into native extension, nodejs