A composable transpiler infrastructure for working with statically typed JavaScript and WebAssembly.
Esmbly is all about statically typed JavaScript. The goal is to:
- Be a useful tool for migrating between (and working with) different type systems.
- Explore different ways of collecting, transforming and utilizing type information in the JavaScript ecosystem.
- Lower the barrier for JavaScript developers that want to start experimenting and prototyping with WebAssembly by taking advantage of already existing type information in a code base.
- Transform a code base from Flow to TypeScript
- Turn your tests into types - generate TypeScript based on type information collected during test runs using the V8 profiler.
- Migrate from JSDoc to TypeScript - generate TypeScript based on your JSDoc comments.
- Use type information (Flow, TypeScript, JSDoc, V8) to output WebAssembly, Wat, Asm.js and AssemblyScript.
Esmbly is built around the concept of transformers. A transformer is responsible for transforming code from one type system to another (like for instance transforming Flow to TypeScript).
Esmbly is designed to be composable, meaning that you can chain multiple transformers to compose your own chain of transformations (as long as their input/output formats are compatible). For example, try chaining @esmbly/transformer-flow and @esmbly/transformer-wasm to turn your Flow code into a WebAssembly binary.
- @esmbly/transformer-flow:
Flow -> TypeScript
- @esmbly/transformer-jsdoc:
JSDoc -> TypeScript
- @esmbly/transformer-v8:
JavaScript + tests -> TypeScript
- @esmbly/transformer-wasm:
TypeScript -> WebAssembly, Wat, Asm.js, AssemblyScript
Read the Getting started guide for instructions on how to get started using Esmbly.
Try it out in the Esmbly version of WebAssembly Studio!
From JSDoc to TypeScript, Wat and WebAssembly in 15 seconds.
- Getting started
- Using the CLI
- Using the Flow transformer
- Using the JSDoc transformer
- Using the V8 Transformer
- Writing a custom rule
- Writing a custom transformer
- Add (Flow): Transforming a simple Flow program to WebAssembly by chaining
@esmbly/transformer-flow
and@esmbly/transformer-wasm
. - Add (JSDoc): Transforming a simple JavaScript program with JSDoc comments to WebAssembly by chaining
@esmbly/transformer-jsdoc
and@esmbly/transformer-wasm
. - Add (V8): Transforming a simple JavaScript program that is covered by a test suite to WebAssembly by chaining
@esmbly/transformer-v8
and@esmbly/transformer-wasm
. - Browser Example: Using Esmbly in the browser using Webpack. Uses
@esmbly/transformer-flow
and@esmbly/transformer-wasm
. - Custom Rule: Extending
@esmbly/transformer-flow
with a custom rule. - Custom Transformer: Writing a custom transformer.
- Conway's Game of Life: Transforming Conway's Game of Life (ported from the AssemblyScript project to JSDoc) to WebAssembly by chaining
@esmbly/transformer-jsdoc
and@esmbly/transformer-wasm
. - Insertion Sort: Transforming an insertion sort algorithm to WebAssembly by chaining
@esmbly/transformer-jsdoc
and@esmbly/transformer-wasm
. - Yarn/lockfile: Transforming a subset of yarn from Flow to TypeScript.
- Lodash: Transforming the entire lodash library to TypeScript based on JSDoc comments.
- ms: Transforming the entire ms package to TypeScript based on JSDoc comments.
- Pad: Transforming a string pad program to WebAssembly by chaining
@esmbly/transformer-flow
and@esmbly/transformer-wasm
. - Radians: Transforming a utility program for transforming between radians and degrees to WebAssembly by chaining
@esmbly/transformer-v8
and@esmbly/transformer-wasm
. - Repeat: Transforming a utility program for repeating strings to WebAssembly by chaining
@esmbly/transformer-v8
and@esmbly/transformer-wasm
.
All types of contributions are very much welcome. Check out our Contributing Guide for instructions on how to get started.