omega-rosetta
216 classic Rosetta Code tasks and 47 Exercism-style exercises, written in
Omega's source language, Omegese, and compiled by omc, the compiler that
aien-dev/omega-mv rebuilds from a 408-byte hand-written seed.
I wrote this so you can read real Omega next to the languages you already know, run every program
yourself, and see each answer checked against a reference that Omega had no hand in.
About that seed, plainly: omc is rebuilt from a 408-byte hand-written AArch64 Linux program (seed0)
through four seed rungs to a 325,524-byte compiler, with no C compiler, assembler or linker writing
any byte of the chain. The 408 bytes are a binary written as 7,903 bytes of commented hex text and turned into bytes by a 1,048-byte POSIX shell script (load0.sh); the shell's printf is the one outside tool, and the chain runs only on AArch64 Linux. Rebuilding gives the committed binary byte for byte. This is a fixed-output reproducibility match along one build path from a pinned commit; it is not diverse double compilation and does not prove omc correct.
git clone https://github.com/aien-dev/omega-rosetta && cd omega-rosetta && sh run.sh
run.sh clones omega-mv at the commit pinned in omega.ref, births omc from the seed
with seed/omega-from-seed.sh, checks that the compiler's sha256 is the pinned
2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f, then compiles and runs every task
and compares its output byte for byte with tasks/<name>/expected.txt. It prints one PASS or
FAIL line per task and TASKS PASS <passed>/<total>, and exits 0 only when every task passes.
sh run.sh --prebuilt uses omega-mv's committed seed/out/omc (same sha256 check) instead of the
seed birth; sh run.sh --omc PATH uses a compiler you already have.
You need Linux on AArch64 (a Raspberry Pi 4/5 on a 64-bit OS, an Arm cloud VM, Apple silicon
running Linux, a GitHub ubuntu-24.04-arm runner), POSIX sh, git, sha256sum and timeout.
omc is a static AArch64 Linux program and writes static AArch64 Linux programs. On x86_64 it only
runs under an emulator such as qemu-user (qemu-aarch64); I have not run this repository that way.
Where it stands
| Check | Level | Where |
Tasks pass on a GitHub ubuntu-24.04-arm runner, compiler born from the seed | EXERCISED | tasks workflow |
| Negative controls (mutated answer, mutated source, unsolved stubs, wrong solution, every answer mutated at once) fail | EXERCISED | same workflow |
Every expected.txt is reproduced by its oracle.py | EXERCISED | same workflow |
| Code posted to rosettacode.org | PROPOSED | drafts/rosettacode/ |
| Hugging Face dataset of the corpus | PROPOSED, built locally only | dataset/ |
This is a host CPU check of compiled programs on Linux AArch64. It says nothing about speed, and
it is not a claim that omc is correct beyond these programs.
Tasks
Each task directory holds the program (<name>.om), its expected output (expected.txt) and the
oracle that wrote it (oracle.py, Python 3 standard library only). omc never wrote an
expected.txt. Line counts leave out note comment lines; every file repeats its small output
helpers because Omega has no imports (see the notes below).
| Program | Rosetta Code task | Lines | Oracle uses |
100-doors | 100 doors | 50 | plain Python |
99-bottles-of-beer | 99 bottles of beer | 60 | plain Python |
abc-problem | ABC problem | 72 | plain Python |
abelian-sandpile-model | Abelian sandpile model | 88 | plain Python |
abundant-deficient-and-perfect-number-classifications | Abundant, deficient and perfect number classifications | 70 | math |
ackermann-function | Ackermann function | 52 | sys |
additive-primes | Additive primes | 87 | plain Python |
almost-prime | Almost prime | 66 | plain Python |
amicable-pairs | Amicable pairs | 54 | math |
anagrams | Anagrams | 112 | plain Python |
anti-primes | Anti-primes | 60 | plain Python |
array-concatenation | Array concatenation | 56 | plain Python |
attractive-numbers | Attractive numbers | 78 | plain Python |
bacon-cipher | Bacon cipher | 78 | plain Python |
base64-encode-data | Base64 encode data | 55 | base64 |
bead-sort | Sorting algorithms/Bead sort | 109 | plain Python |
bell-numbers | Bell numbers | 104 | math |
binary-digits | Binary digits | 35 | plain Python |
binary-search | Binary search | 92 | bisect |
bogosort | Sorting algorithms/Bogosort | 119 | plain Python |
bubble-sort | Sorting algorithms/Bubble sort | 78 | plain Python |
caesar-cipher | Caesar cipher | 38 | plain Python |
camel-case-and-snake-case | Camel case and snake case | 106 | plain Python |
catalan-numbers | Catalan numbers | 55 | math |
character-codes | Character codes | 44 | plain Python |
cocktail-sort | Sorting algorithms/Cocktail sort | 114 | plain Python |
cocktail-sort-with-shifting-bounds | Sorting algorithms/Cocktail sort with shifting bounds | 114 | plain Python |
comb-sort | Sorting algorithms/Comb sort | 103 | plain Python |
combinations | Combinations | 70 | plain Python |
combinations-with-repetitions | Combinations with repetitions | 82 | itertools, math |
comma-quibbling | Comma quibbling | 59 | plain Python |
conways-game-of-life | Conway's Game of Life | 118 | collections |
copy-a-string | Copy a string | 33 | plain Python |
count-how-many-vowels-and-consonants-occur-in-a-string | Count how many vowels and consonants occur in a string | 77 | plain Python |
count-in-factors | Count in factors | 70 | plain Python |
count-occurrences-of-a-substring | Count occurrences of a substring | 56 | plain Python |
count-the-coins | Count the coins | 64 | plain Python |
counting-sort | Sorting algorithms/Counting sort | 108 | plain Python |
crc-32 | CRC-32 | 46 | zlib |
cuban-primes | Cuban primes | 129 | plain Python |
cycle-sort | Sorting algorithms/Cycle sort | 125 | plain Python |
determinant-and-permanent | Determinant and permanent | 194 | fractions |
determine-if-a-string-has-all-the-same-characters | Determine if a string has all the same characters | 71 | plain Python |
determine-if-a-string-has-all-unique-characters | Determine if a string has all unique characters | 73 | plain Python |
determine-if-a-string-is-collapsible | Determine if a string is collapsible | 66 | itertools |
determine-if-a-string-is-numeric | Determine if a string is numeric | 104 | plain Python |
determine-if-a-string-is-squeezable | Determine if a string is squeezable | 78 | re |
digital-root | Digital root | 62 | plain Python |
dijkstras-algorithm | Dijkstra's algorithm | 133 | plain Python |
dutch-national-flag-problem | Dutch national flag problem | 121 | plain Python |
elementary-cellular-automaton | Elementary cellular automaton | 76 | plain Python |
emirp-primes | Emirp primes | 102 | plain Python |
empty-string | Empty string | 40 | plain Python |
equilibrium-index | Equilibrium index | 113 | plain Python |
ethiopian-multiplication | Ethiopian multiplication | 69 | plain Python |
evaluate-binomial-coefficients | Evaluate binomial coefficients | 66 | math |
extensible-prime-generator | Extensible prime generator | 96 | itertools |
factorial | Factorial | 42 | math |
factors-of-an-integer | Factors of an integer | 66 | plain Python |
fibonacci-n-step-number-sequences | Fibonacci n-step number sequences | 82 | plain Python |
fibonacci-sequence | Fibonacci sequence | 43 | plain Python |
fizzbuzz | FizzBuzz | 49 | plain Python |
floyd-warshall-algorithm | Floyd-Warshall algorithm | 125 | plain Python |
floyds-triangle | Floyd's triangle | 74 | plain Python |
fusc-sequence | Fusc sequence | 73 | functools |
generate-lower-case-ascii-alphabet | Generate lower case ASCII alphabet | 21 | string |
gnome-sort | Sorting algorithms/Gnome sort | 101 | plain Python |
gray-code | Gray code | 86 | plain Python |
greatest-common-divisor | Greatest common divisor | 57 | math |
greatest-subsequential-sum | Greatest subsequential sum | 127 | plain Python |
hailstone-sequence | Hailstone sequence | 81 | plain Python |
hamming-numbers | Hamming numbers | 78 | heapq |
happy-numbers | Happy numbers | 62 | plain Python |
harshad-or-niven-series | Harshad or Niven series | 60 | itertools |
heapsort | Sorting algorithms/Heapsort | 117 | plain Python |
hello-world | Hello world/Text | 16 | plain Python |
hello-world-newline-omission | Hello world/Newline omission | 16 | plain Python |
hofstadter-figure-figure-sequences | Hofstadter Figure-Figure sequences | 95 | itertools |
hofstadter-q-sequence | Hofstadter Q sequence | 61 | plain Python |
identity-matrix | Identity matrix | 51 | plain Python |
insertion-sort | Sorting algorithms/Insertion sort | 76 | plain Python |
isbn13-check-digit | ISBN13 check digit | 49 | plain Python |
isqrt-integer-square-root-of-x | Isqrt (integer square root) of X | 68 | math |
jewels-and-stones | Jewels and stones | 56 | plain Python |
josephus-problem | Josephus problem | 61 | plain Python |
kaprekar-numbers | Kaprekar numbers | 65 | plain Python |
knapsack-problem-0-1 | Knapsack problem/0-1 | 131 | itertools |
knapsack-problem-unbounded | Knapsack problem/Unbounded | 80 | fractions, itertools |
knights-tour | Knight's tour | 125 | plain Python |
kronecker-product | Kronecker product | 137 | plain Python |
langtons-ant | Langton's ant | 130 | plain Python |
leap-year | Leap year | 54 | calendar |
least-common-multiple | Least common multiple | 78 | functools, math |
letter-frequency | Letter frequency | 52 | collections, string |
levenshtein-distance | Levenshtein distance | 76 | plain Python |
longest-common-prefix | Longest common prefix | 80 | os.path |
longest-common-subsequence | Longest common subsequence | 72 | plain Python |
longest-increasing-subsequence | Longest increasing subsequence | 137 | itertools |
look-and-say-sequence | Look-and-say sequence | 63 | itertools |
loops-break | Loops/Break | 42 | plain Python |
loops-continue | Loops/Continue | 39 | plain Python |
loops-do-while | Loops/Do-while | 38 | plain Python |
loops-downward-for | Loops/Downward for | 33 | plain Python |
loops-for | Loops/For | 22 | plain Python |
loops-for-with-a-specified-step | Loops/For with a specified step | 38 | plain Python |
loops-foreach | Loops/Foreach | 23 | plain Python |
loops-n-plus-one-half | Loops/N plus one half | 40 | plain Python |
loops-while | Loops/While | 35 | plain Python |
lucas-lehmer-test | Lucas-Lehmer test | 100 | plain Python |
ludic-numbers | Ludic numbers | 98 | plain Python |
luhn-test-of-credit-card-numbers | Luhn test of credit card numbers | 48 | plain Python |
magic-squares-of-odd-order | Magic squares of odd order | 87 | plain Python |
mandelbrot-set | Mandelbrot set | 46 | plain Python |
matrix-multiplication | Matrix multiplication | 103 | plain Python |
matrix-transposition | Matrix transposition | 85 | plain Python |
matrix-with-two-diagonals | Matrix with two diagonals | 49 | plain Python |
maximum-triangle-path-sum | Maximum triangle path sum | 101 | plain Python |
maze-generation | Maze generation | 148 | plain Python |
maze-solving | Maze solving | 208 | plain Python |
md5 | MD5 | 144 | hashlib |
merge-sort | Sorting algorithms/Merge sort | 119 | plain Python |
mersenne-primes | Mersenne primes | 125 | plain Python |
miller-rabin-primality-test | Miller-Rabin primality test | 143 | math |
mobius-function | Möbius function | 60 | plain Python |
modular-exponentiation | Modular exponentiation | 113 | plain Python |
modular-inverse | Modular inverse | 86 | plain Python |
n-queens-problem | N-queens problem | 65 | itertools |
narcissistic-decimal-number | Narcissistic decimal number | 66 | itertools |
number-names | Number names | 120 | plain Python |
one-dimensional-cellular-automata | One-dimensional cellular automata | 88 | plain Python |
ordered-partitions | Ordered partitions | 107 | itertools, math |
ordered-words | Ordered words | 51 | plain Python |
palindrome-detection | Palindrome detection | 70 | plain Python |
pancake-sort | Sorting algorithms/Pancake sort | 116 | plain Python |
pangram-checker | Pangram checker | 51 | string |
pascals-triangle | Pascal's triangle | 53 | math |
patience-sort | Sorting algorithms/Patience sort | 126 | heapq |
perfect-numbers | Perfect numbers | 52 | plain Python |
perfect-totient-numbers | Perfect totient numbers | 68 | plain Python |
permutation-sort | Sorting algorithms/Permutation sort | 145 | itertools |
permutations | Permutations | 83 | plain Python |
permutations-by-swapping | Permutations by swapping | 101 | plain Python |
permutations-derangements | Permutations/Derangements | 144 | itertools, math |
pernicious-numbers | Pernicious numbers | 75 | plain Python |
phrase-reversals | Phrase reversals | 64 | plain Python |
population-count | Population count | 67 | itertools |
power-set | Power set | 56 | plain Python |
primality-by-trial-division | Primality by trial division | 74 | math |
prime-decomposition | Prime decomposition | 64 | plain Python |
priority-queue | Priority queue | 115 | heapq |
proper-divisors | Proper divisors | 69 | math |
pythagorean-triples | Pythagorean triples | 78 | math |
queue-definition | Queue/Definition | 97 | collections |
queue-usage | Queue/Usage | 95 | plain Python |
quicksort | Sorting algorithms/Quicksort | 105 | plain Python |
radix-sort | Sorting algorithms/Radix sort | 133 | plain Python |
recamans-sequence | Recaman's sequence | 76 | plain Python |
remove-duplicate-elements | Remove duplicate elements | 102 | plain Python |
remove-vowels-from-a-string | Remove vowels from a string | 39 | plain Python |
repeat-a-string | Repeat a string | 31 | plain Python |
reverse-a-string | Reverse a string | 28 | plain Python |
reverse-words-in-a-string | Reverse words in a string | 55 | plain Python |
roman-numerals-encode | Roman numerals/Encode | 70 | plain Python |
rot-13 | Rot-13 | 35 | codecs |
run-length-encoding | Run-length encoding | 79 | itertools, re |
selection-sort | Sorting algorithms/Selection sort | 98 | plain Python |
semiprime | Semiprime | 79 | plain Python |
sha-1 | SHA-1 | 131 | hashlib |
sha-256 | SHA-256 | 208 | hashlib |
shell-sort | Sorting algorithms/Shell sort | 103 | plain Python |
sieve-of-eratosthenes | Sieve of Eratosthenes | 48 | plain Python |
smith-numbers | Smith numbers | 89 | plain Python |
sort-an-integer-array | Sort an integer array | 104 | plain Python |
sort-disjoint-sublist | Sort disjoint sublist | 124 | plain Python |
sort-three-variables | Sort three variables | 162 | plain Python |
soundex | Soundex | 73 | plain Python |
spiral-matrix | Spiral matrix | 91 | plain Python |
square-free-integers | Square-free integers | 98 | math |
stack | Stack | 102 | plain Python |
stern-brocot-sequence | Stern-Brocot sequence | 97 | math |
stooge-sort | Sorting algorithms/Stooge sort | 97 | plain Python |
strand-sort | Sorting algorithms/Strand sort | 155 | plain Python |
string-append | String append | 28 | plain Python |
string-case | String case | 37 | plain Python |
string-comparison | String comparison | 83 | plain Python |
string-concatenation | String concatenation | 30 | plain Python |
string-length | String length | 51 | sys |
string-matching | String matching | 69 | plain Python |
string-prepend | String prepend | 37 | plain Python |
strip-a-set-of-characters-from-a-string | Strip a set of characters from a string | 38 | plain Python |
strip-comments-from-a-string | Strip comments from a string | 51 | re |
strip-whitespace-from-a-string | Strip whitespace from a string/Top and tail | 49 | plain Python |
substitution-cipher | Substitution cipher | 50 | string |
substring | Substring | 43 | plain Python |
sudoku | Sudoku | 103 | plain Python |
sum-and-product-of-an-array | Sum and product of an array | 47 | math |
sum-digits-of-an-integer | Sum digits of an integer | 76 | string |
sum-multiples-of-3-and-5 | Sum multiples of 3 and 5 | 54 | plain Python |
temperature-conversion | Temperature conversion | 71 | fractions |
the-twelve-days-of-christmas | The Twelve Days of Christmas | 55 | plain Python |
thue-morse | Thue-Morse | 33 | plain Python |
tokenize-a-string | Tokenize a string | 36 | plain Python |
topological-sort | Topological sort | 149 | heapq |
topswops | Topswops | 121 | itertools |
totient-function | Totient function | 79 | math |
towers-of-hanoi | Towers of Hanoi | 47 | plain Python |
tree-traversal | Tree traversal | 105 | collections |
twin-primes | Twin primes | 79 | bisect, itertools |
url-decoding | URL decoding | 51 | sys, urllib.parse |
url-encoding | URL encoding | 50 | urllib.parse |
van-eck-sequence | Van Eck sequence | 54 | plain Python |
vigenere-cipher | Vigenère cipher | 55 | plain Python |
water-collected-between-towers | Water collected between towers | 146 | plain Python |
wireworld | Wireworld | 96 | plain Python |
word-wrap | Word wrap | 53 | textwrap |
zig-zag-matrix | Zig-zag matrix | 77 | plain Python |
The SHA-256 round constants and initial values in tasks/sha-256/sha-256.om were copied
mechanically from omega-mv's om/sha256/sha256-om2.om; the hashes
are checked against Python's hashlib, and "Rosetta code" gives Rosetta Code's published value
764faf5c…cdfcf.
The 49 number-theory tasks that carry a wolfram.txt were also checked a second, independent way:
the file records a Wolfram Language query that rebuilds the whole expected output from Wolfram
built-ins, and whether that text's SHA-256 matched expected.txt (all 49 record a match).
Exercises
47 small problems in the Exercism style. Each exercises/<name>/<name>.om is a stub that traps
until you write the function; test.om holds the cases. For 42 of them the cases come from
exercism/problem-specifications
canonical-data.json at commit 650bebeb (MIT; see NOTICE); each test.om notes every
case's uuid and how many cases it kept, skipped and left out as superseded.
sh run.sh # once, to birth omc into build/
sh exercise.sh exercises/leap # test your exercises/leap/leap.om
Omega has no imports, so exercise.sh joins your file and test.om into one unit, compiles it and
runs it. You get one ok N - ... or not ok N - ... line per case and EXERCISE PASS <name> when
all pass. Reference solutions are in exercises/<name>/.meta/example.om.
Reading Omega in ten minutes
These are the things I would want to know before opening the first file. The full guide is
OM-2 tutorial, the language reference is
OMEGESE.md, and om2-tour.om is a
single runnable tour.
- Prefix words, one statement per line.
add a mul b c is a + b * c. Every operator is a
word with a fixed number of operands, so there are no parentheses and no precedence.
- The first line that is not a
note picks the profile. Every file here starts with om2, which
allows unsized views (view uchar *) and slices (part a start count).
- Types are explicit and never mix silently.
uchar ushort uint ulong, char short int long,
f32 f64, bool. A literal takes the type its context needs; when there is none, name it:
c = uint 0xffffffff. Converting is a word: ulong k, bitcast ulong n.
- Assignment declares.
x = ulong 0 makes a local; later x = add x 1 updates it. A name first
set inside a block ends with that block.
- Arrays and access.
d = new uchar 20 0 makes a local array; get a i reads, put a i v writes.
An index out of range traps (exit 103), never a wild write. global seq ulong 1000 is a zeroed global array.
- Functions and parameters.
fn gcd a ulong b ulong to ulong … end. Array parameters say how
they are used: view (read only) or edit (may write).
- Every loop has a bound.
while cond bound 999 and for i ulong 10. A loop that runs past its
bound traps (exit 104), so no loop here can spin forever.
- Traps and exit codes.
trap 13 stops the program with exit code 113 (100 + code). Compiler
errors print omc: line N: error K and exit with K.
- Names are short. Locals, globals and texts have at most 8 characters, function names up to 63.
Operator and host words are reserved (
neg is negation, so the minus-sign text is minus).
- No imports, no standard library. A program is one unit; units compose by concatenation. Output
is the host word
write 1 buf offset count, which is why each task carries emit/emitu helpers.
Benchmark
bench/: a MultiPL-E adapter for Omega. It translates HumanEval (129/164) and MBPP (272/400) into OM-2 prompts and tests, and grades completions with the pinned omc. It includes 10 hand solutions and the gates (sh bench/check.sh --omc PATH). See bench/README.md.
Rosetta Code drafts
drafts/rosettacode/ holds one ready-to-paste .wiki section per task and
the steps to add the language. Rosetta Code's Category:Omega already describes two unrelated
languages called Omega (Günther Blaschek's prototype-based language and Tim Sheard's functional
language), so the drafts use the language's own name, Omegese, under a new Category:Omegese,
plus a one-line pointer on Category:Omega. Nothing has been posted; see
drafts/rosettacode/STEPS.txt.
Foreign dependencies
None of these is part of an Omega program; they fetch, check or drive. Every task binary is written
by omc alone.
| Tool | Version | Purpose | Omega replacement |
POSIX sh, awk, cmp, diff, cat, mktemp, timeout | runner image (Ubuntu 24.04 coreutils/dash) | run.sh, exercise.sh driver glue | an Omega driver once omega-mv grows process spawning words for tests; the host words fork/execprog/waitpid exist today |
sha256sum | GNU coreutils | pin check of omc | omega-mv's own SHA-256 in om/sha256 |
git | runner image | clone omega-mv at the pin | none planned; a verification tool |
| Python 3 standard library | 3.12 on the runner | independent oracles that write expected.txt | none: an oracle must stay independent of Omega |
GitHub Actions actions/checkout@v4, actions/upload-artifact@v4 | v4 | CI | none planned |
Connected repos
Contributing
New tasks are welcome. Add tasks/<name>/<name>.om, an oracle.py that does not use Omega, and the
expected.txt it prints; sh run.sh must pass. Sign off your commits (git commit -s).
Licence
Apache-2.0 WITH LLVM-exception (LICENSE, NOTICE). Code posted to Rosetta Code
is also published there under the GNU Free Documentation License 1.3, the site's content licence.
Human-Directed Agentic Engineering
Development follows Human-Directed Agentic Engineering (HDAE): humans define goals,
architecture, constraints, acceptance criteria, and stopping points; agents implement,
execute checks, diagnose failures, and revise within those boundaries. Human review
retains responsibility for claims, acceptance, and release decisions. This describes
the development method, not a change to runtime autonomy or historical evidence.
For the documented method and a systems-software case study, see Gregory M. Kurtzer
(2026), *Ginux: Building an Independent Kernel That Runs Linux Userspace through
Human-Directed Agentic Engineering*, technical report, v1, Zenodo,
https://doi.org/10.5281/zenodo.23682548.