copy Copy chevron-down
Getting started with CLight Quickly set up and write your first line of CLight code!
What is CLight?
CLight is a programming language developed by third year Epitech students. Based on C, it reproduces several of the core programming concepts and syntax.
Setup the environment
Follow these instructions to setup your environment:
Copy curl -sSL https://get.haskellstack.org/ | sh
Copy sudo apt-get install -y ghc
Copy wget https://apt.llvm.org/llvm.sh ; chmod +x llvm.sh ; sudo ./llvm.sh
Copy sudo ln -s /usr/bin/llvm-config-9 /usr/bin/llvm-config Installing the CLight compiler
To be able to program in CLight, you'll first have to download the compiler:
Install the dependencies:
Compile the compiler using the Makefile, with the command:
You should now find a new binary called glados in the part2 folder.
Compiling CLight
Start by creating a simple script in a new file. For this example, we'll call it example.cl. Let's add a simple function:
To compile, use the binary called glados:
You should now have an object file called example.o next to your example.cl script.
Create another script in the language you want. For this example, we'll use the C programming language, and create a new file called main.c.
Compile both the main.c file and the example.o file:
Now if you execute the binary, you should see "add: 20" displayed in the terminal: