Mark Tyrkba (rakivo)

Email: marktyrkba456@gmail.com

GitHub: github.com/rakivo


About Me

I’m a self-taught 16-year-old systems programmer and compiler enthusiast, focused on low-level programming and high-quality, high-performance software. I care deeply about the performance, simplicity, and maintainability of my software, I believe it's too important for us to be sloppy about it.

I build compilers, virtual machines, custom SSA-based IRs, bytecode formats, and many other interesting projects.

I enjoy understanding how everything works from the ground up, and I strive for code that is simple, efficient, and understandable. Currently, I’m exploring advanced compiler meta-programming mechanisms for my upcoming language.

I believe much of today’s software is built with low standards of quality. As Jonathan Blow once said, “I think we're now in a situation where everybody in the world is flooded with low quality software, and everybody wishes that they had higher quality software.”

My goal in life is to make it easier to write high-quality software, and eventually, to help teach others how to do the same.


Highlight Projects

1. The rok language Compiler planned public release in November

A compiler written in Rust, completely from scratch, fully parallelized, with its own SSA IR, Bytecode, Polymorph solver, and a Register Machine. With focus on meta-programming: all user-written code can execute at compile time and communicate with the compiler.

Show / Hide Fib Compile-Time Demo

A basic program that calculates Fibonacci numbers at compile-time.


fib :: (n: i64) -> i64 {
    a := 0;
    b := 1;

    if n == 0 return a;
    if n == 1 return b;

    for 2..n+1 {
        c := a + b;
        a = b;
        b = c;
    }

    return b;
}

main :: () {
    N :: 77;
    print("fib(%) = %\n", N, fib(N));
}

#run main(); // runs at compile time, prints: fib(77) = 5527939700884757

#import "std.rok";
    
Show / Hide Raylib Demo

A basic graphics example using Raylib. Demonstrates 2D transformations, shaders, etc.


rotate :: (p: Vector2, theta: f32) -> Vector2 {
    return vec2(
        p.x * cosf(theta) - p.y * sinf(theta),
        p.x * sinf(theta) + p.y * cosf(theta)
    );
}

main :: () {
    SetTargetFPS(60);
    InitWindow(WINDOW_WIDTH as i32, WINDOW_HEIGHT as i32, WINDOW_TITLE.data);
    defer CloseWindow();

    font := LoadFontEx(c"font.ttf".data, FONT_SIZE as i32, null, 0);
    defer UnloadFont(font);

    center := vec2(WINDOW_WIDTH / 2.0, WINDOW_WIDTH / 2.0);
    size   := WINDOW_HEIGHT * 0.45;
    angle  := 0.0;

    shader := LoadShaderFromMemory(null, SHADER.data);
    defer UnloadShader(shader);

    time_loc := GetShaderLocation(shader, c"time".data);
    resolution_loc := GetShaderLocation(shader, c"resolution".data);

    resolution := vec2(WINDOW_WIDTH, WINDOW_HEIGHT);
    SetShaderValue(shader, resolution_loc, *resolution, ShaderUniformDataType.VEC2);

    text_size := MeasureTextEx(font, TEXT.data, FONT_SIZE, TEXT_SPACING);

    text_center := vec2(
        WINDOW_WIDTH  / 2.0 - text_size.x / 2.0,
        WINDOW_HEIGHT / 2.0 - text_size.y / 2.0
    );

    while !WindowShouldClose() {
        angle += 0.02; // radians per frame

        v1 := vec2(0.0, -size);               // top
        v2 := vec2(-size / 2.0, size / 2.0);  // bottom left
        v3 := vec2(size / 2.0, size / 2.0);   // bottom right

        rv1 := rotate(v1, angle);
        rv2 := rotate(v2, angle);
        rv3 := rotate(v3, angle);

        color := Color {
            r = ((sinf(angle)          * 0.05  + 0.50) * 255.0) as u8,
            g = ((sinf(angle + 2.0944) * 0.05  + 0.50) * 255.0) as u8,
            b = ((sinf(angle + 4.1888) * 0.05  + 0.50) * 255.0) as u8,
            a = ((sinf(angle * 2.0)    * 0.25  + 0.75) * 255.0) as u8
        };

        SetShaderValue(shader, time_loc, *angle, ShaderUniformDataType.FLOAT);

        BeginDrawing();
        defer EndDrawing();

        ClearBackground(BACKGROUND_COLOR);

        DrawTextEx(font, TEXT.data, text_center, FONT_SIZE, TEXT_SPACING, TEXT_COLOR);

        BeginShaderMode(shader);
        defer EndShaderMode();

        DrawTriangle(
            vec2(center.x + rv1.x, center.y + rv1.y),
            vec2(center.x + rv2.x, center.y + rv2.y),
            vec2(center.x + rv3.x, center.y + rv3.y),
            color
        );
    }
}

