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

Off topic: is it possible to build a JIT compiler for Go or does the runtime prevent that?


I think it's certainly possible. The Go compiler is AOT and there are Go interpreters (in various stages of completeness), it would be a matter of interpreting the application - finding hot functions in execution traces - and swapping them out with background-compiled versions.

Some work would be needed to keep the GC happy between interpreted and compiled functions, but no more complex than JS JITs have to do. Go's GC at least already has the capability to move objects, that's a help.

In reality, JITs are used to infer typing information that dynamic languages only discover at runtime. Go doesn't have this problem, and an AOT can probably discover stronger optimizations.


there's actually (the beginning of) an interpreter in Go, for Go, that consummes wasm :)

https://github.com/go-interpreter/wagon


Any language can have a JIT compiler, that is just an implementation detail.




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

Search: