Skip to content

A curated list of awesome transpilers. aka source-to-source compilers

License

Notifications You must be signed in to change notification settings

milahu/awesome-transpilers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Awesome Transpilers

By Target Language

Golang

  • c2go A tool for transpiling C to Go.
  • Grumpy Grumpy is a Python to Go source code transcompiler and runtime.

Java

  • VOC A transpiler that converts Python code into Java bytecode.

JavaScript

  • Shift.JS Swift to JavaScript transpiler.
  • ElixirScript Converts Elixir to JavaScript.
  • GopherJS A compiler from Go to JavaScript for running Go code in a browser.
  • Dart2js Use the dart2js tool to compile Dart code to deployable JavaScript.

Transpilers

TypeScript Compiler

Babel

eslint

Nim

ClojureScript

jscodeshift

ast-grep

c2rust

andrei-markeev/ts2c

OneLang

cheerp

Haxe

QQuick/Transcrypt

winemaker

Js2Py

Fennel

Cito

TypeScriptToLua

jingweno/godzilla

cincheo/jsweet

google/j2cl

Pebaz/nimporter

pseudo-lang

  • https://github.com/pseudo-lang/pseudo - 700 stars
  • one to many
  • generate readable code
  • help with automated translation for cases like algorithm generation, parser generation, refactoring, porting codebases
  • written in: Python
  • compiles from: Pseudo
  • compiles to: Python, JavaScript, Go, C#, C++, Ruby
  • last commit: 2021

LingDong-/wax

TypeScript2Cxx

putout

webcrack

wakaru

jsxx

ben-sb/obfuscator-io-deobfuscator

StaticScript

ts-llvm

muta-minits

transpyle

speedy.js

futurGH/ts-to-jsdoc

ccxt/crosspile

bash2py

ccxt/ast-transpiler

sebbekarlsson/typescript

sebbekarlsson/tscc

andrejusk/typescript-compiler

yakir22/ts2cpp

duncanhorn/ts2cpp

quadramadery/js2py

tython

7HR4IZ3/es62py

prometeo

py2many

pyo3

ts2nim

clojurec

hissp

kalai

Cerberus X Trans

roman01la/javascript-to-clojurescript

basilisp

Kotlift

andreikop/cpp2python

seasnake

Progsbase

TODO what exactly is this? a transpiler service?

  • https://www.progsbase.com/
  • "Job Payments: You can create programming jobs using the progsbase client. Create payments here to reward developers who implement a solution to your job."
  • closed source
  • Free Community Plan: convert TypeScript, Java, C, C++, JavaScript, C#, PHP, Python, Visual Basic, Swift, LibreOffice Basic, Ruby, Visual Basic
  • written in: Java, Progsbase
  • compiles from: Java
  • compiles to: Java, C, C++, JavaScript, C#, R, PHP, Python, Visual Basic
  • since: 2018

jtransc

specs-feup/clava

RapidFingers/Craxe

Ranger

https://github.com/terotests/Ranger - 5 stars

  • written in: JavaScript
  • self hosting
  • compiles from: Ranger?
  • compiles to: JavaScript, Java, Go, Swift, PHP, C++, C#, Scala
  • last commit: 2018

cxx2cs

https://sourceforge.net/projects/cxx2cs/

  • compiles from: C++
  • compiles to: C#
  • last commit: 2015

J2CL

https://github.com/google/j2cl - 1K stars

GWT

SequalsK

python scripts to python modules

lezer-parser-import-tree-sitter-scanner

Transpiler Frameworks

can be used for all languages

comby

JetBrains MPS

rose compiler

jarble/transpiler

  • https://github.com/jarble/transpiler - 400 stars
  • translates a small subset of several programming languages into several others
  • translate several metasyntax notations, such as EBNF and ABNF
  • experimental "proof-of-concept," so it can only translate relatively simple programs
  • A major goal of this project is to translate TypeScript and JavaScript to other languages that compile to C or native code. For example, it's possible to translate a subset of TypeScript to Zig
  • written in: JavaScript
  • languages: JavaScript, Prolog, C, C#, PHP, Python, Lua, Perl, Haskell, Fortran, Java, OCaml, GLSL, ...

Rascal

true-grue/raddsl

LangTrans

codeworker

SemanticDesigns DMS Toolkit

  • https://www.semanticdesigns.com/Products/DMS/DMSToolkit.html
  • Software Reengineering Toolkit
  • closed source
  • languages: C++, Java, COBOL, SQL, HTML, Verilog, ...
  • written in: PARLANSE = parallel language. As an example, the attribute evaluation process is automatically parallelized, and can often provide a linear speedup on an N-way SMP system.

Code generators

Partial evaluators

