I have been wondering, what prevents the development of an efficient virtual machine like JVM or PyPy for Haskell (except maybe development effort)? Is it the language structure? I think languages, that are harder to interpret efficiently (like Python, being very dynamic), already have decent VMs.
Also, if nothing is obstructing such an implementation, would STG be a good target “bytecode”, since all optimizations are done on Core?
Are there any articles or blog posts that discuss this topic?
EDITs:
- I am aware of HaLVM, but I don’t think it is what I mean.
- I am also aware of
runhaskell, but it is not efficient at all.
What prevents an efficient Haskell virtual machine?
Nothing – there already has been one, Daan Leijen’s LVM. It was efficient enough to be used for the runtime system of Helium (the Haskell “teaching language” from Utrecht University).
That said I don’t know if it is used these days, so the question “What prevents an efficient Haskell virtual machine?” could be answered as manpower, continuous investment, etc. When Haskell already has a good compiler, a good VM is a luxury as Paulo Pinto noted already.