2 ms·
I can't speak for the author but I can share my experience from porting the Wren interpreter from C to Go as a hobby project: Writing an interpreter in Go is d
by skybrian 6y ago
I can't speak for the author but I can share my experience from porting the Wren interpreter from C to Go as a hobby project:
Writing an interpreter in Go is doable, but interpreters are both very CPU-intensive and built on variant data structures that need to be fast, and Go interfaces are the only data type available that does variants containing pointers. Overhead is high compared to C. You don't have low-level access to things like NaN-packing and you also don't have a JIT available at runtime to speed things up.
In many cases it's fast enough, but if you really need to write code in a different language that's both fast on a CPU-bound task and interoperates well with Go packages, a better approach might be to write a compiler that generates Go code.
It's a bit of a weak point, but for a specialized use case. Most code is either not that performance sensitive or can be written to operate on homogenous arrays.