interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / README.md

427 lines · 54266 bytes Raw Blame History Source

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

CheckLevelWhere
Tasks pass on a GitHub ubuntu-24.04-arm runner, compiler born from the seedEXERCISEDtasks workflow
Negative controls (mutated answer, mutated source, unsolved stubs, wrong solution, every answer mutated at once) failEXERCISEDsame workflow
Every expected.txt is reproduced by its oracle.pyEXERCISEDsame workflow
Code posted to rosettacode.orgPROPOSEDdrafts/rosettacode/
Hugging Face dataset of the corpusPROPOSED, built locally onlydataset/

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).

ProgramRosetta Code taskLinesOracle uses
100-doors100 doors50plain Python
99-bottles-of-beer99 bottles of beer60plain Python
abc-problemABC problem72plain Python
abelian-sandpile-modelAbelian sandpile model88plain Python
abundant-deficient-and-perfect-number-classificationsAbundant, deficient and perfect number classifications70math
ackermann-functionAckermann function52sys
additive-primesAdditive primes87plain Python
almost-primeAlmost prime66plain Python
amicable-pairsAmicable pairs54math
anagramsAnagrams112plain Python
anti-primesAnti-primes60plain Python
array-concatenationArray concatenation56plain Python
attractive-numbersAttractive numbers78plain Python
bacon-cipherBacon cipher78plain Python
base64-encode-dataBase64 encode data55base64
bead-sortSorting algorithms/Bead sort109plain Python
bell-numbersBell numbers104math
binary-digitsBinary digits35plain Python
binary-searchBinary search92bisect
bogosortSorting algorithms/Bogosort119plain Python
bubble-sortSorting algorithms/Bubble sort78plain Python
caesar-cipherCaesar cipher38plain Python
camel-case-and-snake-caseCamel case and snake case106plain Python
catalan-numbersCatalan numbers55math
character-codesCharacter codes44plain Python
cocktail-sortSorting algorithms/Cocktail sort114plain Python
cocktail-sort-with-shifting-boundsSorting algorithms/Cocktail sort with shifting bounds114plain Python
comb-sortSorting algorithms/Comb sort103plain Python
combinationsCombinations70plain Python
combinations-with-repetitionsCombinations with repetitions82itertools, math
comma-quibblingComma quibbling59plain Python
conways-game-of-lifeConway's Game of Life118collections
copy-a-stringCopy a string33plain Python
count-how-many-vowels-and-consonants-occur-in-a-stringCount how many vowels and consonants occur in a string77plain Python
count-in-factorsCount in factors70plain Python
count-occurrences-of-a-substringCount occurrences of a substring56plain Python
count-the-coinsCount the coins64plain Python
counting-sortSorting algorithms/Counting sort108plain Python
crc-32CRC-3246zlib
cuban-primesCuban primes129plain Python
cycle-sortSorting algorithms/Cycle sort125plain Python
determinant-and-permanentDeterminant and permanent194fractions
determine-if-a-string-has-all-the-same-charactersDetermine if a string has all the same characters71plain Python
determine-if-a-string-has-all-unique-charactersDetermine if a string has all unique characters73plain Python
determine-if-a-string-is-collapsibleDetermine if a string is collapsible66itertools
determine-if-a-string-is-numericDetermine if a string is numeric104plain Python
determine-if-a-string-is-squeezableDetermine if a string is squeezable78re
digital-rootDigital root62plain Python
dijkstras-algorithmDijkstra's algorithm133plain Python
dutch-national-flag-problemDutch national flag problem121plain Python
elementary-cellular-automatonElementary cellular automaton76plain Python
emirp-primesEmirp primes102plain Python
empty-stringEmpty string40plain Python
equilibrium-indexEquilibrium index113plain Python
ethiopian-multiplicationEthiopian multiplication69plain Python
evaluate-binomial-coefficientsEvaluate binomial coefficients66math
extensible-prime-generatorExtensible prime generator96itertools
factorialFactorial42math
factors-of-an-integerFactors of an integer66plain Python
fibonacci-n-step-number-sequencesFibonacci n-step number sequences82plain Python
fibonacci-sequenceFibonacci sequence43plain Python
fizzbuzzFizzBuzz49plain Python
floyd-warshall-algorithmFloyd-Warshall algorithm125plain Python
floyds-triangleFloyd's triangle74plain Python
fusc-sequenceFusc sequence73functools
generate-lower-case-ascii-alphabetGenerate lower case ASCII alphabet21string
gnome-sortSorting algorithms/Gnome sort101plain Python
gray-codeGray code86plain Python
greatest-common-divisorGreatest common divisor57math
greatest-subsequential-sumGreatest subsequential sum127plain Python
hailstone-sequenceHailstone sequence81plain Python
hamming-numbersHamming numbers78heapq
happy-numbersHappy numbers62plain Python
harshad-or-niven-seriesHarshad or Niven series60itertools
heapsortSorting algorithms/Heapsort117plain Python
hello-worldHello world/Text16plain Python
hello-world-newline-omissionHello world/Newline omission16plain Python
hofstadter-figure-figure-sequencesHofstadter Figure-Figure sequences95itertools
hofstadter-q-sequenceHofstadter Q sequence61plain Python
identity-matrixIdentity matrix51plain Python
insertion-sortSorting algorithms/Insertion sort76plain Python
isbn13-check-digitISBN13 check digit49plain Python
isqrt-integer-square-root-of-xIsqrt (integer square root) of X68math
jewels-and-stonesJewels and stones56plain Python
josephus-problemJosephus problem61plain Python
kaprekar-numbersKaprekar numbers65plain Python
knapsack-problem-0-1Knapsack problem/0-1131itertools
knapsack-problem-unboundedKnapsack problem/Unbounded80fractions, itertools
knights-tourKnight's tour125plain Python
kronecker-productKronecker product137plain Python
langtons-antLangton's ant130plain Python
leap-yearLeap year54calendar
least-common-multipleLeast common multiple78functools, math
letter-frequencyLetter frequency52collections, string
levenshtein-distanceLevenshtein distance76plain Python
longest-common-prefixLongest common prefix80os.path
longest-common-subsequenceLongest common subsequence72plain Python
longest-increasing-subsequenceLongest increasing subsequence137itertools
look-and-say-sequenceLook-and-say sequence63itertools
loops-breakLoops/Break42plain Python
loops-continueLoops/Continue39plain Python
loops-do-whileLoops/Do-while38plain Python
loops-downward-forLoops/Downward for33plain Python
loops-forLoops/For22plain Python
loops-for-with-a-specified-stepLoops/For with a specified step38plain Python
loops-foreachLoops/Foreach23plain Python
loops-n-plus-one-halfLoops/N plus one half40plain Python
loops-whileLoops/While35plain Python
lucas-lehmer-testLucas-Lehmer test100plain Python
ludic-numbersLudic numbers98plain Python
luhn-test-of-credit-card-numbersLuhn test of credit card numbers48plain Python
magic-squares-of-odd-orderMagic squares of odd order87plain Python
mandelbrot-setMandelbrot set46plain Python
matrix-multiplicationMatrix multiplication103plain Python
matrix-transpositionMatrix transposition85plain Python
matrix-with-two-diagonalsMatrix with two diagonals49plain Python
maximum-triangle-path-sumMaximum triangle path sum101plain Python
maze-generationMaze generation148plain Python
maze-solvingMaze solving208plain Python
md5MD5144hashlib
merge-sortSorting algorithms/Merge sort119plain Python
mersenne-primesMersenne primes125plain Python
miller-rabin-primality-testMiller-Rabin primality test143math
mobius-functionMöbius function60plain Python
modular-exponentiationModular exponentiation113plain Python
modular-inverseModular inverse86plain Python
n-queens-problemN-queens problem65itertools
narcissistic-decimal-numberNarcissistic decimal number66itertools
number-namesNumber names120plain Python
one-dimensional-cellular-automataOne-dimensional cellular automata88plain Python
ordered-partitionsOrdered partitions107itertools, math
ordered-wordsOrdered words51plain Python
palindrome-detectionPalindrome detection70plain Python
pancake-sortSorting algorithms/Pancake sort116plain Python
pangram-checkerPangram checker51string
pascals-trianglePascal's triangle53math
patience-sortSorting algorithms/Patience sort126heapq
perfect-numbersPerfect numbers52plain Python
perfect-totient-numbersPerfect totient numbers68plain Python
permutation-sortSorting algorithms/Permutation sort145itertools
permutationsPermutations83plain Python
permutations-by-swappingPermutations by swapping101plain Python
permutations-derangementsPermutations/Derangements144itertools, math
pernicious-numbersPernicious numbers75plain Python
phrase-reversalsPhrase reversals64plain Python
population-countPopulation count67itertools
power-setPower set56plain Python
primality-by-trial-divisionPrimality by trial division74math
prime-decompositionPrime decomposition64plain Python
priority-queuePriority queue115heapq
proper-divisorsProper divisors69math
pythagorean-triplesPythagorean triples78math
queue-definitionQueue/Definition97collections
queue-usageQueue/Usage95plain Python
quicksortSorting algorithms/Quicksort105plain Python
radix-sortSorting algorithms/Radix sort133plain Python
recamans-sequenceRecaman's sequence76plain Python
remove-duplicate-elementsRemove duplicate elements102plain Python
remove-vowels-from-a-stringRemove vowels from a string39plain Python
repeat-a-stringRepeat a string31plain Python
reverse-a-stringReverse a string28plain Python
reverse-words-in-a-stringReverse words in a string55plain Python
roman-numerals-encodeRoman numerals/Encode70plain Python
rot-13Rot-1335codecs
run-length-encodingRun-length encoding79itertools, re
selection-sortSorting algorithms/Selection sort98plain Python
semiprimeSemiprime79plain Python
sha-1SHA-1131hashlib
sha-256SHA-256208hashlib
shell-sortSorting algorithms/Shell sort103plain Python
sieve-of-eratosthenesSieve of Eratosthenes48plain Python
smith-numbersSmith numbers89plain Python
sort-an-integer-arraySort an integer array104plain Python
sort-disjoint-sublistSort disjoint sublist124plain Python
sort-three-variablesSort three variables162plain Python
soundexSoundex73plain Python
spiral-matrixSpiral matrix91plain Python
square-free-integersSquare-free integers98math
stackStack102plain Python
stern-brocot-sequenceStern-Brocot sequence97math
stooge-sortSorting algorithms/Stooge sort97plain Python
strand-sortSorting algorithms/Strand sort155plain Python
string-appendString append28plain Python
string-caseString case37plain Python
string-comparisonString comparison83plain Python
string-concatenationString concatenation30plain Python
string-lengthString length51sys
string-matchingString matching69plain Python
string-prependString prepend37plain Python
strip-a-set-of-characters-from-a-stringStrip a set of characters from a string38plain Python
strip-comments-from-a-stringStrip comments from a string51re
strip-whitespace-from-a-stringStrip whitespace from a string/Top and tail49plain Python
substitution-cipherSubstitution cipher50string
substringSubstring43plain Python
sudokuSudoku103plain Python
sum-and-product-of-an-arraySum and product of an array47math
sum-digits-of-an-integerSum digits of an integer76string
sum-multiples-of-3-and-5Sum multiples of 3 and 554plain Python
temperature-conversionTemperature conversion71fractions
the-twelve-days-of-christmasThe Twelve Days of Christmas55plain Python
thue-morseThue-Morse33plain Python
tokenize-a-stringTokenize a string36plain Python
topological-sortTopological sort149heapq
topswopsTopswops121itertools
totient-functionTotient function79math
towers-of-hanoiTowers of Hanoi47plain Python
tree-traversalTree traversal105collections
twin-primesTwin primes79bisect, itertools
url-decodingURL decoding51sys, urllib.parse
url-encodingURL encoding50urllib.parse
van-eck-sequenceVan Eck sequence54plain Python
vigenere-cipherVigenère cipher55plain Python
water-collected-between-towersWater collected between towers146plain Python
wireworldWireworld96plain Python
word-wrapWord wrap53textwrap
zig-zag-matrixZig-zag matrix77plain 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.

