Turbo Haskell (THC) is a JIT/AOT compiler and runtime that executes GHC Core on the JVM using Truffle and GraalVM. It implements the full set of GHC 9.14.1 prim-ops and relies on GHC for parsing, typechecking, desugaring, and Core optimizations; THC then compiles and runs that Core, supporting advanced features such as Template Haskell and Linear Haskell. THC can produce native images via GraalVM Native Image or run JIT-compiled, and it already compiles substantial real-world Haskell programs (pandoc, happy, alex and even GHC itself). Package resolution uses Cabal and supports multi-library packages including Backpack.
The runtime exposes rich polyglot FFIs to Python, Ruby, R, and JavaScript with zero-copy Text-to-Truffle string conversion for UTF-8, and runs C/C++ bits through Sulong (native-mode or managed-mode). Two Truffle backends (bytecode and AST) and support for GHC bytecode power evaluation; concurrency includes throwTo, asynchronous exceptions with resumable code, masking, normal Java threads or Project Loom-based lightweight green threads with an HEC-style executor. SIMD is handled via available prim-ops and the incubating Vector API with runtime species selection. Tail calls are kept hot via code-transformation loops, a Bloom-filter tracing mechanism and slow-path linking, with occasional stack compaction inspired by CHICKEN Scheme. With compressed oops and warmup, microbenchmarks ranged from ~3× faster to ~3× slower, typically ~10-20% slower than GHC; some regressions exist while broadening feature coverage. Source is on github.com/ekmett/thc and development happens on IRC.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.