ORCatLang Logo

ORCatLang

Strong like an ORCa, Precise like a CAT. (here) GitHub (compiler) GitHub Download

Welcome to ORCatLang

A tiny, powerful, compiled language designed for speed and extensibility. Built for developers who demand performance without sacrificing "style".

⚑ Blazing Fast Compilation

Compile projects in milliseconds with zero runtime overhead. In fact, the C extension is optional and extendible.

🧱 Small, Strong, and fast ⚑

ORCatLang’s compiler only has about ~5k lines. Tiny but powerful.

πŸ”— C Interop like a native builtin

Extend the language with native C code seamlessly, unlike many other compiled languages.

πŸ“¦ Generic Functions πŸ› οΈ

Write reusable, type-safe code with full generic function support, something C lacks!

πŸ”’ Crumb System πŸ›‘ ️

First quantitative access model concept.
Example: crumble(variable)!r=3!w=4;
enforces counted access to reads and writes.
*(omitted values become unlimited)

πŸ’ͺ Strong Typing

Strictly typed with a focus on code safety, helping you prevent bugs before they even happen.

🧬 Structs and Enum support

Has basic structs and enums for structure.
Basic because the compiler is under heavy development solo.

πŸ‘‰ Pointer support 🧰

Added pointer support to replace and fix the old memory access methods.
Previously was using ints. now using * pointers.

🚧 Safety features ✨

Injects a runtime checker to check arrays to prevent out of bounds.
The compiler swiftly STOPS double frees or use after frees.

Built by Developers, for Developers

ORCatLang is implemented in Python, compiled using Nuitka, and structured with simplicity in mind. From its friendly syntax to fast scaffolding, it’s made to keep you focused.

πŸ›  Built in Python with Nuitka

Compiler implemented in Python and compiled using Nuitka for performance and portability.

🐾 Modern, Familiar Syntax

Learn once, write fast, see the internals. Designed to be "intuitive" for the modern developer.

Example of the syntax (look at the GitHub for more examples.)


  // ORCatLang Syntax:
  import C_io; /*or import "C_io.sorcat"; if you need to specify the filename*/
  import "C_types.sorcat"; 
  // ^ explicit import system for name conflicts will always be supported.
  // Multiple imports seperated by ","
  // externing C functions or llvm clang libc do the following:
  pub extern fn puts(string b)   <void>;
  // string, int (int64), int8, int16, int32, int64, bool, float, float32, void;
  // params/declarations are {type} {name} then value or etc. C familiar syntax.
  pub fn main() <int> /*ret type in brackets*/ {
    print("test"); //<-- easy print syntax

    input("what is your name?"); //<-- easier input syntax.
    /*
    sinput is string input
    input is the same as sinput but created sinput for consistency
    iinput returns an int
    finput returns float (compiled as double so really its a double)
    binput returns a boolean
    */
    while (cond is true) {
      do something;
    }
    // the continue;, and the break; keyword is also implemented. 
    // (continue = skip, break = break out a loop)
    if (cond is true) {
      do something;
    } else if (cond) {
      do something else;
    } else {
      final action;
    }

    int test = 8;

    // Use Crumb system
    crumble(test)!r=3!w=1; // 3 reads, 1 write.
    // after uses or etc you can optionally forget(test); (forget is freeing in C but way safer.)
    // access modifiers are for documentation purposes. They are a no-op.

    string[7] arrayof7;
    string[2] arrayof2 = ["test", "test"];
    print(arrayof2[1]);
    
    // nomd keyword means no modify. So Immutable variables.
    // pin keyword are globals. should only be used on top scope.
    // also pointers and generics are supported.
    // compile time type replacement.
    string e = typeof(f);
    print(typeof(f)); newline(); 
    /*
     you can use \n and all else escape chars. 
     I just made newline(); for simplicity.
     typeof(f) gets replaced with f's type.
     what exists? simple typeof(var) or etypeof(var) for ints and bitwidths
     etypeof(var) returns the actual size EX: "int8", "int16"
     new autoregion {}
     deref() is now forget()
     you can now do type cases without string reflection inside generic functions, etc.
    */
  }

Get Started with ORCatLang

Ready to code in it? Download the latest version or check out the source code on GitHub.

To use the installer (Linux only for now) move the installer to the dir you choose and run:
ocat ossemble

Download Now