Mac OS 9.2.1 running in Skopjemu, displaying the Skopjemu and Yugo logos

Mac OS 9 running on skopjemu-ppc

We are proud to announce the public release of the Yugo Programming Language, a programming language empowering humans and agents to create working, performant, and reliable software, enabling them to solve their most important problems, and the Skopjemu emulator/hypervisor, a machine simulator (currently supporting ARM64, x64, and PowerPC) built with performance, memory safety, and formal verification in mind.

Using expertise gained from developing Aburi, a C/C++ compiler that handles complex codebases like the Linux Kernel and C++20’s libc++, Yugo is a human-centered language designed for the Intelligence Takeoff Era.

Yugo

Yugo provides many of the high level abstractions you’ve come to expect in other languages like C++ and Rust that make coding for humans and agents easier and safer, while rejecting ones that cause more trouble then they’re worth in language/compiler complexity or compile times. I wrote on my motivations for developing Yugo in my previous post.

Yugo lets you choose how to manage memory in each part of a program, by combining deterministic ownership and borrowing, atomic reference counting, scoped memory regions, and explicit manual memory management. There are no lifetime annotations or garbage collectors. While other languages go all in on one approach, Yugo focuses on allowing the programmer to choose and intermix memory management strategies most applicable for their projects. Memory regions in particular make it easy to make binary trees and parsers in Yugo, an area traditional borrowing-based languages have historically struggled with.

import core
import raw

struct Zapis {
    let broj: Int
}

func main() -> Int {
    // Borrowing gives a scoped, read-only view without transferring ownership.
    let beograd = Zapis(broj: 67)
    let pogled = borrow beograd
    assert(pogled.pointee.broj == 67)

    // ARC retains the same heap allocation when you copy a Shared handle.
    let izmir = core.shared<Zapis>(Zapis(broj: 67))
    let ankara = izmir
    drop(izmir)
    assert(ankara.pointee.broj == 67)
    drop(ankara) // Releasing the last strong owner destroys the payload.

    // Manual memory makes allocation and cleanup explicit.
    unsafe {
        let alokator = raw.system_allocator()
        switch raw.allocate<Zapis>(count: 1, allocator: alokator) {
        case .none: return 1
        case .some(let ohrid):
            defer { raw.deallocate<Zapis>(ohrid, count: 1, allocator: alokator) }
            raw.initialize<Zapis>(ohrid, to: Zapis(broj: 67))
            defer { raw.destroy<Zapis>(ohrid) }
            assert(ohrid.pointee.broj == 67)
            // Defers run in reverse order, destroying the value before freeing storage.
        }
    }

    // The region reclaims storage for both values together at block exit.
    region drina {
        let kotor = drina.new(Zapis(broj: 60))
        let nis = drina.new(Zapis(broj: 7))
        assert(kotor.pointee.broj + nis.pointee.broj == 67)
    }

    return 0
}

Yugo has effects as a way to conduct runtime polymorphism:

effect TicketSource {
    mutating func next() -> Int
}

struct Sayac: TicketSource {
    var next_number: Int

    mutating func next() -> Int {
        let bilet = self.next_number
        self.next_number += 1
        return bilet
    }
}

func issue_ticket() -> Int uses TicketSource {
    return TicketSource.next()
}

func main() -> Int {
    var istanbul = Sayac(next_number: 67)

    provide TicketSource = &istanbul {
        assert(issue_ticket() == 67)

        provide TicketSource = Sayac(next_number: 100) {
            assert(issue_ticket() == 100)
        }

        assert(issue_ticket() == 68)
    }

    // The outer handler was lent in place, so its updates persist.
    assert(istanbul.next_number == 69)
    return 0
}

Yugo’s built in struct layout features make it easier to optimize code, and extents improve performance by skipping bounds checks when safety can be determined:

import core

struct Kivilcim: core.Columnar {
    var x: f64
    var vx: f64
    let color: u8
}

