js_of_ocaml vs TeaVM
js_of_ocaml
ocsigen.orgTeaVM
teavm.orgSide by side
| Figure | js_of_ocaml | TeaVM |
|---|---|---|
| Price from | Free | — |
| Free plan | Yes | — |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | Yes |
| Linux | Yes | — |
| API | Yes | — |
| Plans published | 1 | 0 |
| Spec score · Code Transpilers | 8.4 (#5) | 6.7 (#28) |
| License | The repository lists GPL-2.0-or-later and LGPL-2.1-or-later with the OCaml linking exception as its licenses. | The project repository states that TeaVM is distributed under the Apache License 2.0. |
| Optimization | Whole-program compilation performs global dead-code elimination and cross-module optimizations to produce smaller and faster output. | TeaVM documents dead code elimination, devirtualization, and method renaming among its optimizer capabilities. |
| Support | The project asks users to report problems or questions through GitHub issues and include version details and a minimal reproducible example when possible. | The project lists [email protected] for contact and says users can report issues on its project issue tracker. |
Plans
In their own words
js_of_ocaml
js_of_ocaml compiles OCaml bytecode programs into JavaScript for browsers and Node.js. It works with an existing OCaml installation and does not require libraries to be recompiled. Installation is available through opam, while Dune supports separate compilation in development and whole-program compilation in release builds. Whole-program compilation performs global dead-code elimination and cross-module optimization. The library provides a typed bridge between OCaml and JavaScript, including PPX syntax for properties, methods, constructors and objects. Browser bindings cover the DOM, Fetch, WebSockets, WebGL, workers and typed arrays. Optional packages add Lwt support, TyXML, JSON derivation and an OCaml toplevel in the browser. Documented targets include Node.js 18 or later, QuickJS-NG and modern ECMAScript 2020 browsers, including Chrome 80+, Firefox 74+, Safari 13.4+ and Edge 80+. Requirements include OCaml 4.13–5.5, Dune 3.20 or later and Menhir. The project is free and open source.