JSweet vs Kotlin/JS
JSweet
jsweet.orgKotlin/JS
kotlinlang.orgSide by side
| Figure | JSweet | Kotlin/JS |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | Yes | — |
| Web | Yes | Yes |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| iOS | Yes | — |
| Android | Yes | — |
| API | Yes | — |
| Self-hosted | Yes | — |
| Plans published | 1 | 1 |
| Spec score · Code Transpilers | 8.7 (#1) | 7.8 (#15) |
| Debugging | A debug mode is provided for debugging Java code in a browser. | The Kotlin Multiplatform Gradle plugin automatically generates JavaScript source maps for project builds. |
| ECMAScript targets | The compiler lists ES3 through ES6 as supported output targets. | The current Kotlin/JS implementation targets ES5, ES2015, and ES2020. |
| Integrations | The project lists Eclipse, Maven, and Gradle plugins, and names Angular, Cordova, Node.js, and Three.js among example integrations. | JetBrains provides Kotlin wrappers for React and other JavaScript frameworks, including support for React Redux, React Router, and styled-components. |
Plans
In their own words
JSweet
JSweet converts Java programs into TypeScript and JavaScript for browsers, mobile Web views, or Node.js. It uses Oracle's Java compiler alongside Microsoft's TypeScript compiler to generate type-checked JavaScript. The project describes the output as regular JavaScript that can work directly with JavaScript programs and libraries. Listed language features include Java-to-TypeScript syntax mapping, Java constructs, async/await, and ECMAScript targets from ES3 to ES6. JSweet lists support for more than 1,000 JavaScript libraries, frameworks, and plugins, packaged as Maven artifacts called candies. It provides Eclipse, Maven, and Gradle plugins, and names Angular, Cordova, Node.js, and Three.js among example integrations. Generated programs can use CommonJS, AMD, or UMD modules and run in browsers or Node.js. A debug mode supports debugging Java code in a browser. Setup instructions call for Git, Node.js, and Maven, then use Maven to generate JavaScript from a quickstart project. JSweet is open source and free, and is presented for Java developers building web and mobile HTML5 applications with JavaScript libraries and frameworks.
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.