#import "std.rok";
#import "math.rok";
#import "raylib.rok";

FONT_SIZE :: 75.0;
TEXT_SPACING :: 2.0;

WINDOW_WIDTH  :: 600.0;
WINDOW_HEIGHT :: 600.0;
WINDOW_TITLE  :: c"HELLO_FROM_ROK";

TEXT_COLOR :: Color { .. };
BACKGROUND_COLOR :: Color { r = 24, g = 24, b = 24, .. };

TEXT :: c"hello from rok";

SHADER :: c"... [full demo soon in the language's repository] ...";
    
Show / Hide Array Generics (Poly) Demo

Demonstrates some basic generic array operations using compound parameter types.


/*
    Demonstrates basic use of polymorphic array utilities.
    @Note: idiomatic array handling in Rok is typically done through
    built-in iteration or standard library helpers.
*/

array_index :: (arr: [] $T, index: i32)           -> T    { return arr[index]; }
array_set   :: (arr: [] $T, index: i32, value: T) -> void { arr[index] = value; }
array_clear :: (arr: [] $T) { memset(arr.data, 0, sizeof(T) * arr.len); }

main :: () {
    i32_array_showcase();
    float_array_showcase();
}

i32_array_showcase :: () {
    i32_arr : [10] i32;

    print("---- int array ----\n");

    for 0..10 array_set(i32_arr, it, 100 * it);
    array_set(i32_arr, 0, 1337);

    for 0..10 print("i32_arr[%] = %\n", it, array_index(i32_arr, it));

    array_clear(i32_arr);
    print("array cleared.\n");

    for i32_arr print("[int] it = %\n", it);
}

f32_array_showcase :: () {
    f32_arr : [10] f32;

    print("---- float array ----\n");

    for 0..10 array_set(f32_arr, it, 100.0 * it as f32);
    for f32_arr print("[f32] it = %\n", it);
}

#import "std.rok";
    
Show / Hide Build meta-programming demo

A meta-program that registers all demo modules and schedules code generation for them. Demonstrates Rok's compile-time build orchestration.


fib_demo_path    :: "examples/fib-demo.rok";
raylib_demo_path :: "examples/raylib-demo.rok";
poly_demo_path   :: "examples/poly-demo.rok";

#run build();

build :: () {
    // Prevent this module itself from being output
    dont_output_this_module();

    // Register modules
    fib_module    := register_module(fib_demo_path);
    raylib_module := register_module(raylib_demo_path);
    poly_module   := register_module(poly_demo_path);

    // Schedule codegen for each module
    plan_job(fib_module,    Job.CODEGEN);
    plan_job(raylib_module, Job.CODEGEN);
    plan_job(poly_module,   Job.CODEGEN);
}
    

Currently in a private repository; planned public release in November.

Demo video/GIF will go here soon

2. brik-asm — RISC-V Assembler & brik — Object file building library

A Rust library providing a Cranelift-like SSABuilder API for building RISC-V object files, including custom sections, instructions, relocations, and more. Emphasizes performance: cache-friendly memory layout and parsing accelerated via SSE2, AVX2, AVX512BW on x86-64 and Neon on AArch64. Runs in QEMU emulator.

