Content area
Self-hosting represents a significant milestone in the evolution of a programming language, indicating its semantic maturity and offering practical advantages in portability and flexibility. While self-hosting is traditionally achieved through meta-circular interpreters or custom compilers, the viability of using meta-tracing Just-in-Time (JIT) compilers for this purpose in full-scale functional languages remains underexplored. This dissertation investigates this open question by implementing full self-hosting Racket on Pycket, a meta-tracing JIT compiler generated on the RPython framework. We integrate Racket’s runtime subsystems into Pycket using linklets–formally specified compilation units that enable self-hosting. To support and clarify this integration, we present formal operational semantics for linklets, validated via both Racket & Pycket reference implementations and a PLT Redex model. Our evaluation identifies specific performance challenges fundamental to self-hosting on meta-tracing, such as overspecialized traces and increased Garbage Collection (GC) overhead. We propose and explore targeted approaches to address these challenges, including methods to guide the tracer away from inefficient trace generation and a hybrid evaluation model combining CEK and stack-based interpreters to reduce memory overhead. Beyond investigating the feasibility of efficient self-hosting on meta-tracing JIT compilers, our findings offer insights into languageruntime co-design, suggesting strategies for implementing high-level language features without compromising run-time performance, thereby opening new avenues for further research into efficient language implementation techniques.