Skip to content

occultlang/occult

Repository files navigation

Occult Logo

The Occult Programming Language

An enigmatic systems programming language.


Website License

Stars Forks

What is Occult?

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

What Occult is capable of?

fn write(i64, string, i64) shellcode i64 { 0x55 0x48 0x89 0xe5 0x48 0xc7 0xc0 0x01 0x00 0x00 0x00 0x0f 0x05 0x48 0x31 0xc0 0x48 0x89 0xec 0x5d 0xc3 }

fn strlen(string) shellcode i64 { 0x55 0x48 0x89 0xe5 0x48 0x31 0xc0 0x80 0x3c 0x07 0x00 0x74 0x05 0x48 0xff 0xc0 0xeb 0xf5 0x48 0x89 0xec 0x5d 0xc3 }

fn puts(string s) {
    write(1, s, strlen(s));
}

fn main() {
    puts("1\n");
    puts("2\n");
    puts("3\n");
    puts("4\n");
    puts("5\n");
}

This is an example of using raw x86_64 shellcode with the Linux write syscall to print out 1 to 5!


Building Occult

Note

The highest C++ standard that Occult should use is C++20

Building for Linux / MacOS

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

Building for Visual Studio on Windows (You must install LLVM with clang inside Visual Studio Installer)

git clone https://github.com/occultlang/occult.git
cmake -G "Visual Studio 17 2022"

Change the C++ Language Standard to the latest version

image

Change the Platform Toolset to LLVM(clang-cl) (Or else Occult WILL NOT compile on Windows because of MSVC...)

image

Next, go into C/C++ -> Command Line, and then remove all the contents of the "Additional Options" field

image

Afterwards, you should be good to go


Warning

Known Issue: The -o (output native binary) flag is currently broken. Use JIT mode (default) for compilation and execution.

Roadmap

  • Structs (Planned for v2.2-alpha)
  • New Linker (Planned for v2.2-alpha)
  • Generics
  • Foreach implementation
  • Static Analysis
  • Borrow Checker or RAII (Similar to C++ std::unique_ptr)
  • New Intermediate Representation (SSA) for optimization pass
  • RISCV Support
  • ARM64 Support