func main() -> Int {
    var sparks = core.fixed_columns([
        Kivilcim(x: 60.0, vx: 14.0, color: 7),
        Kivilcim(x: 20.0, vx: -4.0, color: 9),
    ])

    // The extent checks the column lengths once. The loop touches only x and vx.
    let view = sparks.mutable_columns()
    extent n of (inout view.x, view.vx) {
        for i in n.indices() {
            view.x[i] += view.vx[i] * 0.5
        }
    }

    assert(sparks[1].x == 18.0)
    let ohrid = sparks[0] // Copy a whole row out of the columns.
    assert(ohrid.x == 67.0 && ohrid.color == 7)

    // On this 64-bit target, the regular array pads each row to 24 bytes.
    assert(#size_of([Kivilcim; 2]) == 48)
    assert(#size_of(core.FixedColumns<Kivilcim, 2>) == 40)
    return 0
}

Yugo doesn’t have textual (like C) or syntax-based (Rust, Swift) macros. Agents can generate and then abstract duplicate code when needed. For instances where this is inadequate, compile time reflection is provided:

import io

attribute Gizli()

struct Istasyon: Reflectable {
    let sehir: StaticString
    let peron: Int
    let acik: Bool
    @Gizli() let kod: StaticString
}

func yazdir<T: Reflectable>(_ value: borrowing T) {
    const for field in #fields(T) {
        const if #has_attribute(field, Gizli) {
            io.print_line("\(field.name): [redacted]")
        } else {
            io.print_line("\(field.name): \(#field(value, field))")
        }
    }
}

func main() {
    let ankara = Istasyon(sehir: "Ankara", peron: 67, acik: true, kod: "demo")
    yazdir(ankara)
}

Formal Verification is built into the language. Z3, Lean, and HOL4 can help prove invariants on your code. Define a function and invariants, and the Z3 backend will try to solve them:

@verify
public func sonraki_bilet(_ current: u8, _ limit: u8) -> u8
    requires current <= limit
    ensures current <= result && result <= limit
    ensures MathInt(result) == (if current < limit { MathInt(current) + 1 }
                               else { MathInt(current) })
{
    if current < limit {
        proof { assert(MathInt(current) + 1 <= MathInt(limit)) }
        return current + 1
    }
    return current
}

Handwritten proofs in HOL4 and Lean are supported, for certification or proving logic beyond the capability of a SMT solver.

open HolKernel Parse boolLib bossLib wordsTheory;
open YugoExportTheory YugoExecTactics;
val _ = new_theory "Bilet";

Theorem sonraki_bilet_correct:
  !current limit : word8.
    current <=+ limit ==>
    y_Main_2esonraki_5fbilet_exec_runs current limit
      (if current <+ limit then current + 1w else current)
Proof
  yugo_exec_tac []
QED

val _ = export_theory ();

Yugo uses a decentralized package manager/build system like Zig and C/C++. The rationale is three fold: 1) LLMs make it easier to generate your own dependencies. 2) having a centralized package manager and dependency heavy ecosystem, like Rust or Javascript, can lead to supply chain attack issues, especially with cyber-capable LLMs running amok. 3) Few people are using the language and I don’t have time or money to set up a centralized package repo.

Take a main.yugo file:

func sonraki_bilet(_ current: u8, _ limit: u8) -> u8 {
    if current < limit {
        return current + 1
    }
    return current
}

func main() {
    let bilet = sonraki_bilet(66, 67)
    assert(bilet == 67)
    assert(sonraki_bilet(67, 67) == 67)
    print(Int(bilet))
}

We can write a build script as follows:

import build

func plan(_ b: inout build.Builder) {
    let release = b.is_release()
    let optimize = b.bool_option("optimize", default_value: release)
    let level = if optimize { 2 } else { 0 }

    let bilet = b.add(build.program("bilet", "src/main.yugo")
        .description("Build the ticket counter")
        .optimization(level)
        .publish()
        .install(to: "bin/bilet"))

    b.add_test(build.test("bilet_smoke", bilet)
        .expect_exit(0)
        .timeout(seconds: 5))
}

and run the following commands:

yugoc build bilet
yugoc run bilet                            # prints 67
yugoc test bilet_smoke
yugoc build bilet --option optimize=true   # build at O2
yugoc install --prefix "$PWD/stage"        # installs stage/bin/bilet

Cross-compilation made easy. Build static binaries with no libc dependencies, Zig style:

import target

func main() {
    const if target.is_linux && target.is_arm64 {
        print("Hello from arm64 Linux")
    } else const if target.is_macos && target.is_arm64 {
        print("Hello from arm64 macOS")
    } else {
        #error("This example expects arm64 Linux or arm64 macOS")
    }
}

And then run these commands from a ARM64 Mac machine:

yugoc --target=arm64-macos selam.yugo -o build/selam-macos
yugoc --target=arm64-linux --linker "$(command -v ld.lld)" \
  selam.yugo -o build/selam-linux

Yugo is optimized for human and agentic coding: frontier LLMs are able to produce working Yugo code. Handwriting Yugo code is fun: examples here (contributions welcome). Agents can find a way to write in any language, so Yugo is focused on language properties (compile time, formal verification, memory safety) that help agents rather than compact syntax representations.

Yugo currently works on Apple ARM64 and Linux x64, with support for more architecture and operating systems on the way.

Skopjemu

