Artigo Revisado por pares

From bytecode to JavaScript: the Js_of_ocaml compiler

2013; Wiley; Volume: 44; Issue: 8 Linguagem: Inglês

10.1002/spe.2187

ISSN

1097-024X

Autores

Jérôme Vouillon, Vincent Balat,

Tópico(s)

Web Data Mining and Analysis

Resumo

SUMMARY We present the design and implementation of a compiler from OCaml bytecode to JavaScript. The compiler first translates the bytecode into a static single‐assignment intermediate representation on which optimizations are performed, before generating JavaScript. We believe that taking bytecode as an input instead of a high‐level language is a sensible choice. Virtual machines provide a very stable API. Such a compiler is thus easy to maintain. It is also convenient to use, and it can just be added to an existing installation of the development tools. Already‐compiled libraries can be used directly, with no need to reinstall anything. Finally, some virtual machines are the target of several languages. A bytecode to JavaScript compiler would make it possible to retarget all these languages to Web browsers at once. Copyright © 2013 John Wiley & Sons, Ltd.

Referência(s)