Skip to content

List of languages that compile to JS

Shriram Krishnamurthi edited this page Dec 1, 2013 · 319 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.
    • LiveScript is a fork of Coco that is much more compatible with CoffeeScript, more functional, and with more features.
  • IcedCoffeeScript A CoffeeScript dialect that adds support for await and defer keywords which simplify async control flow.
  • 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.
  • Contracts.coffee A dialect of CoffeeScript that adds built-in support for contracts.
  • Uberscript, a CoffeeScript fork that adds type annotations which are compiled to Google closure compiler type annotation comments.
  • ToffeeScript A dialect of CoffeeScript that support Asynchronous Syntax and Regexp operator =~
  • Caffeine A dialect of CoffeeScript that support packages and classes import, useful for browser applications
  • heap.coffee A dialect of CoffeeScript that offers a C-like type system with manual memory management
Friends (philosophically related)
  • Kaffeine Enhanced Syntax for JavaScript.
  • Jack Making programming playful.
  • move A simpler and cleaner programming language.
  • Moescript Indent-based language
  • pogoscript language that emphasises readability, handles async control flow nicely, is friendly to domain specific languages and compiles to regular JavaScript
  • LispyScript A JavaScript with Lispy syntax and Macros.
  • Wisp Wisp is a homoiconic JavaScript dialect with clojure syntax, s-expressions and macros.
  • Hot Cocoa Lisp A Lisp-like language that compiles to JavaScript.
  • Sibilant JavaScript with a lisp.
  • Ham looks very similar to Javascript at first, but offers (hopefully) many useful features
  • GorillaScript Compile-to-JavaScript language designed to empower the user while attempting to prevent some common errors, offers Macros and optional Typing
  • RedScript Ruby flavored JavaScript.
  • Daonode functional logic solver, compiler.

JavaScript Extensions

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.
  • Local.js uses Web Workers to sandbox applications and a RESTful messaging protocol called HTTPL (HTTP Local) to communicate between them
Static typing
  • Some of the ones listed below are also statically typed, such as mobl, GWT, JSIL, NS Basic, and Haxe.
  • Dart by Google. C/Java-like syntax with optional typing.
  • TypeScript by Microsoft. Typed superset of JavaScript.
  • TeJaS from Brown PLT. Types for JavaScript (itself).
  • asm.js - subset of JavaScript that can be used as a low-level, efficient target language for compilers. Now included in Firefox.
  • JavaScript++ adds pluggable type system and type inference, among other features
  • 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.
  • Roy tries to meld JavaScript semantics with some features common in static functional languages
  • Elm type-safe functional language that compiles to HTML, CSS, and JavaScript.
  • JSX a faster, safer, easier alternative to JavaScript
  • Este.js Google Closure written in CoffeeScript statically compiled to JavaScript (and much more).
  • Swym - statically typed, with type inference and generics
  • Typecast.js - Javascript platform for statically typed variables without a custom compiler.
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.
  • NarrativeJS JavaScript extension with asynchronous futures and promises.
  • jwacs JavaScript With Advanced Continuation Support.
  • Wind.js Wind.js is an advanced library which enable us to control flow with plain JavaScript for asynchronous programming (and more) without additional pre-compiling steps.
  • TameJS adds new keywords 'await' and 'defer'
  • async.js Async utilities for node and the browser
  • Continuation.js A lightweight JIT compiler for simplifying asynchronous JavaScript programming with no runtime dependences. It supports both Node.js and browser-side JavaScript and is compatible with CoffeeScript (also TypeScript, and any other scripts compile to js).
  • Kal makes asynchronous programming easy and clean by allowing functions to pause and wait for I/O, replacing an awkward callback syntax with a clean, simple syntax
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.
  • Mochiscript Object-oriented JavaScript with syntactic sugar. Released as a Ruby gem.
  • jangaroo AS3 (ActionScript) to JavaScript.
  • Flapjax Event-driven, reactive evaluation.
  • jLang adds object oriented syntax, namespaces, operators overriding
  • Restrict Mode
  • TIScript gentle extension of JavaScript
  • Six Six is a language super-set of JavaScript that enables new syntactic features from the 6th edition of ECMAScript to be used, through a transpiler, in your scripts today.
  • js-- Javascript subset for interactive/visual programming.

