Introduction

cx is a C-based hybrid low-level/high-level general-purpose programming language. It is designed for applications where runtime performance and programmer productivity matter. The language is simple and unopinionated, supporting imperative, generic, data-oriented, functional, and object-oriented programming. The language also aims to support interoperability and side-by-side usage with existing C/C++ code to allow gradual adoption.

Goals

The primary goals of cx are:

Why cx?

C++ is a huge and complex language that has accumulated many problems over the years, for example:

It is clear that we can't keep adding more and more features to C++ and writing new code in it forever. Sooner or later it will be replaced by another language or languages (for writing new code).

"Within C++, there is a much smaller and cleaner language struggling to get out." - Bjarne Stroustrup

cx is trying to be that language.

Let's take a look at another popular systems programming language, Rust, which also solves the majority of the above problems. Rust differs from cx in the following aspects:

So in summary, cx is intended to be used over Rust for non-safety-critical applications where programmer productivity, ergonomics, and performance are more important than Rust's safety and explicitness.

Not to be confused with

cx shares its name with several unrelated languages:

Further reading