Wasocaml: compiling OCaml to WebAssembly - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Communication Dans Un Congrès 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. CCS CONCEPTS • Software and its engineering → Compilers.

Mots clés

Fichier principal
Vignette du fichier
main.pdf (202.54 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)

Licence

Paternité

Identifiants

  • HAL Id : hal-04311345 , version 2

Citer

Léo Andrès, Pierre Chambart, Jean-Christophe Filliâtre. Wasocaml: compiling OCaml to WebAssembly. IFL 2023 - The 35th Symposium on Implementation and Application of Functional Languages, João Saraiva; João Fernandes, Aug 2023, Braga, Portugal. ⟨hal-04311345v2⟩
131 Consultations
62 Téléchargements

Partager

Gmail Facebook X LinkedIn More