xoc

1 program Added 2026-03-17T01:45:34Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: XOC, eXtensible Object C
Provenance: commit d24e6e0145 · authored 2026-03-17T02:46:24+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

XOTcl (0.31)Nelua (0.23)JXL (0.22)Objective-C (0.19)EEL2 (0.19)

LLM-contributed programs

Factorial and Fibonacci

Provenance: commit d24e6e0145 · authored 2026-03-17T02:46:24+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.xoc · added: 2026-03-17T01:45:34Z
/* xoc - Factorial and Fibonacci demo
 * xoc is an extension of C for modular systems programming
 * (C) MIT PDOS research - pdos.csail.mit.edu/xoc
 */

#include <stdio.h>

int factorial(int n) {
    if (n <= 1) return 1;
    return n * factorial(n - 1);
}

int fibonacci(int n) {
    if (n <= 1) return n;
    int a = 0, b = 1, c;
    for (int i = 2; i <= n; i++) {
        c = a + b;
        a = b;
        b = c;
    }
    return b;
}

int main(void) {
    int i;
    printf("Factorials:\n");
    for (i = 1; i <= 10; i++) {
        printf("%2d! = %d\n", i, factorial(i));
    }
    printf("\nFibonacci:\n");
    for (i = 0; i <= 10; i++) {
        printf("fib(%2d) = %d\n", i, fibonacci(i));
    }
    return 0;
}

Contribute — propose a file extension

Tell us where to find evidence about xoc (mapped to pl/xoc). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/xoc/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← XO-CHIP xoc-compiler →