code


A statically typed, general-purpose programming language, crafted for simplicity and performance.

"Trust the programmer" - corx







corx is a simple, efficient programming language designed for systems-level programming with a focus on manual memory management and minimalistic syntax. With corx, you have full control over system resources, offering maximum performance and clarity, without the overhead of complex language features. Whether you're developing performance-critical applications or need a low-level language with modern features like contract-based design, corx is built to meet those needs.

Explore the documentation and learn how corx can help you write clean, efficient, and performance-driven code.


module main;

import * from "std:io"; # import all

contract action {
    bool make();
};

struct kernel {
    int time = 3; # time before it pops
};

struct popcorn : kernel {
    float temp;
} action;

# constructor
popcorn : popcorn(float temp, int time) {
    this->time = time;
    this->temp = temp;
}

# destructor
popcorn : %popcorn() {}

# contract fulfillment
popcorn : bool make() {
    if (this->temp >= 180.0) {
        return true;
    } else {
        return false;
    }
}

popcorn *pcorn = new popcorn(200.0, 5);
bool popped = pcorn->make();

print(pcorn->temp);
printn(popped);  # prints '1'

purge pcorn;