Skopjemu is a machine emulator and virtualizer supporting x64, ARM64, and PPC guests on Apple ARM64. Host x64 support is imminent.

Skopjemu can be used to create sandboxes and VMs for tasks such as retro-computing, agent sandboxes, and running untrusted software. Yugo is memory safe(r), and formal verification is increasingly being deployed across Skopjemu, meaning it is much less susceptible to to VM escape bugs compared to a hypervisor/emulator written in C or C++. In the post-Mythos/Fable/Astra/Kimi K3/GLM 5.3 era where LLMs can easily find vulernabilities in software, many have taken an interest in memory safety and formal verification tooling.

We use the formal verification facilities of Yugo, with handwritten HOL4 proofs making up for the gaps. The formal verification has revealed additional bugs within Skopjemu, including ones that would have allowed a adversarial guest OS to potentially crash the emulator.

The Aburi-compiled kernel from the previous post runs successfully in Skopjemu:

Skopjemu Aburi screenshot

Download

Both Yugo and Skopjemu are now open source on Github. Prebuilt binaries via GitHub actions and instructions for compiling from source are provided.

Plans

The short term goals is to fix bugs (there are many) and improve run-time and compile-time performance. Skopjemu is already compiling significantly faster than a roughly equivalent program written in Rust. It feels faster to compile compared to C++, but I haven’t tested with equivalent-ish Yugo and C++ programs. Your mileage might vary; I intend to create proper benchmarks in the future. Some stdlib code including the builtin GPU kernels need optimization work.

There’s tons of work left, keeping me busy for a while. I have added 95-99% of the language features: the focus now is making sure what’s included works well, and removing features that are more trouble then they’re worth. The best part is Yugo is still subject to change and LLMs make it easy to migrate code from deleted/changed features.

For Skopjemu I plan to increase device coverage (and formal verification of said devices), improve the performance of the JIT, and add more architectures such as OpenRISC, ARMV7, LoongArch, and RISC-V. I want to get KVM support, GPU passthrough, and 3D API-based acceleration stabilized.

In the medium term, I plan to to release the other “flagship” Yugo programs I’ve been working on. Many are adjacent to GPU programming in particular, meaning improvements to Yugolang as a result of one program directly helps the others.

To understand the long term goals of Yugo, it’s helpful to understand the reasons I decided to release Yugo now. Attentive readers (or ones that asked LLMs to summarize blog) might notice release notes of my software include celebratory remarks to national days of various countries. Naturally, for a language and ecosystem celebrating the Balkans, this is a great time to do a release: Yugoslavia’s Republic Day, Romania’s Great Union Day, and Albania’s Independence Day all fall around this period. But there is a more consequential reason I’m releasing Yugo now rather than spending another few months refining it: simply put, we may be approaching the end of human software development (and the traditional definition of humanity). 1

The AI Futures Project’s (the people behind AI 2027) latest update forecasts superhuman AI researchers arriving during 2027, assuming no substantial slowdown, with some estimates landing around the middle of the year. Their definition includes both fully automating coding within an AI research project and matching the research judgment of its best human researcher.

When AI systems reach that level (if not already), I have little reason to imagine that anything I’ve built here will be beyond them. A model capable of taking over the technical work of some of the strongest research teams in the world will obviously and effortlessly surpass my work on a programming language. Choosing abstractions, weighing tradeoffs, designing an architecture, and deciding which problems deserve attention are all parts of the work I expect increasingly capable systems to take on.

That makes this a strange, historic, and potentially bittersweet moment to release software. Human judgment has shaped programming, but we seem to be approaching a point where that judgment becomes optional. If these timelines are roughly right, the remaining window could be measured in months.

That possibility gives this release a sense of urgency I hadn’t expected. There will always be more work to do, but the world into which I eventually release Yugo may change more profoundly during that delay than the language itself does. I wanted to release Yugo in the seemingly fleeting moments where human technical contribution still makes a meaningful difference. I’m sure there are some core design decisions I’ll come to regret, but I’ll save those for a new language and let Yugo serve as a learning experience for that just as Aburi served as a learning experience for Yugo.

Happy Dan Republike Jugoslavije, Ziua Marii Uniri, and Dita e Pavarësisë. With current rates of AI progress this seems like one of the last ones we will get to celebrate2 , but I’m somehow feel weirdly hopeful about the future of AI alignment and safety. We will have to wait and see…

To be continued…

Skopjemu Americas screenshot


  1. Despite agents, software development flows mostly remain the same (if not vastly accelerated), and humans are still involved. ↩︎

  2. Superintelligence will obviously make traditional nation states obsolete, but I predict cultures and ethnicities will persist, assuming we survive, transcending specific nation state structures. The Balkans is ironically a great example. ↩︎