Get Started with CIMPLE

From zero to "Hello, World!" in 5 minutes. Follow these simple steps to run your first program.

1

Download the Compiler

First, get the `cimplec` compiler source code from the official GitHub repository. You will need a C++ compiler (like `g++`) installed on your system to build it.

Terminal
# Clone the repository
git clone https://github.com/your-username/cimple.git

# Navigate into the project directory
cd cimple

# Compile the transpiler
g++ src/*.cpp -o cimplec
2

Write Your First Program

Create a new file named `hello.cimp` and open it in your favorite text editor. Write the following code to print a welcome message.

hello.cimp
# My first CIMPLE program!

def main()
    print("Hello from CIMPLE!")
end
3

Transpile and Compile

Use the `cimplec` executable you just built to transpile your `.cimp` file into a `.cpp` file. Then, use `g++` to compile that C++ code into a native binary.

Terminal
# Transpile .cimp to .cpp
./cimplec hello.cimp

# Compile the output C++ file
g++ hello.cpp -o hello_app
4

Run Your Application!

You now have a native executable file. Run it from your terminal to see the output.

Terminal
# Run the compiled application
./hello_app

# Expected output:
# Hello from CIMPLE!

Congratulations! You've successfully run your first CIMPLE program.

Where to Go Next?