GithubHelp home page GithubHelp logo

compilers-targeting-c's Introduction

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 Alumina C Inspired by Rust web repo
ATS ATS C web
Austral Austral C Has some similarities to Haskell and Ada web repo doc
BaCon (Basic Converter) Basic C web
bc9Basic Basic C Can generate C or C++ code. Runs only on Windows but can generate code for *nix. A fork of BCX that outputs valid ISO/ANSI C. Website archive. web
Bigloo Scheme C Scheme (R5RS) web
Blech Blech C A synchronous programming language for embedded reactive real-time-critical software. repo
bmx-ng BlitzMax C A Monkey-derived BlitzMax to C transpiler. repo
Cakelisp Cakelisp C, C++ Lisp-like programming language web repo doc
Carp Carp, Lisp C A statically typed lisp, without a GC, for real-time applications. repo
Cforall Cforall, C C Extends ISO C and outputs augmented C code web repo doc
Chapel Chapel C web
CHICKEN Scheme Scheme C Scheme (R5RS) web
Ciao Prolog C web
CLiCC Common Lisp C Compiles a large strict subset of Common Lisp + CLOS to C. repo
Critical Mass Modula-3 Modula-3 C repo
Cyclone Scheme C Scheme (R7RS). Cheney on the M.T.A. with native threads. repo
Cython Python C web
Céu Céu C web
eC eC C An object-oriented superset of C with modules and generics. web
EiffelStudio Eiffel C web
Embeddable Common-Lisp Common Lisp C ANSI Common Lisp web
Emfrp Emfrp C A pure functional reactive programming language for small-scale embedded systems. repo
Emgo Go C Compiles a subset of Go for 32-bit microcontrollers through C. repo
Epic Epic C web
Esotope Brainfuck Compiler Brainfuck C repo
Euphoria to C Translator Euphoria C web
f2c Fortran 77 C web
Felix Felix C++ repo
FreeBASIC Basic C web
fut Fusion C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript, OpenCL A language for making portable libraries with a syntax like C#. web
Futhark Futhark C Purely functional data-parallel language generating OpenCL C repo
Gambit Scheme C Scheme (R5RS) web
GCL Common Lisp C web
Genie Genie C web
GHC Haskell C C backend documentation page. web
GnuCOBOL COBOL C COBOL 2014 with extensions web
go2cpp Go C++ Designed to help port Go to C++ repo
GoLite GoLite, Go C++ Transpiles a strict subset of Go repo
Harbour xBase, CA-Clipper C xBase compatible with CA-Clipper repo
Haxe Haxe C, C++ web
Idris Idris C A pure functional programming language with dependent types. web
Ivory Ivory C A Haskell eDSL for safe systems programming. web
jhc Haskell 98 C The resulting code doesn't use a garbage collector. web
Kit Kit C A statically typed procedural language with manual MM, traits, pattern matching, and metaprogramming designed with game development in mind. web
Language84 Language84 C web
m m C, WebAssembly It targets webassembly but actually it compiles to C and then requires to trigger manually clang to get webassembly web repo
ManKai Common Lisp Common Lisp C web
matiec ST, IL, SFC C A set of textual languages for PLC programming. (SFC: IEC 61131) repo
mbeddr mbeddr C A set of languages for embedded software engineering. web
Mercury Mercury C web
MLton Standard ML C web
Monkey 2 Monkey 2 C++ web
Mrustc Rust C repo
NectarJS JavaScript C The primary target is WebAssembly. How to compile to C. repo
Nelua Nelua C A statically-typed meta-programmable systems programming language heavily inspired by Lua. web
Nim Nim C, C++, Objective C web
Nit Nit C web
NN-512 NN-512 C Graph language. Generate C99 code for neural net inference. web
Nuitka Python C web
nullc nullc C, x86, VM It is a C-like programming language repo doc
OBNC Oberon C web
ocamlcc OCaml C Compiles OCaml bytecode to C. repo
oi oi C C with traits. Compiles to code that can be directly used from plain C. repo
ooc ooc C web
OpenDylan Dylan C web
p2c Pascal, UCSD, Turbo Pascal, Modula-2 C, C++ Supports several Pascal dialects, including UCSD and Turbo Pascal, Modula-2. web
ParparVM Java bytecode C Use for the Java to iOS portability part of the Codename One project. repo
perlcc Perl 5 C web
prometeo Python C Transpiles subset of Python repo doc
PtoC pascal, Turbo Pascal, Oregon Pascal, ISO Pascal, Sun Pascal, HP Pascal C, C++ Transpiles to readable code repo
purescript-native PureScript C++ repo
Py14 Python C++ repo
Pythran Python C++ repo
QuickJS JavaScript C Compiles JavaScript (ES2020) to bytecode and embeds the bytecode in C. web
Ragel Ragel C, C++ Compiles executable finite state machines from regular languages. web
RPerl RPerl, Perl. C++ RPerl, a restricted subset of Perl. Unrelated to RPython. repo
RPython RPython, Python. C RPython, a restricted subset of Python. Unrelated to RPerl. web
Sather Sather C web
Scheme-to-C Scheme C Example nanopass compiler repo
Seed7 Seed7 C web
Shedskin Python C++ repo
SLua Lua C repo
SystemTap SystemTap C SystemTap scripting language compiles kernel modules for monitoring Linux systems. web
ThinScript ThinScript C, JavaScript, WebAssembly A lower-level programming language inspired by TypeScript. ThinScript also compiles to JavaScript and WebAssembly. repo
TMPPy TMPPy, Python C++ Transpiles a subset of Python repo doc
ts2c JavaScript, TypeScript C Compiles a subset of JavaScript/TypeScript (ES3) to readable C89. repo
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
UbxBasic Basic C, C++ A fork of BCX that adds Linux support in addition to Windows. Uses Glib. web
Ur/Web Ur/Web C web
V V C A no-GC systems language with modern features like sum types and immutability by default. repo
Vala Vala C web
Vostok Oberon-07 C, Java, JavaScript, Oberon repo
wasm2c WebAssembly C Converts WASM files to C source and header. repo
wasmdec WebAssembly C Converts WebAssembly binaries to C. repo
wax wax C, C#, C++, Java, Lua, Python, Swift, TypeScript, WebAssembly A language design for transpiling. web
Yaksha 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 repo doc
Zephir Zephir C A language for writing PHP extensions. web
ZZ ZZ (Drunk Octopus) C A safe dialect of C for embedded systems inspired by Rust. repo

