Skip to content

List of languages that compile to JS

JeffreyZhao edited this page May 4, 2011 · 208 revisions

CoffeeScript Family (& Friends)

Family (share genes with CoffeeScript)
  • Coco A CoffeeScript dialect that aims to be more radical and practical, also acts as a test bed for features that get imported in CoffeeScript.
  • Parsec CoffeeScript CS based on parser combinators. The project's aim is to add static metaprogramming (i.e. macros + syntax extensibility) to Coffee Script (CS), similar to how Metalua adds such features to Lua. The resulting compiler, once merged with the official compiler, should be usable as a drop-in replacement for it.
Friends (philosophically related)
  • JS11 Beautiful like CoffeeScript but far more conventional, in case you have no interest in Ruby-like syntax. Also debugs line-for-line as JS.
  • Kaffeine Enhanced Syntax for JavaScript.
  • Jack Making programming playful.
  • move A simpler and cleaner programming language.

JavaScript

Security enforcing JavaScript
  • Caja Compiles ES5/strict to ES3 and supports object-capabilities
  • ADsafe Client-side static verifier and API, making third party scripts safe.
  • FBJS Facebook JavaScript, used for scripting FBML (Facebook Markup Language) gadgets.
  • Jacaranda Static verifier supporting object-capabilities.
  • Microsoft Web Sandbox Technology preview of securing web content through isolation.
  • Gatekeeper Microsoft Research project.
  • Dojo Secure Framework for building secure mashups.
Synchronous to Asynchronous JavaScript Compilers (CPS)
  • Streamline.js Uses underscore (_) to stand for callbacks. This fork preserves line numbers for debugging.
  • mobl The new language for programming the mobile web.
  • StratifiedJS JavaScript + structured concurrency. See also apollo on that site.
  • NarrativeJS JavaScript extension with asynchronous futures and promises.
  • jwacs JavaScript With Advanced Continuation Support.
  • Jscex Write simple JavaScript code, execute it asynchronously by compiling to monadic form. Works in any ECMAScript 3 engines directly.
JavaScript Language Extensions
  • ContextJS is an implementation of Context-oriented Programming for JavaScript.
  • Objective-J Shares with JavaScript the same relationship that Objective-C has with the C programming language: that of being a strict, but small, superset.
  • JS2 Object-oriented JavaScript with syntactic sugar (curry, foreach, property). Released as a Ruby gem.
  • jangaroo AS3 (ActionScript) to JavaScript.
  • Flapjax Event-driven, reactive evaluation.

Ruby

  • HotRuby Runs opcode, compiled by YARV on Ruby inside a web browser or in Flash.
  • rb2js Converts Ruby to JavaScript.
  • Red Writes like Ruby and runs like JavaScript
  • Quby Used for game coding site, not open source.
  • Opal Ruby to Javascript compiler.

Python

  • PYXC-PJ [CS friend] Python to JS. Can generate a (line/col)-number mappings file.
  • Pyjamas Python to JS.
  • Skulpt Python. Client side.
  • PyCow Python to MooTools JS.
  • PyvaScript Python-like syntax to JavaScript.

Java

  • GWT Google Web Toolkit, compiles java to javascript
  • Java2Script Eclipse Java to JavaScript compiler plugin and JavaScript version of SWT
  • j2js Java bytecode to JavaScript.

Lisp, Scheme

  • Parenscript Subset of Common Lisp to JS.
  • Sibilant JavaScript with a lisp.
  • Moby Scheme A Scheme running in JS.
  • scheme2js Scheme to JavaScript.
  • ClojureScript Translates code written in a very small subset of Clojure.
  • clojurejs Subset of Clojure to JS.
  • Scriptjure Library for generating JavaScript from Clojure forms.
  • Spock A Scheme to JavaScript compiler that uses Henry Baker's Cheney-on-the-MTA compilation strategy
  • Fargo Scheme in JavaScript

OCaml

Haskell

  • UHC (Utrecht Haskell Compiler) backend converts UHC core to JavaScript, allowing the compiling of Haskell code to JS.
  • YHC (York Haskell Compiler) backend, as above but with YHC core language.

Smalltalk

  • Clamato a Smalltalk dialect that is designed to operate within the JavaScript runtime.
  • Silver Smalltalk [commercial] Smalltalk in the browser.
  • JTalk An implementation of the Smalltalk language that runs on top of the JavaScript runtime.
  • Lively Kernel - smalltalk/squeak-like development environment in the browser

C/C++

  • Emscripten LLVM to JavaScript compiler.
  • mala vala (gobject) to javascript
  • Clue C language compiler to different runtimes (Lua, JS, Perl 5, C, Java, CL).

Basic

  • NS Basic/App Studio [commercial] Visual Basic-style BASIC to JavaScript compiler. Includes IDE. Targets iOS and Android.
  • qb.js An implementation of QBASIC in Javascript

Multitarget

  • Haxe compiles to several platforms (C++, Flash, JS, Neko, PHP).
  • Fantom Evolutionary object-oriented language emphasizing succinct and effective APIs (JVM, CLR, JS).
  • Clue C language compiler to different runtimes (Lua, JS, Perl 5, C, Java, CL).
  • jsc [experimental] Recompile your .NET assembly to JavaScript, ActionScript, PHP or Java.

Tierless languages (produce both client & server)

  • One Pot Application [free for non commercial] Industrial programming language for high-security distributed web applications.
  • Fun A programming language for realtime webapps - compiles to client-side and server-side JS.
  • Ur In the tradition of ML and Haskell.
  • WebSharper Lets you compile F# to JS.
  • mobl The new language for programming the mobile web.
  • E Compiles E to JS. E is a secure distributed persistent pure object language.
  • Sugar new programming language designed to replace JavaScript for client-side (and server-side) web development

Others

Static typed
  • Some of the ones listed above are statically typed, such as mobl, GWT, NS Basic, and Haxe.
  • Script# [commercial] Compiles C# to JS.
  • MileScript [commercial] A strongly-typed language similar to C# and Java, but which compiles to JS. free for non-profit, educational use.
  • Mascara [commercial] Enhances JavaScript with powerful features like classes, namespaces and type-checking.

Tools for Compiler Writers

Javascript Parser Generators
  • jison Bison in javascript, used by Coffeescript
  • OMeta/JS (source) metacompiler for many languages to many targets, including js.
  • PEG.js parser generator for JavaScript based on the parsing expression grammar formalism
  • Canopy Self-hosting PEG parser compiler for JavaScript, influenced by Ruby parser generators such as Treetop and Citrus. Depends on JS.Class library
  • JS/CC LALR(1) parser generator
  • jsparse
  • ReParse parser combinator library for Javascript like Haskell's Parsec
  • p4js Monadic parser library for JavaScript
  • JSGLR Scannerless, Generalized Left-to-right Rightmost (SGLR) derivation parser for JavaScript
  • antlr has a javascript target
  • Cruiser.Parse LL(k) parser
Javascript AST

Clone this wiki locally