Minimal systems programming language
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-15 18:33:58 +03:00
docs Add unfinished AddingSomething.md 2026-10-30 08:49:48 +03:00
include/tau Implement IR boolean expression resolver 2026-11-15 14:21:23 +03:00
samples Implement IR boolean expression resolver 2026-11-15 14:21:23 +03:00
source Implement IR boolean expression resolver 2026-11-15 14:21:23 +03:00
test Commit existing stuff 2026-10-24 17:04:17 +03:00
.gitignore Update .gitignore because it ignored include/tau now 2026-10-29 11:50:40 +03:00
build.sh Implement IR Builder 2026-10-30 09:31:19 +03:00
compile_flags.txt Commit existing stuff 2026-10-24 17:04:17 +03:00
LICENSE Initial commit 2026-10-24 14:01:52 +00:00
main.tau Implement IR boolean expression resolver 2026-11-15 14:21:23 +03:00
README.md Update TODO and reprioritize 2026-11-15 18:33:58 +03:00

tau-lang

Minimal systems programming language

Building

Dependencies:

  • C compiler (like clang or gcc)
  • LLVM library (llvm-c to be exact)

The current method of compiling the compiler is by running the build.sh script.

TODO

  • Priority 1

    • Implement Diagnostics system
    • Implement Parser #notcl4y
    • Add other token types (-, *, /, +=, -=, ==, !=, !, &, ||, comma, colon, etc.)
    • Implement AST printer
    • Implement diagnostics into parser and semantics
    • Implement Semantics Analysis #notcl4y
  • Priority 2

    • Implement source ranges for tokens and nodes
    • Implement Source into Compiler (and allow the systems to read the source's filename)
    • Implement lexer
    • Fix a "typo" when printing diagnostics
    • Two-character operator tokens
    • Add Diagnostics-related functions for Compiler
    • Add functions for printing diagnostics result
    • Implement CLI (at least file reading)
    • Create functions for printing source positions, source ranges, token types, AST node types
  • Priority 3

    • Parse semicolons by ignoring them
    • Implement IR Builder
    • IR Build binary expressions (more operators: -, * and /)
    • IR Build resolve identifiers
    • Assign symbols to identifiers during Semantics Analysis (AST identifier terms AND AST variable statements)
    • Parse functions
    • Analyse functions
    • Analyse blocks
    • IR Build functions and blocks
    • Implement function parameters
    • Implement block statements
    • Implement sub-scopes for functions and block statements
    • Remove useless AST semantics decorators
  • Priority 4

    • Typeless and valueless variable/const statements
    • Implement more IR canonical types
    • Implement auto-casting (for IR)
    • Allow void types only in function return types
    • Implement certain functions for "convenience" to prevent some "long messy member accesses" (like node->varStat.ident->identTerm.ident -> AstNodeGetIdentValue(node->varStat.ident))
    • Implement special binary operations for certain types (like float) (That also includes cast operations)
    • Implement floats
    • Implement return statements
    • Build return statements
    • Keep track of functions and check for type matching with return statements using that
  • Priority 5

    • Parse, analyse and build call expressions
    • Parse, analyse and build struct statements
    • Make structs as types
    • Parse, analyse and build member expressions
    • Have struct fields symbols in a different scope or stored in a way such that they won't conflict with their neighbor symbols
    • Build comparative binary operations
    • Implement if statements
    • Analyse terms and determine their type from their surrounding
    • Analyse binexpr-s to assign cast expr types
    • Create a helper function for handling implicit casts in Semantics Analysis
    • Implement while statements
    • Parse, analyse and build assignment expressions
  • Priority 6

    • Parenthesised expressions
    • Parse, analyse and build pointers (and dereference)
    • Parse, analyse and build addresses
    • Untangle the confusion between functions SemanticsAnalysisConstructTypeSymbol, SemanticsAnalysisResolveIdent and SemanticsAnalysisResolveType
    • Parse unary expressions
    • Build logical binary and unary operations
  • Priority 7

    • CLI print stage results
    • Bodyless function declarations
    • LLVM output ll
    • Analyse strings
    • Build strings
  • Priority 8

    • Figure out why TypeTable doesn't work the way it's expected to work (semantics analysis has to fallback to searching canonical types in the symbol table)
    • Clean up
      • Remove unnecessary comments (ir.c, parseAst.c)
        • irVisit.c: IrBuilderVisitAssignExpr
      • Rename AST PARAM_ARR node types to PARAMS
      • Align spaces
        • ast.h
        • irVisit.c: ___IrBuilderResolveCanonicalType
        • token.c: TokenTypeAsString
      • Document SemanticsAnalysisHandleImplicitCast
      • Whatever at those places are
        • irVisit.c: IrBuilderResolveTypeCast
      • Separate functions' parts into helper functions
        • irVisit.c: IrBuilderVisitFnStat
        • irVisit.c: IrBuilderVisitStructStat
        • irVisit.c: IrBuilderVisitCallExpr
        • analysisVisit.c: SemanticsAnalysisVisitMemberExpr
        • analysisVisit.c: SemanticsAnalysisVisitStructStat
        • analysisVisit.c: SemanticsAnalysisVisitFnStat
    • Improve token array printer
    • Implement symbol table printer
    • Implement string buffer builder
    • Integrate string arena
  • Priority 9

    • Bodyless structs
    • Analyse for function parameter count to compare it with argument count
    • Add missing errors
      • analysisVisit.c: SemanticsAnalysisVisitReturnStat (check for function return type and void)
    • Lexerize split ("spaced") integers (100_000_000, 20_000)
    • Lexerize HEX integers (0x1234ABCD, 0xffff)
    • Detect attempts to modify constants
    • Global variables
    • Bit/bitshift operations and operators
    • Detect identifier redefinitions
    • Constant values such as null, true and false
    • Comments
    • Enums
    • Reconceptualize member expression relations and pointer-value relations
    • Custom enum types and auto determine enum's type
    • Custom enum values
    • Implement IR boolean expression resolvers
      • Bools sometimes don't get IR built into i1-s for some reason or something (they become i8 instead and refuse to even be casted)
    • Implement HIR (High Level IR)
    • Integrate HIR. Make the Semantics Analysis generate it and LLVM IR Builder take it
  • Priority 10

    • Arrays
    • Unions
  • Priority Unplanned

    • This list is for those TODO entries that have an unspecified priority or a yet-to-be-planned implementation.
    • Document functions, structures, modules
    • Implement proper error system (not the diagnostics, those are only for the programming language itself and not the compiler)
    • Support implicit types
    • Allocate variables for parameters when required (taking an address from a parameter or changing a parameter's value) and replace them
    • Warn potential null pointer dereferences
    • Error for doing logic stuff outside of functions
  • Priority unprioritized

    • This list is for those TODO entries that need to be done but have yet to be prioritized
    • Implement a CLI option to disable some stages (as in for example "up until to parsing", which disables semantics analysis and IR builder)
    • Search for memory leaks and free them (might require setting up some free systems like arenas)
    • Require semicolons at the end of the lines
    • Lexerize strings with backslash characters
    • Lexerize literals with explicit types (like 25.0f, 4.5f64, 255u8)
    • Lexerize zero-less float tokens (.0, .25f)
    • Lexerize binary integers (0b101, 0b10000011)
    • Multiple fields with one type (instead of x: i32, y: i32 you can do x, y: i32)
    • Character literals
    • Analyse and build overload functions
    • Parse, analyse and build methods
    • Tuples
    • Parse, analyse, build arrays
    • Make IR Builder independent of the declaration placement (if you declare a global variable after a function, IR gets confused)
      • And after that check whether or not setting global variables to function-returnd values work
    • Fix order of parse precedence (like binary operations)
    • Store computed enum values as constants instead of recomputing each IR visit
    • Implement modules (not imports. imports import modules from files)
    • Implement imports (do modules before imports)
    • Struct and array initializers (compound and array literals)

Example syntax

import "std.io";
import "std.string";

fn main (): void {
    const x: i32 = 10;
    const y: i32 = 20;
    const z: i32 = x + y;

    const string: String = ("{1} + {2} = {3}").format(x, y, z);
    std.io.println(string); // "10 + 20 = 30"
}