cheerp® is the C++ compiler for the web
write a web application, or port your existing one, all in C++.
cheerp will generate JavaScript code that can run on any browser.
Chosen by:

Why C++?

> write web applications in fully type-safe C++ code
> make use of uncountable existing libraries
> leverage existing knowledge
> reuse code
> improve productivity

Why cheerp?

> open-source compiler based on LLVM
> native JavaScript memory model
> clean access to HTML5 DOM
> optimized performances and output size
> JavaScript interoperability
> in-browser debugging
> enterprise-grade support, consulting, training and porting services
> a seamless C++ programming experience for the Web
In short, because cheerp is a modern, fast and robust open-source C++-to-JavaScript compiler, battle-tested on million-lines codebases and backed by enterprise-grade licensing, support, consulting, training and porting services.


Clean access to HTML5 DOM

Access any HTML5 API function, including DOM and WebGL, with no overhead or wrappers
HTMLElement* body=document.get_body();
HTMLElement* newElement=document.createElement("h1");
newElement->set_textContent("Hello World");
With cheerp, you don't need to use any involved syntax or wrapper libraries to access all HTML5 functions from C++.

A simple, type-safe browser API allows to generate JavaScript calls with no overhead.

Native memory model

The cheerp compiler is the only C++-to-Javascript compiler in the world that uses the native JavaScript object-based memory model without emulation layers.

Other C++-to-JavaScript compilers emulate the traditional, "flat", memory model on top of the native JS memory model using a huge, multi-gigabyte typed array.

With cheerp technology, C++ objects are mapped directly to JS objects.

This innovative approach has many advantages over the old, memory emulation one:

> Dynamic memory allocation

C++ objects are allocated and deallocated when needed, there is no necessity to pre-allocate all the space before to avoid costly reallocation operations.

> No memory limits

Flat memory emulation is limited by the maximum size of JavaScript typed arrays and by the memory size addressable by pointers emulated with 32-bit integers.

This means that, practically speaking, memory-emulating applications are limited to 2 gigabytes of memory, or they have to resort to slow paging emulation techniques.

> Security by design

Buffer-overflow vulnerabilities intrinsecally need the flat memory model to exist. With cheerp, every object is perfectly insulated from the rest of the memory.

> Wider browser support

JavaScript typed arrays, necessary for flat memory emulation, are not supported by many older browsers. With cheerp, you can target also those browsers if your applications need to.

Interact with JavaScript

Cheerp allows to use C++ classes from JavaScript code using the [[cheerp::jsexport]] attribute and embed arbitrary JavaScript code in C++ code with the __asm__ keyword.
// C++: Expose the class to JavaScript
class [[cheerp::jsexport]] JsStruct
        float a;
        JsStruct(float _a):a(_a) {}
        void test()
            client::console.log("C++ code is been called!");

// JS: Call methods from your JS code
var testExport = new JsStruct(42.0);
Find out more on this feature here.

In-browser debugging support

Cheerp fully supports the SourceMaps standard, which makes it possible to debug your original C++ code directly in the browser.

Set break points, step the execution and see the original C++ code when an exception happens.

Optimized performances

LLVM provides a bulletproof, state-of-the-art foundation for our compile-to-JavaScript technology.

Your code will pass through the full optimization stack provided by LLVM, plus a few Cheerp specific optimizations.

You write nice, easy to understand and maintain code, Cheerp will take care of generating highly optimized JavaScript from it.

Open-source and commercial licensing

The cheerp core compiler is distributed as a Free and Open Source Software under the University of Illinois/NCSA Open Source License, the same license the LLVM compiler is distributed under.

The supporting libraries, which need to be linked to applications compiled with cheerp, are licensed either under the GNU General Public License v2 or under a commercial, non-copyleft proprietary license.

Please note that if you use the GPLv2-licensed cheerp libraries for developing commercial applications, you need to comply to the GPLv2 license terms regarding the distribution of you application source code to your users.

If you want to know more about our licensing schemes and pricing, you can visit the pricing section.

Enterprise-grade support and services

In addition to commercial licensing, we offer enterprise-grade support with customizable SLAs and tailored consulting services.

We will adjust our consulting offer based on your company precise needs.

Our services range from basic advice and NDA-bound code review to complete application porting service.

Getting started is easy!

To get started with cheerp, just follow these 3 easy steps:
  1. Download and install cheerp binaries for your platform
  2. Follow the tutorial and the browser-side programming guide
  3. Read the wiki and the DOM API reference
If you need assistance getting up to speed, you can find us on gitter.