Skip to content
sderossi edited this page Feb 15, 2019 · 42 revisions

Cheerp - a C/C++ compiler for Web applications

Gitter chat GitHub Issues Latest version Latest version changelog

Cheerp is an open-source, commercial C/C++ compiler for Web applications. It allows to compile virtually any C/C++ code (up to C++14) to WebAssembly, JavaScript, asm.js or a combination thereof.

Download latest version: Latest version Latest version changelog

Main project link: https://leaningtech.com/cheerp/

This repository is the main reference for documentation, issue tracking, and release notes.

What is Cheerp?

Cheerp is a C/C++ compiler for the Web, based and integrated into the LLVM/clang infrastructure, and featuring numerous custom optimisation steps to maximise performance and minimise size of the compiled JavaScript/WebAssembly output. As such, Cheerp is the best performing, most optimised C++ to WebAssembly compiler available on the market.

Cheerp is used mainly to port existing C/C++ libraries and applications to HTML5, but can also be used to write high-performance Web applications and components from scratch. C/C++ gets optimised and compiled into JavaScript/WebAssembly, and can easily be deployed as part of a web page.

What is unique about Cheerp?

Cheerp enables C/C++ code to be compiled to WebAssembly, JavaScript, asm.js or a combination thereof. Compared to alternative C/C++ compilers for web applications such as Emscripten, Cheerp:

  1. Generates up to 30% faster (7% on average) WebAssembly code, but can also compile to a JavaScript output with dynamic memory (garbage-collectible output), zero-overhead DOM manipulation and access to WebApis and superior C++-JavaScript interoperability.
  2. Allows to compile a single code base into a combination of WebAssembly and JavaScript by (optionally) tagging portions of the code with [[cheerp::genericjs]] and [[cheerp::wasm]].
  3. Can generate code up to 20% smaller than Emscripten.

Cheerp is open-source software and is free to use for GPLv2 projects. Non-copyleft commercial licenses, commercial support and consulting packages are available from Leaning Technologies.

Getting Started

You can try Cheerp without installation thanks to this Cheerp playground by Ray Burgemeestre.

You can download the latest official release of Cheerp for Windows, Linux and macOS a this address: https://leaningtech.com/cheerp/download/. Installation instructions are available here. Alternatively, you can build Cheerp from source. Please follow the instructions available here.

To get started, you can have a look at our simple tutorial to build your first JavaScript Hello World, or your first WebAssembly program.

For a more in-depth tutorial, please visit this tutorial: a game of Pong in WebAssembly.

Bugs and Questions

You can get in touch with us using our Gitter chat, or by filing a bug on our Issue tracker.

Clone this wiki locally
You can’t perform that action at this time.