StubProblem
acronymacronym
all-your-baseall-your-base
allergiesallergies
armstrong-numbersarmstrong-numbers
atbash-cipheratbash-cipher
binary-searchbinary-search
bobbob
changechange
collatz-conjecturecollatz-conjecture
dartsdarts
difference-of-squaresdifference-of-squares
eliuds-eggseliuds-eggs
grainsgrains
hamminghamming
hello-worldhello-world
isbn-verifierisbn-verifier
isogramisogram
knapsackknapsack
largest-series-productlargest-series-product
leapleap
luhnluhn
nth-primenth-prime
nucleotide-countnucleotide-count
pangrampangram
pascals-trianglepascals-triangle
perfect-numbersperfect-numbers
prime-factorsprime-factors
protein-translationprotein-translation
queen-attackqueen-attack
raindropsraindrops
resistor-colorresistor-color
resistor-color-duoresistor-color-duo
resistor-color-trioresistor-color-trio
reverse-stringreverse-string
rna-transcriptionrna-transcription
rotational-cipherrotational-cipher
run-length-encodingrun-length-encoding
saddle-pointssaddle-points
scrabble-scorescrabble-score
secret-handshakesecret-handshake
seriesseries
sievesieve
space-agespace-age
square-rootsquare-root
sum-of-multiplessum-of-multiples
triangletriangle
two-fertwo-fer

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.

Benchmark

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.

ToolVersionPurposeOmega replacement
POSIX sh, awk, cmp, diff, cat, mktemp, timeoutrunner image (Ubuntu 24.04 coreutils/dash)run.sh, exercise.sh driver gluean Omega driver once omega-mv grows process spawning words for tests; the host words fork/execprog/waitpid exist today
sha256sumGNU coreutilspin check of omcomega-mv's own SHA-256 in om/sha256
gitrunner imageclone omega-mv at the pinnone planned; a verification tool
Python 3 standard library3.12 on the runnerindependent oracles that write expected.txtnone: an oracle must stay independent of Omega
GitHub Actions actions/checkout@v4, actions/upload-artifact@v4v4CInone 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.