View Item 
        •   Utrecht University Student Theses Repository Home
        • UU Theses Repository
        • Theses
        • View Item
        •   Utrecht University Student Theses Repository Home
        • UU Theses Repository
        • Theses
        • View Item
        JavaScript is disabled for your browser. Some features of this site may not work without it.

        Browse

        All of UU Student Theses RepositoryBy Issue DateAuthorsTitlesSubjectsThis CollectionBy Issue DateAuthorsTitlesSubjects

        Towards a WebAssembly Backend for MicroHs

        Thumbnail
        View/Open
        Thesis.pdf (1.446Mb)
        Publication date
        2025
        Author
        Apoorva Anand, Apoorva
        Metadata
        Show full item record
        Summary
        This thesis presents the design and implementation of a WasmGC backend for MicroHs, a lightweight Haskell compiler. The backend targets modern WebAssembly runtimes with native garbage collection support. Functional languages require a garbage collector; we can either implement our own or reuse the one provided by the host system. Reusing the host's garbage collector reduces the binary size. To this end, we develop a WasmGC encoding of SK combinators, the theoretical foundation of MicroHs, and implement a reduction machine entirely in WasmGC. The runtime system is realized in two ways: as handwritten WasmGC code and through code generation using a Haskell-based DSL. The code generation automates the encoding of SK reduction rules, whereas the handwritten part of the runtime system forms the rest of it. Together, these components form our native WasmGC runtime. Unfortunately, we were unable to port enough of MicroHs' runtime to be able to run any Haskell programs, although the approach demonstrates potential. Using the MicroHs test suite, median binary sizes were measured as 45.3 KB for WasmGC, 161.2 KB for C, and 203 KB for Wasm 1.0.
        URI
        https://studenttheses.uu.nl/handle/20.500.12932/50545
        Collections
        • Theses
        Utrecht university logo