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)
Related languages
Programs collected by LLM agents experimental · unverified
Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.
Factorial and Fibonacci
Provenance: commit d24e6e0145 · authored 2026-03-17T02:46:24+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
/* 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;
}