├── README.md └── src ├── database.mjs ├── doc_pieces ├── README_footer.md └── README_header.md ├── generate.mjs └── utils ├── file.mjs └── misc.mjs /README.md: -------------------------------------------------------------------------------- 1 | # Compilers targeting C 2 | 3 | The following is a list of open source compilers that can generate C (or in some cases, C++) code. 4 | 5 | | Name | Supported languages | Supported targets | Notes | Links | 6 | | --- | --- | --- | --- | --- | 7 | | [Alumina](https://docs.alumina-lang.net/) | Alumina | C | Inspired by Rust | [web](https://docs.alumina-lang.net/) [repo](https://github.com/alumina-lang/alumina) | 8 | | [ATS](http://www.ats-lang.org/) | ATS | C | | [web](http://www.ats-lang.org/) | 9 | | [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) | 10 | | [BaCon (Basic Converter)](http://basic-converter.org/) | Basic | C | | [web](http://basic-converter.org/) | 11 | | [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/) | 12 | | [Bigloo](http://www-sop.inria.fr/mimosa/fp/Bigloo/) | Scheme | C | Scheme (R5RS) | [web](http://www-sop.inria.fr/mimosa/fp/Bigloo/) | 13 | | [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) | 14 | | [bmx-ng](https://github.com/bmx-ng/bcc) | BlitzMax | C | A Monkey-derived BlitzMax to C transpiler. | [repo](https://github.com/bmx-ng/bcc) | 15 | | [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) | 16 | | [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) | 17 | | [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) | 18 | | [Chapel](http://chapel.cray.com/) | Chapel | C | | [web](http://chapel.cray.com/) | 19 | | [CHICKEN Scheme](http://www.call-cc.org/) | Scheme | C | Scheme (R5RS) | [web](http://www.call-cc.org/) | 20 | | [Ciao](http://ciao-lang.org/) | Prolog | C | | [web](http://ciao-lang.org/) | 21 | | [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) | 22 | | [Critical Mass Modula-3](https://github.com/modula3/cm3) | Modula-3 | C | | [repo](https://github.com/modula3/cm3) | 23 | | [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) | 24 | | [Cython](http://cython.org) | Python | C | | [web](http://cython.org) | 25 | | [Céu](http://www.ceu-lang.org/) | Céu | C | | [web](http://www.ceu-lang.org/) | 26 | | [eC](http://ec-lang.org/) | eC | C | An object-oriented superset of C with modules and generics. | [web](http://ec-lang.org/) | 27 | | [EiffelStudio](https://www.eiffel.com/eiffelstudio/) | Eiffel | C | | [web](https://www.eiffel.com/eiffelstudio/) | 28 | | [Embeddable Common-Lisp](https://common-lisp.net/project/ecl/) | Common Lisp | C | ANSI Common Lisp | [web](https://common-lisp.net/project/ecl/) | 29 | | [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) | 30 | | [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) | 31 | | [Epic](https://eb.host.cs.st-andrews.ac.uk/epic.php) | Epic | C | | [web](https://eb.host.cs.st-andrews.ac.uk/epic.php) | 32 | | [Esotope Brainfuck Compiler](https://github.com/lifthrasiir/esotope-bfc) | Brainfuck | C | | [repo](https://github.com/lifthrasiir/esotope-bfc) | 33 | | [Euphoria to C Translator](https://openeuphoria.org/docs/e2c.html) | Euphoria | C | | [web](https://openeuphoria.org/docs/e2c.html) | 34 | | [f2c](http://www.netlib.org/f2c/) | Fortran 77 | C | | [web](http://www.netlib.org/f2c/) | 35 | | [Felix](https://github.com/felix-lang/felix) | Felix | C++ | | [repo](https://github.com/felix-lang/felix) | 36 | | [FreeBASIC](https://www.freebasic.net/) | Basic | C | | [web](https://www.freebasic.net/) | 37 | | [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/) | 38 | | [Futhark](https://github.com/HIPERFIT/futhark) | Futhark | C | Purely functional data-parallel language generating OpenCL C | [repo](https://github.com/HIPERFIT/futhark) | 39 | | [Gambit](http://gambitscheme.org/) | Scheme | C | Scheme (R5RS) | [web](http://gambitscheme.org/) | 40 | | [GCL](http://www.gnu.org/software/gcl/) | Common Lisp | C | | [web](http://www.gnu.org/software/gcl/) | 41 | | [Genie](http://live.gnome.org/Genie) | Genie | C | | [web](http://live.gnome.org/Genie) | 42 | | [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/) | 43 | | [GnuCOBOL](http://open-cobol.sourceforge.net/) | COBOL | C | COBOL 2014 with extensions | [web](http://open-cobol.sourceforge.net/) | 44 | | [go2cpp](https://github.com/xyproto/go2cpp) | Go | C++ | Designed to help port Go to C++ | [repo](https://github.com/xyproto/go2cpp) | 45 | | [GoLite](https://github.com/vaquierm/GoLite_Transpiler) | GoLite, Go | C++ | Transpiles a strict subset of Go | [repo](https://github.com/vaquierm/GoLite_Transpiler) | 46 | | [Harbour](https://github.com/harbour/core/) | xBase, CA-Clipper | C | xBase compatible with CA-Clipper | [repo](https://github.com/harbour/core/) | 47 | | [Haxe](http://haxe.org) | Haxe | C, C++ | | [web](http://haxe.org) | 48 | | [Idris](http://www.idris-lang.org/) | Idris | C | A pure functional programming language with dependent types. | [web](http://www.idris-lang.org/) | 49 | | [Ivory](http://ivorylang.org/) | Ivory | C | A Haskell eDSL for safe systems programming. | [web](http://ivorylang.org/) | 50 | | [jhc](http://repetae.net/computer/jhc/) | Haskell 98 | C | The resulting code doesn't use a garbage collector. | [web](http://repetae.net/computer/jhc/) | 51 | | [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/) | 52 | | [Language84](http://norstrulde.org/language84/) | Language84 | C | | [web](http://norstrulde.org/language84/) | 53 | | [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) | 54 | | [ManKai Common Lisp](https://common-lisp.net/project/mkcl/) | Common Lisp | C | | [web](https://common-lisp.net/project/mkcl/) | 55 | | [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) | 56 | | [mbeddr](http://mbeddr.com/) | mbeddr | C | A set of languages for embedded software engineering. | [web](http://mbeddr.com/) | 57 | | [Mercury](http://www.mercurylang.org/) | Mercury | C | | [web](http://www.mercurylang.org/) | 58 | | [MLton](http://mlton.org/) | Standard ML | C | | [web](http://mlton.org/) | 59 | | [Monkey 2](http://monkeycoder.co.nz/) | Monkey 2 | C++ | | [web](http://monkeycoder.co.nz/) | 60 | | [Mrustc](https://github.com/thepowersgang/mrustc) | Rust | C | | [repo](https://github.com/thepowersgang/mrustc) | 61 | | [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) | 62 | | [Nelua](https://nelua.io) | Nelua | C | A statically-typed meta-programmable systems programming language heavily inspired by Lua. | [web](https://nelua.io) | 63 | | [Nim](http://nim-lang.org) | Nim | C, C++, Objective C | | [web](http://nim-lang.org) | 64 | | [Nit](http://nitlanguage.org/) | Nit | C | | [web](http://nitlanguage.org/) | 65 | | [NN-512](https://nn-512.com/) | NN-512 | C | Graph language. Generate C99 code for neural net inference. | [web](https://nn-512.com/) | 66 | | [Nuitka](http://nuitka.net/) | Python | C | | [web](http://nuitka.net/) | 67 | | [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) | 68 | | [OBNC](http://www.miasap.se/obnc/) | Oberon | C | | [web](http://www.miasap.se/obnc/) | 69 | | [ocamlcc](https://github.com/ocaml-bytes/ocamlcc) | OCaml | C | Compiles OCaml bytecode to C. | [repo](https://github.com/ocaml-bytes/ocamlcc) | 70 | | [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/) | 71 | | [ooc](http://ooc-lang.org) | ooc | C | | [web](http://ooc-lang.org) | 72 | | [OpenDylan](http://opendylan.org/) | Dylan | C | | [web](http://opendylan.org/) | 73 | | [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/) | 74 | | [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) | 75 | | [perlcc](http://search.cpan.org/dist/B-C/) | Perl 5 | C | | [web](http://search.cpan.org/dist/B-C/) | 76 | | [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) | 77 | | [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/) | 78 | | [purescript-native](https://github.com/andyarvanitis/purescript-native) | PureScript | C++ | | [repo](https://github.com/andyarvanitis/purescript-native) | 79 | | [Py14](https://github.com/lukasmartinelli/py14) | Python | C++ | | [repo](https://github.com/lukasmartinelli/py14) | 80 | | [Pythran](https://github.com/serge-sans-paille/pythran) | Python | C++ | | [repo](https://github.com/serge-sans-paille/pythran) | 81 | | [QuickJS](https://bellard.org/quickjs/) | JavaScript | C | Compiles JavaScript (ES2020) to bytecode and embeds the bytecode in C. | [web](https://bellard.org/quickjs/) | 82 | | [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/) | 83 | | [RPerl](https://github.com/wbraswell/rperl) | RPerl, Perl. | C++ | RPerl, a restricted subset of Perl. Unrelated to RPython. | [repo](https://github.com/wbraswell/rperl) | 84 | | [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/) | 85 | | [Sather](http://www.gnu.org/software/sather/) | Sather | C | | [web](http://www.gnu.org/software/sather/) | 86 | | [Scheme-to-C](https://github.com/akeep/scheme-to-c) | Scheme | C | Example nanopass compiler | [repo](https://github.com/akeep/scheme-to-c) | 87 | | [Seed7](http://seed7.sourceforge.net/) | Seed7 | C | | [web](http://seed7.sourceforge.net/) | 88 | | [Shedskin](https://github.com/shedskin/shedskin) | Python | C++ | | [repo](https://github.com/shedskin/shedskin) | 89 | | [SLua](https://github.com/Neopallium/slua) | Lua | C | | [repo](https://github.com/Neopallium/slua) | 90 | | [SystemTap](http://sourceware.org/systemtap/) | SystemTap | C | SystemTap scripting language compiles kernel modules for monitoring Linux systems. | [web](http://sourceware.org/systemtap/) | 91 | | [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) | 92 | | [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) | 93 | | [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) | 94 | | [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) | 95 | | [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/) | 96 | | [Ur/Web](http://www.impredicative.com/ur/) | Ur/Web | C | | [web](http://www.impredicative.com/ur/) | 97 | | [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) | 98 | | [Vala](https://wiki.gnome.org/Projects/Vala) | Vala | C | | [web](https://wiki.gnome.org/Projects/Vala) | 99 | | [Vostok](https://github.com/Vostok-space/vostok) | Oberon-07 | C, Java, JavaScript, Oberon | | [repo](https://github.com/Vostok-space/vostok) | 100 | | [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) | 101 | | [wasmdec](https://github.com/wwwg/wasmdec) | WebAssembly | C | Converts WebAssembly binaries to C. | [repo](https://github.com/wwwg/wasmdec) | 102 | | [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) | 103 | | [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) | 104 | | [Zephir](http://zephir-lang.com/) | Zephir | C | A language for writing PHP extensions. | [web](http://zephir-lang.com/) | 105 | | [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) | 106 | 107 | ## C macro languages 108 | * [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. 109 | * [LISP/c](https://github.com/eratosthenesia/lispc), a Common Lisp-based macrolanguage for C. 110 | 111 | ## See also 112 | * [Cello](http://libcello.org/), a library for high-level programming in C. 113 | * [Clue](http://cowlark.com/clue/), an ANSI C compiler targeting high level languages (Lua, JavaScript, Perl 5, C, Java, Common Lisp). 114 | * [LLVM C backend resurrected](https://github.com/draperlaboratory/llvm-cbe). 115 | * [luastatic](https://github.com/ers35/luastatic), a tool that builds standalone executables from Lua programs by embedding Lua code in C. 116 | 117 | ## Contributing 118 | 119 | Your contributions are welcome! Please submit a pull request or create an issue to add a new compiler to the list. 120 | 121 | ## License 122 | 123 | [![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/) 124 | -------------------------------------------------------------------------------- /src/database.mjs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Data model for each programming language entry: 4 | 5 | interface ProgrammingLanguageDescription { 6 | name: string; 7 | source_languages: string | string[]; // eg. `pascal | basic` or ['pascal', 'basic'] 8 | target_languages: string | string[]; // eg. `c | c++` or ['c', 'c++'] 9 | notes: string; 10 | links: { 11 | web: string | string[]; 12 | repo: string | string[]; 13 | doc: string | string[]; 14 | } 15 | } 16 | */ 17 | 18 | 19 | export const database = [ 20 | { 21 | "name": "Cakelisp", 22 | "source_languages": "Cakelisp", 23 | "target_languages": "C | C++", 24 | "notes": "Lisp-like programming language", 25 | "links": { 26 | "web": "https://macoy.me/code/macoy/cakelisp", 27 | "repo": "https://macoy.me/code/macoy/cakelisp", 28 | "doc": "https://macoy.me/code/macoy/cakelisp/src/branch/master/doc/Cakelisp.org" 29 | } 30 | }, 31 | { 32 | "name": "Austral", 33 | "source_languages": "Austral", 34 | "target_languages": "C", 35 | "notes": "Has some similarities to Haskell and Ada", 36 | "links": { 37 | "web": "https://austral-lang.org/", 38 | "repo": "https://github.com/austral/austral/", 39 | "doc": "https://austral-lang.org/spec/spec.html" 40 | } 41 | }, 42 | { 43 | "name": "Yaksha", 44 | "source_languages": "Python", 45 | "target_languages": "C", 46 | "notes": "Transpiles \"Python like\" programming language to C", 47 | "links": { 48 | "web": "https://yakshalang.github.io/", 49 | "repo": "https://github.com/YakshaLang", 50 | "doc": "https://yakshalang.github.io/documentation.html" 51 | } 52 | }, 53 | { 54 | "name": "prometeo", 55 | "source_languages": "Python", 56 | "target_languages": "C", 57 | "notes": "Transpiles subset of Python", 58 | "links": { 59 | "repo": "https://github.com/zanellia/prometeo", 60 | "doc": "https://prometeo.readthedocs.io/en/latest/index.html" 61 | } 62 | }, 63 | { 64 | "name": "PtoC", 65 | "source_languages": "pascal | Turbo Pascal | Oregon Pascal | ISO Pascal | Sun Pascal | HP Pascal", 66 | "target_languages": "C | C++", 67 | "notes": "Transpiles to readable code", 68 | "links": { 69 | "repo": "https://github.com/knizhnik/ptoc/", 70 | } 71 | }, 72 | { 73 | "name": "nullc", 74 | "source_languages": "nullc", 75 | "target_languages": "C | x86 | VM", 76 | "notes": "It is a C-like programming language", 77 | "links": { 78 | "repo": "https://github.com/WheretIB/nullc", 79 | "doc": "https://github.com/WheretIB/nullc/wiki/Language-Reference" 80 | } 81 | }, 82 | { 83 | "name": "go2cpp", 84 | "source_languages": "Go", 85 | "target_languages": "C++", 86 | "notes": "Designed to help port Go to C++", 87 | "links": { 88 | "repo": "https://github.com/xyproto/go2cpp", 89 | } 90 | }, 91 | { 92 | "name": "TMPPy", 93 | "source_languages": "TMPPy | Python", 94 | "target_languages": "C++", 95 | "notes": "Transpiles a subset of Python", 96 | "links": { 97 | "repo": "https://github.com/google/tmppy", 98 | "doc": "https://github.com/google/tmppy/wiki" 99 | } 100 | }, 101 | { 102 | "name": "GoLite", 103 | "source_languages": "GoLite | Go", 104 | "target_languages": "C++", 105 | "notes": "Transpiles a strict subset of Go", 106 | "links": { 107 | "repo": "https://github.com/vaquierm/GoLite_Transpiler", 108 | } 109 | }, 110 | { 111 | "name": "Alumina", 112 | "source_languages": "Alumina", 113 | "target_languages": "C", 114 | "notes": "Inspired by Rust", 115 | "links": { 116 | "web": "https://docs.alumina-lang.net/", 117 | "repo": "https://github.com/alumina-lang/alumina", 118 | } 119 | }, 120 | { 121 | "name": "Cforall", 122 | "source_languages": "Cforall | C", 123 | "target_languages": "C", 124 | "notes": "Extends ISO C and outputs augmented C code", 125 | "links": { 126 | "web": "https://cforall.uwaterloo.ca/", 127 | "repo": "https://github.com/cforall/cforall", 128 | "doc": "https://cforall.uwaterloo.ca/doc/user.pdf" 129 | } 130 | }, 131 | { 132 | "name": "m", 133 | "source_languages": "m", 134 | "target_languages": "C | WebAssembly", 135 | "notes": "It targets webassembly but actually it compiles to C and then requires to trigger manually clang to get webassembly", 136 | "links": { 137 | "web": "https://mlang.dev/", 138 | "repo": "https://github.com/ligangwang/m" 139 | } 140 | }, 141 | { 142 | "name": "ATS", 143 | "source_languages": "ATS", 144 | "target_languages": "C", 145 | "notes": "", 146 | "links": { 147 | "web": "http://www.ats-lang.org/" 148 | } 149 | }, 150 | { 151 | "name": "BaCon (Basic Converter)", 152 | "source_languages": "Basic", 153 | "target_languages": "C", 154 | "notes": "", 155 | "links": { 156 | "web": "http://basic-converter.org/" 157 | } 158 | }, 159 | { 160 | "name": "bc9Basic", 161 | "source_languages": "Basic", 162 | "target_languages": "C", 163 | "notes": "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/).", 164 | "links": { 165 | "web": "https://sourceforge.net/projects/bc9basic/" 166 | } 167 | }, 168 | { 169 | "name": "Bigloo", 170 | "source_languages": "Scheme", 171 | "target_languages": "C", 172 | "notes": "Scheme (R5RS)", 173 | "links": { 174 | "web": "http://www-sop.inria.fr/mimosa/fp/Bigloo/" 175 | } 176 | }, 177 | { 178 | "name": "Blech", 179 | "source_languages": "Blech", 180 | "target_languages": "C", 181 | "notes": "A synchronous programming language for embedded reactive real-time-critical software.", 182 | "links": { 183 | "repo": "https://github.com/boschresearch/blech" 184 | } 185 | }, 186 | { 187 | "name": "bmx-ng", 188 | "source_languages": "BlitzMax", 189 | "target_languages": "C", 190 | "notes": "A Monkey-derived BlitzMax to C transpiler.", 191 | "links": { 192 | "repo": "https://github.com/bmx-ng/bcc" 193 | } 194 | }, 195 | { 196 | "name": "Carp", 197 | "source_languages": "Carp | Lisp", 198 | "target_languages": "C", 199 | "notes": "A statically typed lisp, without a GC, for real-time applications.", 200 | "links": { 201 | "repo": "https://github.com/carp-lang/carp" 202 | } 203 | }, 204 | { 205 | "name": "Chapel", 206 | "source_languages": "Chapel", 207 | "target_languages": "C", 208 | "notes": "", 209 | "links": { 210 | "web": "http://chapel.cray.com/" 211 | } 212 | }, 213 | { 214 | "name": "CHICKEN Scheme", 215 | "source_languages": "Scheme", 216 | "target_languages": "C", 217 | "notes": "Scheme (R5RS)", 218 | "links": { 219 | "web": "http://www.call-cc.org/" 220 | } 221 | }, 222 | { 223 | "name": "Ciao", 224 | "source_languages": "Prolog", 225 | "target_languages": "C", 226 | "notes": "", 227 | "links": { 228 | "web": "http://ciao-lang.org/" 229 | } 230 | }, 231 | { 232 | "name": "CLiCC", 233 | "source_languages": "Common Lisp", 234 | "target_languages": "C", 235 | "notes": "Compiles a large strict subset of Common Lisp + CLOS to C.", 236 | "links": { 237 | "repo": "https://github.com/plops/clicc" 238 | } 239 | }, 240 | { 241 | "name": "Critical Mass Modula-3", 242 | "source_languages": "Modula-3", 243 | "target_languages": "C", 244 | "notes": "", 245 | "links": { 246 | "repo": "https://github.com/modula3/cm3" 247 | } 248 | }, 249 | { 250 | "name": "Cyclone", 251 | "source_languages": "Scheme", 252 | "target_languages": "C", 253 | "notes": "Scheme (R7RS). Cheney on the M.T.A. with native threads.", 254 | "links": { 255 | "repo": "https://github.com/justinethier/cyclone" 256 | } 257 | }, 258 | { 259 | "name": "Cython", 260 | "source_languages": "Python", 261 | "target_languages": "C", 262 | "notes": "", 263 | "links": { 264 | "web": "http://cython.org" 265 | } 266 | }, 267 | { 268 | "name": "Céu", 269 | "source_languages": "Céu", 270 | "target_languages": "C", 271 | "notes": "", 272 | "links": { 273 | "web": "http://www.ceu-lang.org/" 274 | } 275 | }, 276 | { 277 | "name": "eC", 278 | "source_languages": "eC", 279 | "target_languages": "C", 280 | "notes": "An object-oriented superset of C with modules and generics.", 281 | "links": { 282 | "web": "http://ec-lang.org/" 283 | } 284 | }, 285 | { 286 | "name": "EiffelStudio", 287 | "source_languages": "Eiffel", 288 | "target_languages": "C", 289 | "notes": "", 290 | "links": { 291 | "web": "https://www.eiffel.com/eiffelstudio/" 292 | } 293 | }, 294 | { 295 | "name": "Embeddable Common-Lisp", 296 | "source_languages": "Common Lisp", 297 | "target_languages": "C", 298 | "notes": "ANSI Common Lisp", 299 | "links": { 300 | "web": "https://common-lisp.net/project/ecl/" 301 | } 302 | }, 303 | { 304 | "name": "Emfrp", 305 | "source_languages": "Emfrp", 306 | "target_languages": "C", 307 | "notes": "A pure functional reactive programming language for small-scale embedded systems.", 308 | "links": { 309 | "repo": "https://github.com/sawaken/emfrp" 310 | } 311 | }, 312 | { 313 | "name": "Emgo", 314 | "source_languages": "Go", 315 | "target_languages": "C", 316 | "notes": "Compiles a subset of Go for 32-bit microcontrollers through C.", 317 | "links": { 318 | "repo": "https://github.com/ziutek/emgo" 319 | } 320 | }, 321 | { 322 | "name": "Epic", 323 | "source_languages": "Epic", 324 | "target_languages": "C", 325 | "notes": "", 326 | "links": { 327 | "web": "https://eb.host.cs.st-andrews.ac.uk/epic.php" 328 | } 329 | }, 330 | { 331 | "name": "Esotope Brainfuck Compiler", 332 | "source_languages": "Brainfuck", 333 | "target_languages": "C", 334 | "notes": "", 335 | "links": { 336 | "repo": "https://github.com/lifthrasiir/esotope-bfc" 337 | } 338 | }, 339 | { 340 | "name": "Euphoria to C Translator", 341 | "source_languages": "Euphoria", 342 | "target_languages": "C", 343 | "notes": "", 344 | "links": { 345 | "web": "https://openeuphoria.org/docs/e2c.html" 346 | } 347 | }, 348 | { 349 | "name": "f2c", 350 | "source_languages": "Fortran 77", 351 | "target_languages": "C", 352 | "notes": "", 353 | "links": { 354 | "web": "http://www.netlib.org/f2c/" 355 | } 356 | }, 357 | { 358 | "name": "Felix", 359 | "source_languages": "Felix", 360 | "target_languages": "C++", 361 | "notes": "", 362 | "links": { 363 | "repo": "https://github.com/felix-lang/felix" 364 | } 365 | }, 366 | { 367 | "name": "FreeBASIC", 368 | "source_languages": "Basic", 369 | "target_languages": "C", 370 | "notes": "", 371 | "links": { 372 | "web": "https://www.freebasic.net/" 373 | } 374 | }, 375 | { 376 | "name": "fut", 377 | "source_languages": "Fusion", 378 | "target_languages": "C | C++ | C# | D | Java | JavaScript | Python | Swift | TypeScript | OpenCL", 379 | "notes": "A language for making portable libraries with a syntax like C#.", 380 | "links": { 381 | "web": "https://fusion-lang.org/" 382 | } 383 | }, 384 | { 385 | "name": "Futhark", 386 | "source_languages": "Futhark", 387 | "target_languages": "C", 388 | "notes": "Purely functional data-parallel language generating OpenCL C", 389 | "links": { 390 | "repo": "https://github.com/HIPERFIT/futhark" 391 | } 392 | }, 393 | { 394 | "name": "Gambit", 395 | "source_languages": "Scheme", 396 | "target_languages": "C", 397 | "notes": "Scheme (R5RS)", 398 | "links": { 399 | "web": "http://gambitscheme.org/" 400 | } 401 | }, 402 | { 403 | "name": "GCL", 404 | "source_languages": "Common Lisp", 405 | "target_languages": "C", 406 | "notes": "", 407 | "links": { 408 | "web": "http://www.gnu.org/software/gcl/" 409 | } 410 | }, 411 | { 412 | "name": "Genie", 413 | "source_languages": "Genie", 414 | "target_languages": "C", 415 | "notes": "", 416 | "links": { 417 | "web": "http://live.gnome.org/Genie" 418 | } 419 | }, 420 | { 421 | "name": "GHC", 422 | "source_languages": "Haskell", 423 | "target_languages": "C", 424 | "notes": "[C backend](https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/code-generators.html) documentation page.", 425 | "links": { 426 | "web": "https://www.haskell.org/ghc/" 427 | } 428 | }, 429 | { 430 | "name": "GnuCOBOL", 431 | "source_languages": "COBOL", 432 | "target_languages": "C", 433 | "notes": "COBOL 2014 with extensions", 434 | "links": { 435 | "web": "http://open-cobol.sourceforge.net/" 436 | } 437 | }, 438 | { 439 | "name": "Harbour", 440 | "source_languages": "xBase | CA-Clipper", 441 | "target_languages": "C", 442 | "notes": "xBase compatible with CA-Clipper", 443 | "links": { 444 | "repo": "https://github.com/harbour/core/" 445 | } 446 | }, 447 | { 448 | "name": "Haxe", 449 | "source_languages": "Haxe", 450 | "target_languages": "C | C++", 451 | "notes": "", 452 | "links": { 453 | "web": "http://haxe.org" 454 | } 455 | }, 456 | { 457 | "name": "Idris", 458 | "source_languages": "Idris", 459 | "target_languages": "C", 460 | "notes": "A pure functional programming language with dependent types.", 461 | "links": { 462 | "web": "http://www.idris-lang.org/" 463 | } 464 | }, 465 | { 466 | "name": "Ivory", 467 | "source_languages": "Ivory", 468 | "target_languages": "C", 469 | "notes": "A Haskell eDSL for safe systems programming.", 470 | "links": { 471 | "web": "http://ivorylang.org/" 472 | } 473 | }, 474 | { 475 | "name": "jhc", 476 | "source_languages": "Haskell 98", 477 | "target_languages": "C", 478 | "notes": "The resulting code doesn't use a garbage collector.", 479 | "links": { 480 | "web": "http://repetae.net/computer/jhc/" 481 | } 482 | }, 483 | { 484 | "name": "Kit", 485 | "source_languages": "Kit", 486 | "target_languages": "C", 487 | "notes": "A statically typed procedural language with manual MM, traits, pattern matching, and metaprogramming designed with game development in mind.", 488 | "links": { 489 | "web": "https://www.kitlang.org/" 490 | } 491 | }, 492 | { 493 | "name": "Language84", 494 | "source_languages": "Language84", 495 | "target_languages": "C", 496 | "notes": "", 497 | "links": { 498 | "web": "http://norstrulde.org/language84/" 499 | } 500 | }, 501 | { 502 | "name": "mbeddr", 503 | "source_languages": "mbeddr", 504 | "target_languages": "C", 505 | "notes": "A set of languages for embedded software engineering.", 506 | "links": { 507 | "web": "http://mbeddr.com/" 508 | } 509 | }, 510 | { 511 | "name": "ManKai Common Lisp", 512 | "source_languages": "Common Lisp", 513 | "target_languages": "C", 514 | "notes": "", 515 | "links": { 516 | "web": "https://common-lisp.net/project/mkcl/" 517 | } 518 | }, 519 | { 520 | "name": "matiec", 521 | "source_languages": "ST | IL | SFC", 522 | "target_languages": "C", 523 | "notes": "A set of textual languages for PLC programming. (SFC: IEC 61131)", 524 | "links": { 525 | "repo": "https://github.com/nucleron/matiec" 526 | } 527 | }, 528 | { 529 | "name": "Mercury", 530 | "source_languages": "Mercury", 531 | "target_languages": "C", 532 | "notes": "", 533 | "links": { 534 | "web": "http://www.mercurylang.org/" 535 | } 536 | }, 537 | { 538 | "name": "MLton", 539 | "source_languages": "Standard ML", 540 | "target_languages": "C", 541 | "notes": "", 542 | "links": { 543 | "web": "http://mlton.org/" 544 | } 545 | }, 546 | { 547 | "name": "Monkey 2", 548 | "source_languages": "Monkey 2", 549 | "target_languages": "C++", 550 | "notes": "", 551 | "links": { 552 | "web": "http://monkeycoder.co.nz/" 553 | } 554 | }, 555 | { 556 | "name": "Mrustc", 557 | "source_languages": "Rust", 558 | "target_languages": "C", 559 | "notes": "", 560 | "links": { 561 | "repo": "https://github.com/thepowersgang/mrustc" 562 | } 563 | }, 564 | { 565 | "name": "NectarJS", 566 | "source_languages": "JavaScript", 567 | "target_languages": "C", 568 | "notes": "The primary target is WebAssembly. [How to compile to C](https://github.com/NectarJS/nectarjs/issues/46#issuecomment-498532350).", 569 | "links": { 570 | "repo": "https://github.com/NectarJS/nectarjs" 571 | } 572 | }, 573 | { 574 | "name": "Nelua", 575 | "source_languages": "Nelua", 576 | "target_languages": "C", 577 | "notes": "A statically-typed meta-programmable systems programming language heavily inspired by Lua.", 578 | "links": { 579 | "web": "https://nelua.io" 580 | } 581 | }, 582 | { 583 | "name": "Nim", 584 | "source_languages": "Nim", 585 | "target_languages": "C | C++ | Objective C", 586 | "notes": "", 587 | "links": { 588 | "web": "http://nim-lang.org" 589 | } 590 | }, 591 | { 592 | "name": "Nit", 593 | "source_languages": "Nit", 594 | "target_languages": "C", 595 | "notes": "", 596 | "links": { 597 | "web": "http://nitlanguage.org/" 598 | } 599 | }, 600 | { 601 | "name": "NN-512", 602 | "source_languages": "NN-512", 603 | "target_languages": "C", 604 | "notes": "Graph language. Generate C99 code for neural net inference.", 605 | "links": { 606 | "web": "https://nn-512.com/" 607 | } 608 | }, 609 | { 610 | "name": "Nuitka", 611 | "source_languages": "Python", 612 | "target_languages": "C", 613 | "notes": "", 614 | "links": { 615 | "web": "http://nuitka.net/" 616 | } 617 | }, 618 | { 619 | "name": "OBNC", 620 | "source_languages": "Oberon", 621 | "target_languages": "C", 622 | "notes": "", 623 | "links": { 624 | "web": "http://www.miasap.se/obnc/" 625 | } 626 | }, 627 | { 628 | "name": "ocamlcc", 629 | "source_languages": "OCaml", 630 | "target_languages": "C", 631 | "notes": "Compiles OCaml bytecode to C.", 632 | "links": { 633 | "repo": "https://github.com/ocaml-bytes/ocamlcc" 634 | } 635 | }, 636 | { 637 | "name": "oi", 638 | "source_languages": "oi", 639 | "target_languages": "C", 640 | "notes": "C with traits. Compiles to code that can be directly used from plain C.", 641 | "links": { 642 | "repo": "https://github.com/hodefoting/oi/" 643 | } 644 | }, 645 | { 646 | "name": "ooc", 647 | "source_languages": "ooc", 648 | "target_languages": "C", 649 | "notes": "", 650 | "links": { 651 | "web": "http://ooc-lang.org" 652 | } 653 | }, 654 | { 655 | "name": "OpenDylan", 656 | "source_languages": "Dylan", 657 | "target_languages": "C", 658 | "notes": "", 659 | "links": { 660 | "web": "http://opendylan.org/" 661 | } 662 | }, 663 | { 664 | "name": "p2c", 665 | "source_languages": "Pascal | UCSD | Turbo Pascal | Modula-2", 666 | "target_languages": "C | C++", 667 | "notes": "Supports several Pascal dialects, including UCSD and Turbo Pascal, Modula-2.", 668 | "links": { 669 | "web": "http://users.fred.net/tds/lab/p2c/" 670 | } 671 | }, 672 | { 673 | "name": "ParparVM", 674 | "source_languages": "Java bytecode", 675 | "target_languages": "C", 676 | "notes": "Use for the Java to iOS portability part of the [Codename One](https://www.codenameone.com/) project.", 677 | "links": { 678 | "repo": "https://github.com/codenameone/CodenameOne/tree/master/vm" 679 | } 680 | }, 681 | { 682 | "name": "perlcc", 683 | "source_languages": "Perl 5", 684 | "target_languages": "C", 685 | "notes": "", 686 | "links": { 687 | "web": "http://search.cpan.org/dist/B-C/" 688 | } 689 | }, 690 | { 691 | "name": "purescript-native", 692 | "source_languages": "PureScript", 693 | "target_languages": "C++", 694 | "notes": "", 695 | "links": { 696 | "repo": "https://github.com/andyarvanitis/purescript-native" 697 | } 698 | }, 699 | { 700 | "name": "Py14", 701 | "source_languages": "Python", 702 | "target_languages": "C++", 703 | "notes": "", 704 | "links": { 705 | "repo": "https://github.com/lukasmartinelli/py14" 706 | } 707 | }, 708 | { 709 | "name": "Pythran", 710 | "source_languages": "Python", 711 | "target_languages": "C++", 712 | "notes": "", 713 | "links": { 714 | "repo": "https://github.com/serge-sans-paille/pythran" 715 | } 716 | }, 717 | { 718 | "name": "QuickJS", 719 | "source_languages": "JavaScript", 720 | "target_languages": "C", 721 | "notes": "Compiles JavaScript (ES2020) to bytecode and embeds the bytecode in C.", 722 | "links": { 723 | "web": "https://bellard.org/quickjs/" 724 | } 725 | }, 726 | { 727 | "name": "Ragel", 728 | "source_languages": "Ragel", 729 | "target_languages": "C | C++", 730 | "notes": "Compiles executable finite state machines from regular languages.", 731 | "links": { 732 | "web": "http://www.colm.net/open-source/ragel/" 733 | } 734 | }, 735 | { 736 | "name": "RPerl", 737 | "source_languages": "RPerl | Perl.", 738 | "target_languages": "C++", 739 | "notes": "RPerl, a restricted subset of Perl. Unrelated to RPython.", 740 | "links": { 741 | "repo": "https://github.com/wbraswell/rperl" 742 | } 743 | }, 744 | { 745 | "name": "RPython", 746 | "source_languages": "RPython | Python.", 747 | "target_languages": "C", 748 | "notes": "RPython, a restricted subset of Python. Unrelated to RPerl.", 749 | "links": { 750 | "web": "https://rpython.readthedocs.org/en/latest/" 751 | } 752 | }, 753 | { 754 | "name": "Sather", 755 | "source_languages": "Sather", 756 | "target_languages": "C", 757 | "notes": "", 758 | "links": { 759 | "web": "http://www.gnu.org/software/sather/" 760 | } 761 | }, 762 | { 763 | "name": "Scheme-to-C", 764 | "source_languages": "Scheme", 765 | "target_languages": "C", 766 | "notes": "Example nanopass compiler", 767 | "links": { 768 | "repo": "https://github.com/akeep/scheme-to-c" 769 | } 770 | }, 771 | { 772 | "name": "Seed7", 773 | "source_languages": "Seed7", 774 | "target_languages": "C", 775 | "notes": "", 776 | "links": { 777 | "web": "http://seed7.sourceforge.net/" 778 | } 779 | }, 780 | { 781 | "name": "Shedskin", 782 | "source_languages": "Python", 783 | "target_languages": "C++", 784 | "notes": "", 785 | "links": { 786 | "repo": "https://github.com/shedskin/shedskin" 787 | } 788 | }, 789 | { 790 | "name": "SLua", 791 | "source_languages": "Lua", 792 | "target_languages": "C", 793 | "notes": "", 794 | "links": { 795 | "repo": "https://github.com/Neopallium/slua" 796 | } 797 | }, 798 | { 799 | "name": "SystemTap", 800 | "source_languages": "SystemTap", 801 | "target_languages": "C", 802 | "notes": "SystemTap scripting language compiles kernel modules for monitoring Linux systems.", 803 | "links": { 804 | "web": "http://sourceware.org/systemtap/" 805 | } 806 | }, 807 | { 808 | "name": "ThinScript", 809 | "source_languages": "ThinScript", 810 | "target_languages": "C | JavaScript | WebAssembly", 811 | "notes": "A lower-level programming language inspired by TypeScript. ThinScript also compiles to JavaScript and WebAssembly.", 812 | "links": { 813 | "repo": "https://github.com/evanw/thinscript" 814 | } 815 | }, 816 | { 817 | "name": "ts2c", 818 | "source_languages": "JavaScript | TypeScript", 819 | "target_languages": "C", 820 | "notes": "Compiles a subset of JavaScript/TypeScript (ES3) to readable C89.", 821 | "links": { 822 | "repo": "https://github.com/andrei-markeev/ts2c" 823 | } 824 | }, 825 | { 826 | "name": "TSP", 827 | "source_languages": "Tcl", 828 | "target_languages": "C", 829 | "notes": "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.", 830 | "links": { 831 | "repo": "https://github.com/tpoindex/tsp" 832 | } 833 | }, 834 | { 835 | "name": "UbxBasic", 836 | "source_languages": "Basic", 837 | "target_languages": "C | C++", 838 | "notes": "A fork of [BCX](http://bcx-basic.sourceforge.net/) that adds Linux support in addition to Windows. Uses Glib.", 839 | "links": { 840 | "web": "https://sourceforge.net/projects/ubxbasic/" 841 | } 842 | }, 843 | { 844 | "name": "Ur/Web", 845 | "source_languages": "Ur/Web", 846 | "target_languages": "C", 847 | "notes": "", 848 | "links": { 849 | "web": "http://www.impredicative.com/ur/" 850 | } 851 | }, 852 | { 853 | "name": "V", 854 | "source_languages": "V", 855 | "target_languages": "C", 856 | "notes": "A no-GC systems language with modern features like sum types and immutability by default.", 857 | "links": { 858 | "repo": "https://github.com/vlang/v" 859 | } 860 | }, 861 | { 862 | "name": "Vala", 863 | "source_languages": "Vala", 864 | "target_languages": "C", 865 | "notes": "", 866 | "links": { 867 | "web": "https://wiki.gnome.org/Projects/Vala" 868 | } 869 | }, 870 | { 871 | "name": "Vostok", 872 | "source_languages": "Oberon-07", 873 | "target_languages": "C | Java | JavaScript | Oberon", 874 | "notes": "", 875 | "links": { 876 | "repo": "https://github.com/Vostok-space/vostok" 877 | } 878 | }, 879 | { 880 | "name": "wasm2c", 881 | "source_languages": "WebAssembly", 882 | "target_languages": "C", 883 | "notes": "Converts WASM files to C source and header.", 884 | "links": { 885 | "repo": "https://github.com/WebAssembly/wabt/tree/master/wasm2c" 886 | } 887 | }, 888 | { 889 | "name": "wasmdec", 890 | "source_languages": "WebAssembly", 891 | "target_languages": "C", 892 | "notes": "Converts WebAssembly binaries to C.", 893 | "links": { 894 | "repo": "https://github.com/wwwg/wasmdec" 895 | } 896 | }, 897 | { 898 | "name": "wax", 899 | "source_languages": "wax", 900 | "target_languages": "C | C# | C++ | Java | Lua | Python | Swift | TypeScript | WebAssembly", 901 | "notes": "A language design for transpiling.", 902 | "links": { 903 | "web": "https://github.com/LingDong-/wax" 904 | } 905 | }, 906 | { 907 | "name": "Zephir", 908 | "source_languages": "Zephir", 909 | "target_languages": "C", 910 | "notes": "A language for writing PHP extensions.", 911 | "links": { 912 | "web": "http://zephir-lang.com/" 913 | } 914 | }, 915 | { 916 | "name": "ZZ", 917 | "source_languages": "ZZ (Drunk Octopus)", 918 | "target_languages": "C", 919 | "notes": "A safe dialect of C for embedded systems inspired by Rust.", 920 | "links": { 921 | "repo": "https://github.com/aep/zz" 922 | } 923 | } 924 | ] 925 | -------------------------------------------------------------------------------- /src/doc_pieces/README_footer.md: -------------------------------------------------------------------------------- 1 | 2 | ## C macro languages 3 | * [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. 4 | * [LISP/c](https://github.com/eratosthenesia/lispc), a Common Lisp-based macrolanguage for C. 5 | 6 | ## See also 7 | * [Cello](http://libcello.org/), a library for high-level programming in C. 8 | * [Clue](http://cowlark.com/clue/), an ANSI C compiler targeting high level languages (Lua, JavaScript, Perl 5, C, Java, Common Lisp). 9 | * [LLVM C backend resurrected](https://github.com/draperlaboratory/llvm-cbe). 10 | * [luastatic](https://github.com/ers35/luastatic), a tool that builds standalone executables from Lua programs by embedding Lua code in C. 11 | 12 | ## Contributing 13 | 14 | Your contributions are welcome! Please submit a pull request or create an issue to add a new compiler to the list. 15 | 16 | ## License 17 | 18 | [![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/) 19 | -------------------------------------------------------------------------------- /src/doc_pieces/README_header.md: -------------------------------------------------------------------------------- 1 | # Compilers targeting C 2 | 3 | The following is a list of open source compilers that can generate C (or in some cases, C++) code. 4 | -------------------------------------------------------------------------------- /src/generate.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | This is a main file to trigger README.md generation 3 | Execution cmd: 4 | node src/generate.mjs 5 | */ 6 | 7 | import { database } from "./database.mjs" 8 | import { readFromFile, saveToFile } from "./utils/file.mjs"; 9 | import { escapeString, link, lowercaseArrayOfStrings, stringToArray, tableHeader, tableRow } from "./utils/misc.mjs"; 10 | 11 | export const normalizeEntry = (entry) => { 12 | const normalized = { 13 | name: entry.name, 14 | source_languages: stringToArray(entry.source_languages), 15 | target_languages: stringToArray(entry.target_languages), 16 | notes: entry.notes, 17 | links: { 18 | web: stringToArray(entry.links?.web), 19 | repo: stringToArray(entry.links?.repo), 20 | doc: stringToArray(entry.links?.doc) 21 | } 22 | } 23 | 24 | return normalized; 25 | } 26 | 27 | const database_normalized = database.map(normalizeEntry).sort((a, b) => { // sort ascending 28 | a = a.name.toLowerCase() 29 | b = b.name.toLowerCase() 30 | 31 | if (a > b) return 1; 32 | if (a < b) return -1; 33 | return 0 34 | }); 35 | 36 | // pld - programming language description 37 | const getTable = (pld_list) => { 38 | const table_content = pld_list.map(pld => { 39 | let name; 40 | if (pld.links.web.length) { 41 | name = link(pld.links.web[0], pld.name); 42 | } else { 43 | if (pld.links.repo.length) { 44 | name = link(pld.links.repo[0], pld.name); 45 | } else if (pld.links.doc.length) { 46 | name = link(pld.links.doc[0], pld.name); 47 | } else { 48 | name = pld.name; 49 | } 50 | } 51 | 52 | const languages_supported = pld.source_languages.join(", "); 53 | const targets_supported = pld.target_languages.join(", "); 54 | const notes = escapeString(pld.notes); 55 | 56 | const links = [ 57 | pld.links.web.map(l => link(l, "web")).join(" "), 58 | pld.links.repo.map(l => link(l, "repo")).join(" "), 59 | pld.links.doc.map(l => link(l, "doc")).join(" "), 60 | ].filter(l => l).join(" ") 61 | 62 | return tableRow([ 63 | name, 64 | languages_supported, 65 | targets_supported, 66 | notes, 67 | links 68 | ]) 69 | 70 | }).join("\n") 71 | 72 | return tableHeader([ 73 | "Name", "Supported languages", "Supported targets", "Notes", "Links" 74 | ]) + "\n" + table_content; 75 | } 76 | 77 | // --- 78 | 79 | const readme_header = readFromFile("src/doc_pieces/README_header.md") 80 | const pl_table = getTable(database_normalized) 81 | const readme_footer = readFromFile("src/doc_pieces/README_footer.md") 82 | 83 | saveToFile("README.md", [ 84 | readme_header, 85 | pl_table, 86 | readme_footer 87 | ].join("\n")) 88 | -------------------------------------------------------------------------------- /src/utils/file.mjs: -------------------------------------------------------------------------------- 1 | import fs from "fs" 2 | 3 | export const saveToFile = (file_path, content) => { 4 | fs.writeFileSync(file_path, content) 5 | } 6 | 7 | export const readFromFile = (file_path) => { 8 | return fs.readFileSync(file_path, "utf-8") 9 | } 10 | -------------------------------------------------------------------------------- /src/utils/misc.mjs: -------------------------------------------------------------------------------- 1 | export const stringToArray = (string) => { 2 | if (!string) return [] 3 | if (Array.isArray(string)) return string.map(s => s.trim()); 4 | return string.split("|").map(s => s.trim()) 5 | } 6 | 7 | export const lowercaseArrayOfStrings = (array_of_strings) => { 8 | return array_of_strings.map(s => s.toLowerCase()) 9 | } 10 | 11 | export const escapeString = (string) => { 12 | if (!string) return ""; 13 | return string.replace(/\|/g, "\\|") 14 | } 15 | 16 | export const link = (link, description) => { 17 | if (description) { 18 | return `[${escapeString(description)}](${link})` 19 | } 20 | return link 21 | } 22 | 23 | export const tableRow = (items) => `| ${ items.join(" | ") } |` 24 | export const tableHeader = (items) => tableRow(items) + "\n| " + items.map(i => "---").join(' | ') + " |" 25 | --------------------------------------------------------------------------------