2026-02-20 23:18:17 +02:00
...
2026-02-12 10:13:36 +02:00
...
2026-02-18 16:18:31 +02:00
2026-02-17 16:57:12 +02:00
...
2026-02-20 23:18:17 +02:00
...
2026-02-20 23:18:17 +02:00
...
2026-02-20 23:18:17 +02:00
2026-02-16 01:14:02 +02:00
...
2026-02-12 10:13:36 +02:00
2026-02-09 18:07:41 +02:00
2026-02-09 18:07:41 +02:00
2026-02-09 18:07:41 +02:00
2026-02-16 01:13:34 +02:00
2026-02-20 13:28:38 +02:00

sx

*** HIGHLY EXPERIMENTAL *** DON'T USE ***

This experiment is trying to answer a few questions:

Q: Can we have an system language to build declarative ui ?

NOTE:

i hope you have memory... currently it doesn't free anything :D

Quick Sort Example

#import "modules/std.sx";

quick_sort :: (items: []$T) {
    partition :: (items: []T, lo: s64, hi: s64) -> s64 {
        pivot := items[hi];
        i := lo - 1;
        j := lo;
        while j < hi {
            if items[j] < pivot {
                i += 1;
                items[i], items[j] = items[j], items[i];
            }
            j += 1;
        }
        i += 1;
        items[i], items[hi] = items[hi], items[i];
        i;
    }

    sort :: (items: []T, lo: s64, hi: s64) {
        if lo < hi {
            pi := partition(items, lo, hi);
            sort(items, lo, pi - 1);
            sort(items, pi + 1, hi);
        }
    }

    sort(items, 0, items.len - 1);
}

main :: () {
    arr : []s64 = .[333, 2, 3, 5, 2, 2, 3, 4, 5, 6, 6, 1];
    quick_sort(arr);
    print("{}\n", arr);
}

Building

Requires Zig 0.16+ and LLVM 19.

zig build

Usage

# compile to binary
sx build examples/06-generic.sx

# compile and run
sx run examples/06-generic.sx

# emit LLVM IR
sx ir examples/06-generic.sx

# start the language server
sx lsp

Acknowledgments

  • Jonathan Blow — for Jai, the language that inspired this one
  • Andrew Kelley — for Zig, which made this compiler a joy to write
Description
No description provided
Readme MIT 65 MiB
Languages
Zig 98.9%
Shell 0.6%
C++ 0.4%