Wasocaml: compiling OCaml to WebAssembly - Inria - Institut national de recherche en sciences et technologies du numérique
Pré-Publication, Document De Travail Année : 2023

Wasocaml: compiling OCaml to WebAssembly

Résumé

The limitations of JavaScript as the default language of the web led to the development of Wasm, a secure, efficient and modular language. However, compiling garbage-collected languages to Wasm presents challenges, including the need to compile or reimplement the runtime. Some Wasm extensions such as Wasm-GC are developed by the Wasm working groups to facilitate the compilation of garbage-collected languages. We present Wasocaml, an OCaml to Wasm-GC compiler. It is the first compiler for a realworld functional programming language targeting Wasm-GC. Wasocaml confirms the adequacy of the Wasm-GC proposal for a functional language and had an impact on the design of the proposal. Moreover, the compilation strategies developed within Wasocaml are applicable to other compilers and languages. Indeed, two compilers already used a design similar to our. Finally, we describe how we plan to handle the C/JavaScript FFIs and effects handlers, in order to allow developers to easily deploy programs mixing C, JavaScript and OCaml code to the web, while maintaining good performances.
Fichier principal
Vignette du fichier
main.pdf (225.12 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-04311345 , version 1 (28-11-2023)
hal-04311345 , version 2 (13-12-2023)
hal-04311345 , version 3 (01-09-2024)

Licence

Identifiants

  • HAL Id : hal-04311345 , version 3

Citer

Léo Andrès, Pierre Chambart, Jean-Christophe Filliâtre. Wasocaml: compiling OCaml to WebAssembly. 2023. ⟨hal-04311345v3⟩
322 Consultations
158 Téléchargements

Partager

More