Ruby

  • Opal Ruby to Javascript compiler.
  • HotRuby Runs opcode, compiled by YARV on Ruby inside a web browser or in Flash.
  • ColdRuby Compiler of Ruby 1.9 MRI bytecode, and a runtime written in JavaScript to aid in execution of Ruby code.
  • rb2js Converts Ruby to JavaScript.
  • RubyJS A successor to rb2js
  • Red Writes like Ruby and runs like JavaScript
  • Quby Used for game coding site, open source.
  • 8ball ruby-to-javascript source-to-source transformer

Python

  • PYXC-PJ [CS friend] Python to JS. Can generate a (line/col)-number mappings file.
  • Pyjamas Python to JS.
  • Pyjaco Python to JavaScript compiler with module support.
  • Pyjs Python to (readable) JS.
  • Skulpt Python. Client side.
  • PyCow Python to MooTools JS.
  • PyvaScript Python-like syntax to JavaScript.
  • RapydScript Improved PyvaScript
  • Brython browser python
  • PythonScript Python-like compiled to Javascript
  • pythonscript Python compiled to readable Javascript using the AST. (proof of concept)

Perl

  • Perlito Project to compile Perl 5/6 to JavaScript, Ruby, SBCL, and Go.

Java/JVM

  • 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.
  • Strongly-Typed JavaScript (STJS) - JavaScript code generator from Java source. It is built as a Maven plugin.
  • BicaJVM JavaScript implementation of JVM.
  • Doppio JVM interpreter on Coffeescript.
  • Processing, a Java-based visualization language that interprets to JavaScript.
  • Kotlin has a nascent JavaScript backend.
  • Ceylon a modular static-typed JVM language compilable to JavaScript.
  • GrooScript a framework to convert Groovy code to Javascript.
  • node-jvm java virtual machine in pure node.js

Scala

  • Scala.js A Scala to JavaScript compiler
  • js-scala JavaScript as an embedded DSL in Scala
  • scalagwt enhanced GWT (accepts jribble as well as Java) plus Scala to jribble.
  • JScala Scala macro that produces JavaScript from Scala code.

C#, F#, .NET related languages

  • jsc [experimental] Recompile your .NET assembly to JavaScript, ActionScript, PHP or Java.
  • JSIL MSIL (.NET bytecode) to Javascript
  • Script# Compiles C# to JS.
  • Prefix in development
  • Blade Visual Studio add-on for converting C# to JavaScript
  • SharpKit [commercial] C# to JavaScript Cross-Compiler
  • Saltarelle C# to JavaScript Compiler
  • FunScript F# to JavaScript compiler with JQuery etc. mappings through a TypeScript type provider
  • Pit F# to Javascript compiler
  • WebSharper Lets you compile F# to JS.
  • NemerleWeb Nemerle language compiled to JS.
  • Blue Storm F# to JavaScript (and some other languages).
  • JScriptSuite .NET to JavaScript compiler (cross browser API, client site controls and components).

Lisp, Scheme

  • BiwaScheme Scheme(R6RS) in JavaScript
  • ClojureScript Clojure to JS, the official version. Supports the majority of Clojure including persistent datastructures.
  • clojurejs Subset of Clojure to JS.
  • Chlorinejs A fork of ClojureJs with a port of clojure.core library.
  • wisp Homoiconic JS with clojure syntax, s-expressions & macros.
  • EdgeLisp A Lisp in the tradition of Common Lisp
  • Fargo Scheme in JavaScript
  • Moby Scheme A Scheme running in JS.
  • nconc scheme interpreter in javascript with stack-friendly tail calls and full call/cc
  • Parenscript Subset of Common Lisp to JS.
  • Ralph Lisp-1 dialect that compiles to JavaScript, inspired by Dylan
  • scheme2js Scheme to JavaScript.
  • 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
  • Whalesong Racket to JS compiler
  • Oppo A javascripter's lisp. Inspired by javascript, clojure and coffeescript. Compiler built using Jison.
  • Outlet A simple Lisp that supports CPS and in-browser stepping debugging, and other things. In development.

OCaml

Haskell

  • UHC (Utrecht Haskell Compiler) backend converts UHC core to JavaScript, allowing the compiling of Haskell code to JS.
  • ghcjs Compile normal Haskell into JS
  • jmacro Quasi-Quoted JS that you can insert Haskell values into (there is also shakespeare-js for that purpose), but also supports a more haskellish syntactic version of javascript.
  • https://github.com/aculich/lambdascript Compile a subset of Haskell into JS
  • YHC (York Haskell Compiler) backend, as above but with YHC core language.
  • jshaskell
  • haste
  • fay A proper subset of Haskell that compiles to JavaScript
  • forml A contemporary programming language intended to approximate the safety of Haskell and the expressiveness of Ruby.