Show / Hide Code Examples & Demos

.include "std"

.text
.extern printf
.global main

main:
    prologue

    ; t0 = 69
    li      t0, 69
    printf1 fmt1, t0      ; prints: "t0 = 69"

    ; t1 = -t0
    li      t0, 69
    neg     t1, t0
    printf1 fmt2, t1      ; prints: "neg(t0) = -69"

    ; t2 = ~t0
    li      t0, 69
    not     t2, t0
    printf1 fmt3, t2      ; prints: "not(t0) = -70"

    j done

skip:
    printf1 fmt_skip, t0
    epilogue
    reti 0

done:
    epilogue
    reti 0

.rodata
fmt1:
    .stringz "t0      = %ld\n"

fmt2:
    .stringz "neg(t0) = %ld\n"

fmt3:
    .stringz "not(t0) = %ld\n"

fmt_skip:
    .stringz "this should not print, t0=%ld\n"
    

Quick example of using `brik` to build a factorial-computing program


fn produce_factorial_obj<'a>() -> Object<'a> {
    let mut asm = Assembler::new(
        BinaryFormat::Elf,
        Arch::Riscv64,
        Endianness::Little,
        "rv64gc"
    );

    asm.set_object_flags(FileFlags::Elf {
        os_abi: 0,
        abi_version: 0,
        e_flags: 0x4,
    });

    // .rodata section for format strings
    let _rodata = asm.add_rodata_section_at_end();

    let  input_fmt_sym = asm.define_data(b"input_fmt",  b"enter a number: \0");
    let  scanf_fmt_sym = asm.define_data(b"scanf_fmt",  b"%ld\0");
    let result_fmt_sym = asm.define_data(b"result_fmt", b"factorial: %ld\n\0");

    // =================
    // external symbols
    // =================

    let printf_sym = asm.add_symbol_extern(
        b"printf",
        SymbolKind::Text,
        SymbolScope::Dynamic
    );

    let scanf_sym = asm.add_symbol_extern(
        b"scanf",
        SymbolKind::Text,
        SymbolScope::Dynamic
    );

    let text_section = asm.add_text_section_at_end();

    asm.emit_function_prologue();

    // allocate space on stack for input number (8 bytes)
    asm.emit_addi(SP, SP, -8);

    // print input prompt
    asm.emit_pcrel_load_addr(A0, input_fmt_sym, 0);
    asm.emit_call_plt(printf_sym);

    // read input number
    asm.emit_pcrel_load_addr(A0, scanf_fmt_sym, 0);
    asm.emit_addi(A1, SP, 0);
    asm.emit_call_plt(scanf_sym);

    // load input number into s1
    asm.emit_ld(S1, SP, 0);

    // init factorial result in s2 (result = 1)
    asm.emit_addi(S2, ZERO, 1);

    // init counter in s3 (i = 1)
    asm.emit_addi(S3, ZERO, 1);

    let loop_lbl = asm.add_label_here(
        b".fact_loop",
        SymbolKind::Text,
        SymbolScope::Compilation
    );

    let done_lbl = asm.declare_label(
        b".fact_done",
        SymbolKind::Text,
        SymbolScope::Compilation
    );

    // loop condition: if i > n, exit
    asm.emit_branch_to(
        done_lbl,
        // if s1 < s3 (n < i)
        BLT { s1: S1, s2: S3, im: 0 },
    );

    // result *= i
    asm.emit_bytes(MUL { d: S2, s1: S2, s2: S3 });

    // i++
    asm.emit_addi(S3, S3, 1);

    // jump back to loop
    asm.emit_branch_to(
        loop_lbl,
        JAL { d: ZERO, im: 0 },
    );

    ...

    asm.add_symbol(
        b"main",
        0,
        asm.section_size(text_section),
        SymbolKind::Text,
        SymbolScope::Dynamic,
        false,
        SymbolFlags::None
    );

    asm.finish().unwrap()
}

