Skip to content
SPECIFICTION
Get listed

js_of_ocaml vs Kotlin/JS

js_of_ocaml

ocsigen.org

Kotlin/JS

kotlinlang.org

Side by side

Figurejs_of_ocamlKotlin/JS
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYesYes
Windows—Yes
macOS—Yes
LinuxYesYes
APIYes—
Plans published11
Spec score · Code Transpilers8.4 (#5)7.8 (#15)
Purposejs_of_ocaml compiles OCaml bytecode programs to JavaScript for use in browsers and Node.js.Kotlin/JS transpiles Kotlin code, the Kotlin standard library, and compatible dependencies to JavaScript.
SupportThe project asks users to report problems or questions through GitHub issues and include version details and a minimal reproducible example when possible.The Kotlin documentation directs users to the #javascript channel in Kotlin Slack to discuss Kotlin/JS with the community and team.

Plans

js_of_ocaml

  • js_of_ocamlFree

js_of_ocaml pricing →

Kotlin/JS

  • Kotlin/JSFree

Kotlin/JS pricing →

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.

Visit ocsigen.org

Kotlin/JS

Kotlin/JS is a Kotlin compiler target that converts Kotlin code, the Kotlin standard library, and compatible dependencies into JavaScript. Projects can target browsers or Node.js, including server-side and serverless applications. It supports ES5, ES2015, and ES2020 output, as well as ESM, CommonJS, UMD, and AMD modules. Projects use the Kotlin Multiplatform Gradle plugin for configuration, bundling, and JavaScript dependencies from npm. Kotlin/JS can share logic between web frontends and JVM backends, or across Android, iOS, and web clients. Kotlin wrappers are available for React and other JavaScript frameworks, including React Redux, React Router, and styled-components. Browser tests can use Karma or an experimental browser testing DSL; Node.js projects use Mocha. The documentation notes that Karma is deprecated and is not expected to receive new features or bug fixes. The Gradle plugin generates JavaScript source maps for builds. Kotlin/JS is open source and free at free, and is listed for Linux, macOS, web, and Windows.

Visit kotlinlang.org