aka: partial evaluation, code optimizers, code optimization, dead code elimination, tree shaking, code compression, code minification

JavaScript

SVG

CSS

Machine Learning

ChatGPT by OpenAI

  • https://chat.openai.com/
  • works online
  • requires login
  • limitation: can translate up to 31523 characters of code = about 30 KByte, so large inputs must be splitted into smaller chunks
  • start the chat with: can you translate from some_input_language to some_output_language?
    • can you translate from javascript to python?
    • can you translate from python to javascript?
    • ...
  • chatGPT will also transform symbol names, for example from camelCase in javascript to snake_case in python. this is hard to disable. you can ask "can you translate ... and preserve the original symbol names?" but then the output is truncated after 3K characters
  • on large inputs, chatGPT will return an interpretation of what the code is doing
    • answer: yes. can you translate the code to some_output_language?
      • yes. can you translate the code to python?
      • yes. can you translate the code to javascript?
      • ...
    • the output will pause, then click: continue generating
  • languages: many
  • based on Codex
    • what language model is used by chatgpt to translate between programming languages?
      • As of my last update in January 2022, ChatGPT does not directly translate between programming languages. However, OpenAI has developed models capable of code generation and understanding code in various programming languages, such as Codex, which powers GitHub Copilot. These models are trained on large datasets of code and natural language to understand and generate code snippets based on human-written descriptions or code prompts. While ChatGPT itself may not directly perform programming language translation, it can be used in conjunction with such code generation models to facilitate communication or provide assistance in programming-related tasks.

code converter by codingfleet

  • https://codingfleet.com/code-converter/python/
  • works online
  • requires login for 5000 characters, otherwise only 1000 characters
  • https://codingfleet.com/pricing/
    • free account: 5K characters per request, 10 requests per month
    • pro account: 32K characters per request
      • 5 usd / month = 50 requests per month
      • 10 usd / month = 200 requests per month
      • 24 usd / month = 1000 requests per month
    • unlimited account: 200 usd / year: 64K characters per request
  • Languages: ABAP, APL, Ada, Assembly, Bash, C, C#, C++, COBOL, Clojure, CommonLisp, Crystal, Dart, Elixir, Elm, Erlang, F#, Fortran, Go, Groovy, Haskell, Java, Javascript, Julia, Kotlin, Lua, MATLAB, Nim, Node.js, OCaml, Objective-C, PHP, Pascal, Perl, PowerShell, Prolog, R, Ruby, Rust, SAS, SQL, Scala, Scheme, Swift, TypeScript, VHDL, Verilog, Zsh
    • Databases: BigQuery, IBM, Db2, MySQL, PL/SQL, PostgreSQL, Redshift, SQLite, Snowflake, T-SQL
    • Web Scraping: BeautifulSoup, Mechanize, Playwright, Puppeteer, Scrapy, Selenium
    • Web Programming: ASP.NET, Angular, CherryPy, Django, Express.js, FastAPI, Flask, Laravel, Pyramid, Rails, React, Spring, Symfony, VueJS
    • Deep Learning: Caffe, JAX, Keras, MXNet, PyTorch, TensorFlow, Theano

TransCoder by Facebook

OPT by Facebook

InCoder by Facebook

CodeGen by Salesforce

CodeT5 by Salesforce

PolyCoder

GPT-3 by OpenAI

  • license: closed source (OINO = open in name only)
  • parameters: 175B
  • architecture: auto-regressive model for next token prediction
  • release: 2020-06-11
  • price: 0.06 USD / 1K tokens - https://openai.com/api/pricing/

CodeParrot

  • https://huggingface.co/codeparrot
  • CodeParrot is a GPT-2 model trained to generate Python code
  • parameters: 1.5B
  • architecture: GPT-2
  • Code generation with: CodeParrot (1.5B), InCoder (6B) and CodeGen (6B)
  • trained on: GitHub Code (32 programming languages), ...

GPT-Neo

  • trained on: The Pile
  • parameters: 2.7B

GPT-J by EleutherAI

GPT-NeoX by EleutherAI

AlexaTM by Amazon

Codex

  • tags: ai, machine learning
  • license: closed source
  • free trial: 18 USD credit
  • parameters: 12B

Jurassic-1 language model by AI21 labs

Megatron-Turing NLG by NVIDIA and Microsoft

BLOOM

  • decoder-only architecture
  • https://huggingface.co/docs/transformers/model_doc/bloom
  • license: closed source
  • 13 programming languages
  • trained on: 46 natural languages, 13 programming languages
  • parameters: 176B
  • architecture: auto-regressive model for next token prediction (similar to GPT3)

Online Transpilers

javainuse.com

GitHub topics

See also

Releases

No releases published

Packages

No packages published