Fork me on GitHub

They talk about us

Hacker News, InfoWorld.com, Developpez.net, JaxEnter.de, Programmez.com, PivotPoint.io, Prog.hu, Moongift.jp

JSweet: insights on motivations and design — A transpiler from Java to JavaScript

By Renaud Pawlak (JSweet.org)
Acknowledgments: EASYTRUST (easytrust.com)

Abstract: In this position paper, we present JSweet, a Java to JavaScript transpiler, which motivations originate in that its design takes advantage of the TypeScript transpiler to generate sound JavaScript code and APIs. We explain how JSweet uses the TSD repository to automatically generate all the JavaScript frameworks and libraries APIs in Java, so that they can be directly used from any JSweet-enabled Java program. We also explain how JSweet implements a two-layer design that allows Java and TypeScript to double-check the programs against the APIs. This double verification ensures that the source and transpiled programs are rigorously equivalent. We illustrate the capabilities of JSweet with two simple examples, showing the original and transpiled codes.

View/download: PDF


JSweet: how does it compare to TypeScript? — A focus on typing and semantics

By Renaud Pawlak (JSweet.org)

Abstract: JSweet is a Java to JavaScript transpiler, which relies on TypeScript for typing and JavaScript code generation. In this position paper, we discuss the JSweet typing and semantics by comparing them to TypeScript ones. We explain how the JSweet transpiler tweaks the Java language to support most features introduced by TypeScript, including typing features such as string types, union types, functional types, and object types. Also, we show how the transpiler generates JavaScript code that aims at mimicking the Java semantics, thus fixing some TypeScript semantic issues inherited from JavaScript. Finally, we highlight some strengths and weaknesses of JSweet compared to TypeScript, and we explain that besides some limitations, JSweet can be seen as a good alternative to TypeScript. It ensures a level of type safety similar to TypeScript, and adds the rigorous Java syntax and semantics to it, thus making JavaScript programming safer and more intuitive to Java programmers.

View/download: PDF

JSweet version 2 is now available!