C macro languages

  • C-Mera, a simple source-to-source compiler that transforms s-expression notation to code in a C-family language.
  • LISP/c, a Common Lisp-based macrolanguage for C.

See also

  • Cello, a library for high-level programming in C.
  • Clue, an ANSI C compiler targeting high level languages (Lua, JavaScript, Perl 5, C, Java, Common Lisp).
  • LLVM C backend resurrected.
  • 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

compilers-targeting-c's People

Contributors

aep avatar athas avatar avodonosov avatar bencz avatar danielmazurkiewicz avatar dbohdan avatar dom96 avatar hellerve avatar immutableoctet avatar ionelmc avatar jadogg avatar jubnzv avatar justinethier avatar kingland avatar lassik avatar nadako avatar neopallium avatar pfusik avatar seanjensengrey avatar shai-almog avatar solarspot avatar sylvain-josserand avatar tommy-carlier avatar vurv78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compilers-targeting-c's Issues

Lua2C

Lua2C is a compiler that translates Lua source files to C source files. Should it be included in this list as well?

Is this repository maintained?

@dbohdan It has been a while since you've updated this repository. I know you're from Ukraine and I really hope you're safe and ok. If you need a help with maintaining this repo let me know.

Pascal to C

Another one: https://github.com/knizhnik/ptoc/
Although the guthub repository is only 3 years old, the program has actually been around for some time. The files in my own system are dated 1997 and I'm pretty sure it predated that by quite a few years too.
Completely unrelated to p2c.

Algol60 to C

Two different A60 to C systems:

https://github.com/JvanKatwijk/algol-60-compiler

https://www.gnu.org/software/marst/

(btw there are a few work-in-progress translators to C for a language in the Algol style, "Imp", but none currently fully working - I'll post when we have a release that is usable. I also have a crude "Atlas Autocode" to C translator, but it was written to convert one single program - the Imp compiler for the KDF9 - and is also not really release-worthy yet).

Amendment: a third one: http://www.algol60.org/15algolwcomp.htm

──────────────────────────────────────────────────────────────────────
AWE: an Algol W compiler
──────────────────────────────────────────────────────────────────────

Awe is a new compiler for the Algol W language. It is intended to to
be a correct and complete implementation of the language described in
the Algol W Language Description, June 1972.

Awe should be able to compile code intended for the System/360 ALGOLW
and XALGOLW compilers with little or no modification.

Awe uses Gnu C (with its extensions) as an intermediate language.
It allows Algol W programs to be linked to C object code.

Wasmdec

There's a compiler called wasmdec that converts WebAssembly modules to C source code. Should it be included in this list?

Consider adding TSP

Hi,
You might want to consider adding my TSP project as an open source compile-to-C compiler. TSP targets a subset of Tcl. Currently, it compiles to C (or Java), and to a loadable Tcl module on the fly. If this doesn't meet your criteria, feel free to cancel this issue.
https://github.com/tpoindex/tsp

Felix language website changed.

http://felix-lang.org/ redirects to https://www.crowncork.com/, I would suggest changing the link to https://github.com/felix-lang/felix.

go2cpp

I found another compiler that translates a subset of Go to C++. Should it be included in the list of compilers?

Freebasic

The freebasic compiler can generate C code for gcc and can be found here on github or freebasic dot net

Odin

The Odin Programming Language
The Odin programming language is fast, concise, readable, pragmatic and open sourced. It is designed with the intent of creating an alternative to C with the following goals:

  • simplicity
  • high performance
  • built for modern systems
  • joy of programming

github.com/odin-lang/Odin

Add Cake

Cake is a C23 compiler frond end written from scratch in C.

The compiler can be used to translate new versions of C (like C23) to C99.

It also can be used to try out new features for the C language.

Extensions like lambdas, defer and more where implemented.

https://github.com/thradams/cake

go2cpp

I found another compiler (go2cpp) that translates a subset of Go to C++.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.