Need help with rusty-typescript?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

yever
224 Stars 7 Forks Apache License 2.0 20 Commits 9 Opened issues

Description

A TypeScript compiler written in Rust

Services available

!
?

Need anything else?

Contributors list

# 400,126
F#
Vim
React
xstate
19 commits

Build Status Gitter

rusty-typescript

A TypeScript compiler written in Rust.

This is a very experimental project in its initial phase. Its goal is to create a WebAssembly implementation of TypeScript written in Rust.

Note that this is still a normal TypeScript compiler, compiling TypeScript code into JavaScript. It only leverages Rust and WebAssembly for better performance.

The approach taken here is to inline the WebAssembly binary into the JavaScript, and bundle everything into one TypeScript file (with type checking and linting disabled). This makes the result platform-independent (browser vs.

nodejs
) and easy to inject into the source code of TypeScript. This way, the new implementation can be verified against the same tests used by TypeScript itself.

How to run it?

You would need to have

nodejs
and
npm
installed. Running
npm install
will automatically install the Rust toolchain and wasm-pack (using wasm-pack-npm).

You might need to add the cargo binary directory to your

PATH
, like so:
sh
$ export PATH="$HOME/.cargo/bin:$PATH"

To build the WebAssembly artifact, run:

sh
$ npm run build

To inject the artifact into the TypeScript source code (included here as a git submodule), run:

sh
$ npm run inject

To run the TypeScript tests against the injected source code, run:

sh
$ npm test

Contribute

Contributions are very welcome. Just open an issue, add a comment to an existing one or fork and make a pull request.

Rewriting the entire codebase of TypeScript is a very big (and fun!) project. There is a lot to do and enough for whoever is interested in giving a hand. Join me and let's make it happen :)

rusty-typescript

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.