Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Compile JavaScript + Flow into asm.js (WIP)

NotificationsYou must be signed in to change notification settings

RReverser/babel-plugin-asm-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiles statically typed ES6 (Flow-flavoured) module into asm.js while preserving ES6 module interface. Still a subset of JavaScript, but much more suitable for hand-writing (so that you don't need to use C/C++ -> Emscripten -> asm.js for maths)

Work in progress.

Currently supported:

  • ES6import and namedexport
  • automaticvar,let,const extraction and conversion
  • automatic function layout
  • function parameter annotations
  • function return type annotation
  • assignment with automatic type conversion
  • Flow type cast into asm.js type cast
  • automatic asm.js imports for stdlib and foreign references
  • automatic program layout
  • automatic wrapping into asm.js module withinitialize for passing ownheap

TODO:

  • bug fixing
  • global variable support
  • string support (literals are already converted to IDs, need to support operations)
  • better asm.js<->normal code communication
  • limited object and array support

Installation

$ npm install babel-plugin-asm-js

Usage

Via.babelrc (Recommended)

.babelrc

{"plugins": ["asm-js"]}

Via CLI

$ babel --plugins asm-js script.js

Via Node API

require("babel-core").transform("code",{plugins:["asm-js"]});

About

Compile JavaScript + Flow into asm.js (WIP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp