/Djinn-Lang

A programming language for leaning purposes with a compiler written in C# and LLVM API.

Primary LanguageC#

Djinn Language

Simple and basic compiler of Djinn language to generate native code binaries with LLVM support.

Example code

function int32 add(int32 a, int32 b) {
    ret a + b;
}

function int32 main() {
    int32 counter = 0;
    while (counter < 10 ) {
        printf(add(counter, 1));
        counter++;
    }

    if ( counter < 10 ) {
        printf("counter = %d", counter);
        ret counter;
    }    

    ret 0;
}

Language Features

  • Functions
  • Imports
  • If
  • Else
  • Switch/case
  • Basic Types
    • Integers
    • Floating-point numbers
    • Strings
    • Booleans
    • Characters
  • Custom types
    • Structs
    • Enums
    • Classes
    • Interfaces
    • Abstract classes
    • Generics
  • Arrays
  • Loops
    • For
      • While
      • Do-while

Future

  • Standard Library
  • Lists/Sets
  • Maps/Dictionaries
  • Compile time expressions
  • Memory Management