Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dbohdan/compilers-targeting-c

A list of compilers that can generate C code
https://github.com/dbohdan/compilers-targeting-c

c compilers list

Last synced: 20 days ago
JSON representation

A list of compilers that can generate C code

Awesome Lists containing this project

README

        

# Compilers targeting C

The following is a list of open source compilers that can generate C (or in some cases, C++) code.

| Name | Supported languages | Supported targets | Notes | Links |
| --- | --- | --- | --- | --- |
| [Alumina](https://docs.alumina-lang.net/) | Alumina | C | Inspired by Rust | [web](https://docs.alumina-lang.net/) [repo](https://github.com/alumina-lang/alumina) |
| [ATS](http://www.ats-lang.org/) | ATS | C | | [web](http://www.ats-lang.org/) |
| [Austral](https://austral-lang.org/) | Austral | C | Has some similarities to Haskell and Ada | [web](https://austral-lang.org/) [repo](https://github.com/austral/austral/) [doc](https://austral-lang.org/spec/spec.html) |
| [BaCon (Basic Converter)](http://basic-converter.org/) | Basic | C | | [web](http://basic-converter.org/) |
| [bc9Basic](https://sourceforge.net/projects/bc9basic/) | Basic | C | Can generate C or C++ code. Runs only on Windows but can generate code for *nix. A fork of [BCX](http://bcx-basic.sourceforge.net/) that outputs valid ISO/ANSI C. [Website archive](http://web.archive.org/web/20160405001529/http://bc9.bcxbasic.com/). | [web](https://sourceforge.net/projects/bc9basic/) |
| [Bigloo](http://www-sop.inria.fr/mimosa/fp/Bigloo/) | Scheme | C | Scheme (R5RS) | [web](http://www-sop.inria.fr/mimosa/fp/Bigloo/) |
| [Blech](https://github.com/boschresearch/blech) | Blech | C | A synchronous programming language for embedded reactive real-time-critical software. | [repo](https://github.com/boschresearch/blech) |
| [bmx-ng](https://github.com/bmx-ng/bcc) | BlitzMax | C | A Monkey-derived BlitzMax to C transpiler. | [repo](https://github.com/bmx-ng/bcc) |
| [Cakelisp](https://macoy.me/code/macoy/cakelisp) | Cakelisp | C, C++ | Lisp-like programming language | [web](https://macoy.me/code/macoy/cakelisp) [repo](https://macoy.me/code/macoy/cakelisp) [doc](https://macoy.me/code/macoy/cakelisp/src/branch/master/doc/Cakelisp.org) |
| [Carp](https://github.com/carp-lang/carp) | Carp, Lisp | C | A statically typed lisp, without a GC, for real-time applications. | [repo](https://github.com/carp-lang/carp) |
| [Cforall](https://cforall.uwaterloo.ca/) | Cforall, C | C | Extends ISO C and outputs augmented C code | [web](https://cforall.uwaterloo.ca/) [repo](https://github.com/cforall/cforall) [doc](https://cforall.uwaterloo.ca/doc/user.pdf) |
| [Chapel](http://chapel.cray.com/) | Chapel | C | | [web](http://chapel.cray.com/) |
| [CHICKEN Scheme](http://www.call-cc.org/) | Scheme | C | Scheme (R5RS) | [web](http://www.call-cc.org/) |
| [Ciao](http://ciao-lang.org/) | Prolog | C | | [web](http://ciao-lang.org/) |
| [CLiCC](https://github.com/plops/clicc) | Common Lisp | C | Compiles a large strict subset of Common Lisp + CLOS to C. | [repo](https://github.com/plops/clicc) |
| [Critical Mass Modula-3](https://github.com/modula3/cm3) | Modula-3 | C | | [repo](https://github.com/modula3/cm3) |
| [Cyclone](https://github.com/justinethier/cyclone) | Scheme | C | Scheme (R7RS). Cheney on the M.T.A. with native threads. | [repo](https://github.com/justinethier/cyclone) |
| [Cython](http://cython.org) | Python | C | | [web](http://cython.org) |
| [Céu](http://www.ceu-lang.org/) | Céu | C | | [web](http://www.ceu-lang.org/) |
| [eC](http://ec-lang.org/) | eC | C | An object-oriented superset of C with modules and generics. | [web](http://ec-lang.org/) |
| [EiffelStudio](https://www.eiffel.com/eiffelstudio/) | Eiffel | C | | [web](https://www.eiffel.com/eiffelstudio/) |
| [Embeddable Common-Lisp](https://common-lisp.net/project/ecl/) | Common Lisp | C | ANSI Common Lisp | [web](https://common-lisp.net/project/ecl/) |
| [Emfrp](https://github.com/sawaken/emfrp) | Emfrp | C | A pure functional reactive programming language for small-scale embedded systems. | [repo](https://github.com/sawaken/emfrp) |
| [Emgo](https://github.com/ziutek/emgo) | Go | C | Compiles a subset of Go for 32-bit microcontrollers through C. | [repo](https://github.com/ziutek/emgo) |
| [Epic](https://eb.host.cs.st-andrews.ac.uk/epic.php) | Epic | C | | [web](https://eb.host.cs.st-andrews.ac.uk/epic.php) |
| [Esotope Brainfuck Compiler](https://github.com/lifthrasiir/esotope-bfc) | Brainfuck | C | | [repo](https://github.com/lifthrasiir/esotope-bfc) |
| [Euphoria to C Translator](https://openeuphoria.org/docs/e2c.html) | Euphoria | C | | [web](https://openeuphoria.org/docs/e2c.html) |
| [f2c](http://www.netlib.org/f2c/) | Fortran 77 | C | | [web](http://www.netlib.org/f2c/) |
| [Felix](https://github.com/felix-lang/felix) | Felix | C++ | | [repo](https://github.com/felix-lang/felix) |
| [FreeBASIC](https://www.freebasic.net/) | Basic | C | | [web](https://www.freebasic.net/) |
| [fut](https://fusion-lang.org/) | Fusion | C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript, OpenCL | A language for making portable libraries with a syntax like C#. | [web](https://fusion-lang.org/) |
| [Futhark](https://github.com/HIPERFIT/futhark) | Futhark | C | Purely functional data-parallel language generating OpenCL C | [repo](https://github.com/HIPERFIT/futhark) |
| [Gambit](http://gambitscheme.org/) | Scheme | C | Scheme (R5RS) | [web](http://gambitscheme.org/) |
| [GCL](http://www.gnu.org/software/gcl/) | Common Lisp | C | | [web](http://www.gnu.org/software/gcl/) |
| [Genie](http://live.gnome.org/Genie) | Genie | C | | [web](http://live.gnome.org/Genie) |
| [GHC](https://www.haskell.org/ghc/) | Haskell | C | [C backend](https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/code-generators.html) documentation page. | [web](https://www.haskell.org/ghc/) |
| [GnuCOBOL](http://open-cobol.sourceforge.net/) | COBOL | C | COBOL 2014 with extensions | [web](http://open-cobol.sourceforge.net/) |
| [go2cpp](https://github.com/xyproto/go2cpp) | Go | C++ | Designed to help port Go to C++ | [repo](https://github.com/xyproto/go2cpp) |
| [GoLite](https://github.com/vaquierm/GoLite_Transpiler) | GoLite, Go | C++ | Transpiles a strict subset of Go | [repo](https://github.com/vaquierm/GoLite_Transpiler) |
| [Harbour](https://github.com/harbour/core/) | xBase, CA-Clipper | C | xBase compatible with CA-Clipper | [repo](https://github.com/harbour/core/) |
| [Haxe](http://haxe.org) | Haxe | C, C++ | | [web](http://haxe.org) |
| [Idris](http://www.idris-lang.org/) | Idris | C | A pure functional programming language with dependent types. | [web](http://www.idris-lang.org/) |
| [Ivory](http://ivorylang.org/) | Ivory | C | A Haskell eDSL for safe systems programming. | [web](http://ivorylang.org/) |
| [jhc](http://repetae.net/computer/jhc/) | Haskell 98 | C | The resulting code doesn't use a garbage collector. | [web](http://repetae.net/computer/jhc/) |
| [Kit](https://www.kitlang.org/) | Kit | C | A statically typed procedural language with manual MM, traits, pattern matching, and metaprogramming designed with game development in mind. | [web](https://www.kitlang.org/) |
| [Language84](http://norstrulde.org/language84/) | Language84 | C | | [web](http://norstrulde.org/language84/) |
| [m](https://mlang.dev/) | m | C, WebAssembly | It targets webassembly but actually it compiles to C and then requires to trigger manually clang to get webassembly | [web](https://mlang.dev/) [repo](https://github.com/ligangwang/m) |
| [ManKai Common Lisp](https://common-lisp.net/project/mkcl/) | Common Lisp | C | | [web](https://common-lisp.net/project/mkcl/) |
| [matiec](https://github.com/nucleron/matiec) | ST, IL, SFC | C | A set of textual languages for PLC programming. (SFC: IEC 61131) | [repo](https://github.com/nucleron/matiec) |
| [mbeddr](http://mbeddr.com/) | mbeddr | C | A set of languages for embedded software engineering. | [web](http://mbeddr.com/) |
| [Mercury](http://www.mercurylang.org/) | Mercury | C | | [web](http://www.mercurylang.org/) |
| [MLton](http://mlton.org/) | Standard ML | C | | [web](http://mlton.org/) |
| [Monkey 2](http://monkeycoder.co.nz/) | Monkey 2 | C++ | | [web](http://monkeycoder.co.nz/) |
| [Mrustc](https://github.com/thepowersgang/mrustc) | Rust | C | | [repo](https://github.com/thepowersgang/mrustc) |
| [NectarJS](https://github.com/NectarJS/nectarjs) | JavaScript | C | The primary target is WebAssembly. [How to compile to C](https://github.com/NectarJS/nectarjs/issues/46#issuecomment-498532350). | [repo](https://github.com/NectarJS/nectarjs) |
| [Nelua](https://nelua.io) | Nelua | C | A statically-typed meta-programmable systems programming language heavily inspired by Lua. | [web](https://nelua.io) |
| [Nim](http://nim-lang.org) | Nim | C, C++, Objective C | | [web](http://nim-lang.org) |
| [Nit](http://nitlanguage.org/) | Nit | C | | [web](http://nitlanguage.org/) |
| [NN-512](https://nn-512.com/) | NN-512 | C | Graph language. Generate C99 code for neural net inference. | [web](https://nn-512.com/) |
| [Nuitka](http://nuitka.net/) | Python | C | | [web](http://nuitka.net/) |
| [nullc](https://github.com/WheretIB/nullc) | nullc | C, x86, VM | It is a C-like programming language | [repo](https://github.com/WheretIB/nullc) [doc](https://github.com/WheretIB/nullc/wiki/Language-Reference) |
| [OBNC](http://www.miasap.se/obnc/) | Oberon | C | | [web](http://www.miasap.se/obnc/) |
| [ocamlcc](https://github.com/ocaml-bytes/ocamlcc) | OCaml | C | Compiles OCaml bytecode to C. | [repo](https://github.com/ocaml-bytes/ocamlcc) |
| [oi](https://github.com/hodefoting/oi/) | oi | C | C with traits. Compiles to code that can be directly used from plain C. | [repo](https://github.com/hodefoting/oi/) |
| [ooc](http://ooc-lang.org) | ooc | C | | [web](http://ooc-lang.org) |
| [OpenDylan](http://opendylan.org/) | Dylan | C | | [web](http://opendylan.org/) |
| [p2c](http://users.fred.net/tds/lab/p2c/) | Pascal, UCSD, Turbo Pascal, Modula-2 | C, C++ | Supports several Pascal dialects, including UCSD and Turbo Pascal, Modula-2. | [web](http://users.fred.net/tds/lab/p2c/) |
| [ParparVM](https://github.com/codenameone/CodenameOne/tree/master/vm) | Java bytecode | C | Use for the Java to iOS portability part of the [Codename One](https://www.codenameone.com/) project. | [repo](https://github.com/codenameone/CodenameOne/tree/master/vm) |
| [perlcc](http://search.cpan.org/dist/B-C/) | Perl 5 | C | | [web](http://search.cpan.org/dist/B-C/) |
| [prometeo](https://github.com/zanellia/prometeo) | Python | C | Transpiles subset of Python | [repo](https://github.com/zanellia/prometeo) [doc](https://prometeo.readthedocs.io/en/latest/index.html) |
| [PtoC](https://github.com/knizhnik/ptoc/) | pascal, Turbo Pascal, Oregon Pascal, ISO Pascal, Sun Pascal, HP Pascal | C, C++ | Transpiles to readable code | [repo](https://github.com/knizhnik/ptoc/) |
| [purescript-native](https://github.com/andyarvanitis/purescript-native) | PureScript | C++ | | [repo](https://github.com/andyarvanitis/purescript-native) |
| [Py14](https://github.com/lukasmartinelli/py14) | Python | C++ | | [repo](https://github.com/lukasmartinelli/py14) |
| [Pythran](https://github.com/serge-sans-paille/pythran) | Python | C++ | | [repo](https://github.com/serge-sans-paille/pythran) |
| [QuickJS](https://bellard.org/quickjs/) | JavaScript | C | Compiles JavaScript (ES2020) to bytecode and embeds the bytecode in C. | [web](https://bellard.org/quickjs/) |
| [Ragel](http://www.colm.net/open-source/ragel/) | Ragel | C, C++ | Compiles executable finite state machines from regular languages. | [web](http://www.colm.net/open-source/ragel/) |
| [RPerl](https://github.com/wbraswell/rperl) | RPerl, Perl. | C++ | RPerl, a restricted subset of Perl. Unrelated to RPython. | [repo](https://github.com/wbraswell/rperl) |
| [RPython](https://rpython.readthedocs.org/en/latest/) | RPython, Python. | C | RPython, a restricted subset of Python. Unrelated to RPerl. | [web](https://rpython.readthedocs.org/en/latest/) |
| [Sather](http://www.gnu.org/software/sather/) | Sather | C | | [web](http://www.gnu.org/software/sather/) |
| [Scheme-to-C](https://github.com/akeep/scheme-to-c) | Scheme | C | Example nanopass compiler | [repo](https://github.com/akeep/scheme-to-c) |
| [Seed7](http://seed7.sourceforge.net/) | Seed7 | C | | [web](http://seed7.sourceforge.net/) |
| [Shedskin](https://github.com/shedskin/shedskin) | Python | C++ | | [repo](https://github.com/shedskin/shedskin) |
| [SLua](https://github.com/Neopallium/slua) | Lua | C | | [repo](https://github.com/Neopallium/slua) |
| [SystemTap](http://sourceware.org/systemtap/) | SystemTap | C | SystemTap scripting language compiles kernel modules for monitoring Linux systems. | [web](http://sourceware.org/systemtap/) |
| [ThinScript](https://github.com/evanw/thinscript) | ThinScript | C, JavaScript, WebAssembly | A lower-level programming language inspired by TypeScript. ThinScript also compiles to JavaScript and WebAssembly. | [repo](https://github.com/evanw/thinscript) |
| [TMPPy](https://github.com/google/tmppy) | TMPPy, Python | C++ | Transpiles a subset of Python | [repo](https://github.com/google/tmppy) [doc](https://github.com/google/tmppy/wiki) |
| [ts2c](https://github.com/andrei-markeev/ts2c) | JavaScript, TypeScript | C | Compiles a subset of JavaScript/TypeScript (ES3) to readable C89. | [repo](https://github.com/andrei-markeev/ts2c) |
| [TSP](https://github.com/tpoindex/tsp) | Tcl | C | A typed subset of Tcl. An experimental JIT. Compiles procedures written in a statically typed subset of Tcl to C or Java to accelerate Tcl programs. | [repo](https://github.com/tpoindex/tsp) |
| [UbxBasic](https://sourceforge.net/projects/ubxbasic/) | Basic | C, C++ | A fork of [BCX](http://bcx-basic.sourceforge.net/) that adds Linux support in addition to Windows. Uses Glib. | [web](https://sourceforge.net/projects/ubxbasic/) |
| [Ur/Web](http://www.impredicative.com/ur/) | Ur/Web | C | | [web](http://www.impredicative.com/ur/) |
| [V](https://github.com/vlang/v) | V | C | A no-GC systems language with modern features like sum types and immutability by default. | [repo](https://github.com/vlang/v) |
| [Vala](https://wiki.gnome.org/Projects/Vala) | Vala | C | | [web](https://wiki.gnome.org/Projects/Vala) |
| [Vostok](https://github.com/Vostok-space/vostok) | Oberon-07 | C, Java, JavaScript, Oberon | | [repo](https://github.com/Vostok-space/vostok) |
| [wasm2c](https://github.com/WebAssembly/wabt/tree/master/wasm2c) | WebAssembly | C | Converts WASM files to C source and header. | [repo](https://github.com/WebAssembly/wabt/tree/master/wasm2c) |
| [wasmdec](https://github.com/wwwg/wasmdec) | WebAssembly | C | Converts WebAssembly binaries to C. | [repo](https://github.com/wwwg/wasmdec) |
| [wax](https://github.com/LingDong-/wax) | wax | C, C#, C++, Java, Lua, Python, Swift, TypeScript, WebAssembly | A language design for transpiling. | [web](https://github.com/LingDong-/wax) |
| [Yaksha](https://yakshalang.github.io/) | Yaksha | C | Compiles "Python like" programming language to C99. No Garbage collector (manual memory management). Builtin support for raylib & wasm4. Macro system is a lisp dialect (YakshaLisp) | [web](https://yakshalang.github.io/) [repo](https://github.com/YakshaLang) [doc](https://yakshalang.github.io/documentation.html) |
| [Zephir](http://zephir-lang.com/) | Zephir | C | A language for writing PHP extensions. | [web](http://zephir-lang.com/) |
| [ZZ](https://github.com/aep/zz) | ZZ (Drunk Octopus) | C | A safe dialect of C for embedded systems inspired by Rust. | [repo](https://github.com/aep/zz) |

## C macro languages
* [C-Mera](https://github.com/kiselgra/c-mera), a simple source-to-source compiler that transforms s-expression notation to code in a C-family language.
* [LISP/c](https://github.com/eratosthenesia/lispc), a Common Lisp-based macrolanguage for C.

## See also
* [Cello](http://libcello.org/), a library for high-level programming in C.
* [Clue](http://cowlark.com/clue/), an ANSI C compiler targeting high level languages (Lua, JavaScript, Perl 5, C, Java, Common Lisp).
* [LLVM C backend resurrected](https://github.com/draperlaboratory/llvm-cbe).
* [luastatic](https://github.com/ers35/luastatic), a tool that builds standalone executables from Lua programs by embedding Lua code in C.

## Contributing

Your contributions are welcome! Please submit a pull request or create an issue to add a new compiler to the list.

## License

[![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/)