Getting Started

How to get started on with the Occult programming language.

What is Occult?

Occult is a powerful systems programming language, meant to give the user the full control and power of a C-like language, but with a modern syntax and modern features, making it easy to write, read, and learn.

Occult is currently in alpha, there will be bugs.

Building the Language

Let's start out with how to build the compiler.

You must be on an x86_64 computer, as the only architecture also supported by the language is amd64 as of now. If you don't want to compile anything, there is prebuilt binaries for Windows and Linux on the GitHub page under releases, and you can just skip to Running a Program

Linux Build Instructions

On Linux based systems, it's fairly straighforward to build Occult.

Prerequisites

Occult has some prerequisites you need to make sure are installed before you compile the language.

  • Language version of C++ should be C++23 or higher
  • clang
  • cmake
  • make
  • git

Just to note, the reason for clang to be used instead of gcc is kind of technical, but to explain it in short if the language is compiled using gcc Occult just doesn't work as intended, and fails to execute a lot of the code that you throw at it, note the generated machine code that the language (Occult) generates is the same regardless of which compiler you use to build it.

Regardless, in the CMakeLists.txt it enforces clang++ / clang.

Build Commands

The commands you have to run to compile Occult.

bash
git clone https://github.com/occultlang/occult.git && cd occult
chmod +x build.sh
./build.sh

Windows Build Instructions

On Windows based systems, it is a little more difficult to build Occult.

Prerequisites

  • Visual Studio (Doesn't matter the version, but newer the better)
  • git
  • cmake

Visual Studio C++ Settings

You can click images to make them larger
Open Visual Studio Installer, and click modify. Open Visual Studio Installer, and click modify.
Make sure you have C++ enabled. Make sure you have C++ enabled.
Enable clang tools for Windows. Enable clang tools for Windows.

Now you can install these things, and then wait until its done.

Building with Visual Studio

Assuming you have cmake and git installed, as well as Visual Studio, proceed to run the following command in powershell.

powershell
git clone https://github.com/occultlang/occult.git && cd occult
cmake -G ""

"Visual Studio 18 2026" is the version for Visual Studio 2026, so that would go where "" is.

If you don't have Visual Studio 2026, running cmake -G should just give you options to choose from.

Now once you've ran all those commands in powershell, open the occult.slnx file, it should be in the occult directory you just cloned.

Once its opened, you should see Solution Explorer, now left-click occultc and then click Alt + Enter to get to the properties menu.

Once you're in the properties menu, you click Platform Toolset and change it to LLVM(clang-cl) and change the C++ language standard to C++23, and click apply.

Next, go to C/C++ then Command Line and you should see a field called Additional Options just delete everything in there, and click apply.

You should be able to build the project now, and it will succeed.

Running a Program

Now that you have a binary of the Occult compiler, you can start running programs! The binary on Linux should just be occultc and for Windows its occultc.exe.

The file extension for Occult code is .occ.

Compiler Options

Use occultc.exe for Windows.

Running occultc -h will bring up a help menu.

Usage occultc [options] source.occ

Options:

  • -t, --time Show compilation time per stage
  • -d, --debug Enable debug mode (implies --time)
  • -o, --output [file] Output native binary
  • -j, --jit JIT compile (in memory)
  • -h, --help Show the help message

Hello World

The JIT mode is the default mode for the compiler, so lets get to running our first program!

You can create a new file called hello_world.occ and then copy and paste the script below.

occult
fn main() {
	print_string("Hello, World!\n");
}

Then run occultc hello_world.occ and then it should just print out Hello World!

Congratulations! You've ran your first Occult program!

×