All Projects → china-liji → Rexjs

china-liji / Rexjs

Licence: mit
Rexjs is a faster and smaller JavaScript(ES6+) compiler!

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects
es2015
71 projects

Labels

Projects that are alternatives of or similar to Rexjs

Pyterminfo
A terminfo-to-python cross compiler
Stars: ✭ 5 (-66.67%)
Mutual labels:  compiler
Orcc
Open RVC-CAL Compiler
Stars: ✭ 26 (+73.33%)
Mutual labels:  compiler
Lyca
programming language compiler w/ llvm
Stars: ✭ 9 (-40%)
Mutual labels:  compiler
Modiscript
Acche din aa gaye
Stars: ✭ 888 (+5820%)
Mutual labels:  compiler
Viper
[WIP] A Pythonesque language with a design that focuses on efficiency and expressiveness. Compiles to WebAssembly
Stars: ✭ 23 (+53.33%)
Mutual labels:  compiler
Fly Coffee
☕️ Fly plugin for CoffeeScript
Stars: ✭ 7 (-53.33%)
Mutual labels:  compiler
Rustc Dev Guide
A guide to how rustc works and how to contribute to it.
Stars: ✭ 789 (+5160%)
Mutual labels:  compiler
Kaleidoscope
Haskell LLVM JIT Compiler Tutorial
Stars: ✭ 870 (+5700%)
Mutual labels:  compiler
Diez
The Design Token Framework — Adopt a unified design language across platforms, codebases, and teams
Stars: ✭ 928 (+6086.67%)
Mutual labels:  compiler
Shivyc
C compiler created in Python.
Stars: ✭ 845 (+5533.33%)
Mutual labels:  compiler
Gccrs
GCC Front-End for Rust
Stars: ✭ 875 (+5733.33%)
Mutual labels:  compiler
Radon
A scripting language.
Stars: ✭ 22 (+46.67%)
Mutual labels:  compiler
Hamler
Haskell-style functional programming language running on Erlang VM.
Stars: ✭ 840 (+5500%)
Mutual labels:  compiler
Grin
GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.
Stars: ✭ 834 (+5460%)
Mutual labels:  compiler
Dugong
Minimal State Store Manager for React Apps using RxJS
Stars: ✭ 10 (-33.33%)
Mutual labels:  compiler
Tvm
Open deep learning compiler stack for cpu, gpu and specialized accelerators
Stars: ✭ 7,494 (+49860%)
Mutual labels:  compiler
Ldc
The LLVM-based D Compiler.
Stars: ✭ 937 (+6146.67%)
Mutual labels:  compiler
Ferret
Ferret is a free software lisp implementation for real time embedded control systems.
Stars: ✭ 878 (+5753.33%)
Mutual labels:  compiler
Potterscript
/x/pel/e/r/mus
Stars: ✭ 12 (-20%)
Mutual labels:  compiler
Cfl
a Compileable statically typed Functional programming Language
Stars: ✭ 7 (-53.33%)
Mutual labels:  compiler

Rexjs is a faster and smaller JavaScript(ES6+) compiler!


中文

Link

Install

  • NPM
npm install rexjs-api
  • Git
git clone https://github.com/china-liji/Rexjs.git
  • Download

Zip

rex.min.js - 250KB

rex-api.min.js - 247KB

rex-browser-helper.min.js - 18KB


Faster and Smaller

./dist/rex.min.js[1.7.1] only 250KB, smaller than others.


Usage

Web

<script src="./dist/rex.min.js"></script>

<!-- set the "type" attribute to define a module -->
<script type="text/rexjs">
	import "./module.js";

	export default class {};
</script>

<!--
	also, set the "src" attribute to reference a module,
	and add the "data-sourcemaps" attribute to enable sourcemaps.
-->
<script src="./module.js" type="text/rexjs" data-sourcemaps></script>

cross browser: ChromeFirefoxSafariIE9+.

Nodejs

  • ./ext.js
import path from "path";

export default function(filename){
	return path.parse(filename).ext;
};
  • ./index.js
import ext from "./ext.js";

// output ".js"
ext(__filename);
  • Command Line
rexjs ./index.js

Rexjs API

  • JavaScript
// import "rexjs-api" module

// Nodejs
let Rexjs = require("rexjs-api");

// Web Worker
importScripts("./dist/rex-api.min.js");
let Rexjs = self.Rexjs;

// Web: <script src="./dist/rex.min.js"></script>
let Rexjs = window.Rexjs;


// initialize parser
let es5Code = "", parser = new Rexjs.ECMAScriptParser();

// parse module from a file
parser.parse(
	// init file
	new Rexjs.File(
		// filename
		"./filename.js",
		// source
		"class Car {}"
	)
);

// returning the generated code
es5Code = parser.build();
  • HTML

This file provides generated code API, so reference it before run generated code in your browser.

<script src="./dist/rex-browser-helper.min.js"></script>

Other Packages


Thanks!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].