Smalltalk

  • Amber - formerly known as Jtalk
  • Clamato a Smalltalk dialect that is designed to operate within the JavaScript runtime.
  • Silver Smalltalk [commercial?] Smalltalk in the browser. (Still active?)
  • Lively Kernel - smalltalk/squeak-like development environment in the browser. See also Avocado, built on top of it.
  • Little Smallscript Little Smalltalk to Javascript translator.

C/C++

  • Emscripten LLVM to JavaScript compiler. LLVM is "an aggressive open-source compiler for C and C++," as well as other languages.
  • Duetto LLVM to JavaScript compiler. "compiles C++ applications to binary code and Javascript"
  • maja vala (gobject) to javascript
  • Clue C language compiler to different runtimes (Lua, JS, Perl 5, C, Java, CL).
  • LLJS typed dialect of JavaScript that offers a C-like type system with manual memory management
  • Mandreel Can convert C++ and Objective-C applications based on OpenGL ES to JavaScript or Action Script 3 web application.

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

Pascal

  • Smart Mobile Studio [commercial] Object Pascal to JavaScript compiler and Delphi like IDE that brings classes, inheritance, interfaces and more to JavaScript
  • Elevate Web Builder [commercial] Visual development tool for web applications that compiles standard Object Pascal source code into JavaScript

Go

  • Go2js Line-to-line translator from Go to 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).
  • LZX (Laszlo XML) LZX is OpenLaszlo's declarative user interface language, which is compiled into JavaScript 2 as an intermediary format, and further compiled into either JavaScript 1.5 or ActionScript 3.
  • Clue and jsc above target multiple runtimes in addition to javascript
  • Nimrod compiles to C and JavaScript
  • Monkey [commercial] compiles to several platforms (JavaScript, ActionScript 3, C++, Java, CSharp).

Tierless languages (produce both client & server)

  • Fun A programming language for realtime webapps - compiles to client-side and server-side JS.
  • Ur In the tradition of ML and Haskell.
  • 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
  • Opa write your complete application in just one language, and the compiler will transform it into a self-sufficient executable

Visual programming tools

  • Waterbear
  • Snap - Javascript of BYOB, which is a fork of Scratch
  • ScriptBlocks
  • Illumination [Commercial] Visual, cross-platform tool creates apps for Android, iPhone, iPad, Desktops and HTML5 or Flash websites. The I language underlies the tool.
  • JsMaker visual JavaScript programming
  • Meemoo flow-based visual programming framework for hackable web apps
  • NoFlo JavaScript implementation of Flow-Based Programming. Programs (network graphs) can be visually created with DrawFBP
  • Blockly web-based, graphical programming language. Users can drag blocks together to build an application
  • Maeda Block - visual game programming language powered by enchant.js and Google Blockly. See also the Japanese version.

SQL

Others

  • Oia A port of Io to JavaScript.
  • Plaid A gradually-typed, typestate-oriented language designed as a better Java.
  • Quixe a Glulx VM interpreter written in Javascript
  • Gnusto a Z-Machine VM interpreter written in Javascript
  • Logo Interpreter
  • p2js perl to javascript converter
  • Reb2Static Rebol to Javascript
  • RPN Interpreter for a language with a Reverse Polish Notation syntax.
  • phype run PHP code directly in your browser
  • jsForth
  • wForth
  • Agda a dependently typed functional programming language and mechanized proof assistant
  • XLCC Interpret LCC into Javascript on node
  • SMLtoJs SML to Javascript compiler
  • lua.js Lua parser
  • Brozula Lua bytecode interpreter
  • Pygmy a dynamic language that compiles to Javascript designed to be readable but concise enough to be competitive in code golf.
  • browserl An Erlang Emulator written in javascript
  • ErlyJS (abandoned) Javascript to Erlang compiler
  • Topaz Rebol inspired language on top of Javascript
  • NGN APL an APL-to-JavaScript compiler written in CoffeeScript
  • CobolScript COBOL language compiler to Javascript.
  • Idris Dependently typed functional language with a JavaScript backend.
  • dogescript

Tools for Compiler Writers

JavaScript Parsers and Extensions

Javascript Optimizers
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
  • languagejs - PEG parser written in JavaScript with first class errors
  • Canopy Self-hosting PEG parser compiler for JavaScript, influenced by Ruby parser generators such as Treetop and Citrus
  • JS/CC LALR(1) parser generator
  • jsparse PEG by Grandmaster Chris Double
  • 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, Semantics

See Also

  • jswiki another github wiki with listings of various javascript libraries