fn main() -> Result<(), Box> {
    let args = env::args().collect::>();

    let Some(output_path) = args.get(1) else {
        println!{
            "usage: {prog} ",
            prog = args[0]
        };
        return Ok(())
    };

    let obj = produce_factorial_obj();

    let file = fs::File::create(output_path)?;
    obj.write_stream(&file)?;

    println!("[wrote object file to {output_path}]");

    Ok(())
}
    

Demo video/GIF will go here soon

3. Stalkr — language-agnostic TODO Tracker

A language-agnostic Rust tool for scanning your project for TODOs and either reporting, purging, or listing them. Heavily inspired by tsoding/snitch , rewritten in Rust for high performance with worker-parallelized execution. Fully modular and host-agnostic (works with GitHub or other platforms via a pluggable API layer).

Show / Hide Demo

Brief example of a tagged (reported) TODO in real code


// ...

TK::CQuote => {
    self.lexer.eat_next_token()?; // c"

    let (loc, span) = self.parse_string_literal()?;
    let src_str = span.s(&self.mo);

    let mut nul_terminated = String::with_capacity(src_str.len() + 1);
    util::unescape_string(src_str, &mut nul_terminated);

    if nul_terminated.bytes().last().is_some_and(|b| b != b'\0') {
        nul_terminated.push('\0');
    } else {
        // TODO(#252): Emit a warning if a C string literal already ends with `\0`
    }

    let str_lit_id = self.pc.new_str_lit(nul_terminated);

    Expr {
        loc,
        span,
        kind: EK::ConstStr(str_lit_id),
        ...
    }
}
    

Run Stalkr on this codebase you'll see this:


[reporting mode]

[detected project]: https://github.com/rakivo/rok

[todoʼs from]: rok_frontend/src/parser.rs

1. [line 1662]: Warn if a c string literal already ends with \0

selection (e.g. 1,2; 'a' all; 's' skip file; 'h' help; '^C' quit):
    

Just press `1` and return (enter), and the TODO is going to get reported:


[reporting mode]

[detected project]: https://github.com/rakivo/rok

[todoʼs from]: rok_frontend/src/parser.rs

1. [line 1662]: Warn if a c string literal already ends with \0

selection (e.g. 1,2; 'a' all; 's' skip file; 'h' help; '^C' quit): 1
[master 24dce81] Add TODO(#341): Warn if a c string literal already ends with \0
 1 file changed, 1 insertion(+), 1 deletion(-)
[1/1] todoʼs reported
    

A video of me using Stalkr to report TODO's while I was programming brik

Tap on the video to fullscreen

The bug with `0 insertions` is already fixed btw .. :D

4. Rush — Rust-based build system inspired by Ninja

A Rust-based build system inspired by Ninja. Rush executes build scripts efficiently, sometimes matching or exceeding Ninja's speed on typical workloads. It demonstrates parallelism, minimal overhead, and custom build pipeline design.

Show / Hide Build Script Example

cflags = -std=gnu99 -Wall -Wextra -O3
builddir = build

phony all
build all: $builddir/main run

rule cc
  depfile = $out.d
  command = gcc -MD -MF $out.d $cflags -o $out -c $in

rule link
  command = cc $cflags -o $out $in

build $builddir/foo.o: cc foo.c
build $builddir/bar.o: cc bar.c
build $builddir/main.o: cc main.c

build $builddir/main: link $builddir/foo.o $
                           $builddir/bar.o $
                           $builddir/main.o
  cflags = -std=gnu99 -O2

phony run
build run:
  command = ./$builddir/main

phony clean
build clean:
  command = rm -f $builddir/*
    

Me showcasing Rush building Ninja and Lua

Tap on the video to fullscreen

Other projects

I've worked on many other projects not shown here - feel free to explore them on my GitHub page.

Skills


Other Achievements


Demo / Media

This section will soon showcase demo videos, screenshots, GIFs, and other project media...


Contact