๐ Every Language
One algorithm. Every programming language. Every implementation verified.
From COBOL to Rust, from FORTRAN to Prolog: one real-world algorithm, written
by the community in every language that can run it, all checked by the same
test suite.
Add your language โ ยท Specification ยท Languages ยท The challenge
๐ฏ The challenge
Collecting snippets in many languages is easy. Showing that a hundred
completely different programs behave identically is not.
Each implementation in this repository:
- ๐ง is written from scratch in its own language, with no wrappers, no
libraries that do the work and no API calls;
- ๐ฆ runs in its own container, built from a pinned toolchain;
- โ
passes the same 87 test vectors with identical JSON output;
- ๐ leaves evidence: source hashes, environment, per-test results and logs.
Our first goal is 64 languages, then 99, 128, 256 and beyond.
See Why 64? and the roadmap.
64 2โถ โโโโโโโโโโโโโโโโโโโโ 10 / 64 โ we are here
99 ๐บ โโโโโโโโโโโโโโโโโโโโ 10 / 99
128 2โท โโโโโโโโโโโโโโโโโโโโ 10 / 128
256 2โธ โโโโโโโโโโโโโโโโโโโโ 10 / 256
๐ข Why 64?
Because computers count in powers of two, and 64 is the number computing
keeps coming back to:
- 2โถ = 64. Six bits,
000000 to 111111, are exactly enough to give every
language on the board its own ID.
- 64-bit. It is the word size of almost every processor running today:
x86-64 in laptops and servers, ARM64 in phones and the cloud. Your code runs
on 64 bits.
- Base64. Its 64-character alphabet carries binary data through text
everywhere: email attachments,
data: URLs, JSON Web Tokens.
- Commodore 64 and Nintendo 64. Two machines that brought generations to
programming and gaming. The C64 is often cited as the best-selling single
computer model of all time.
- The 64 squares of a chessboard. In the old legend, one grain of wheat on
the first square, doubled on every next square, adds up to 2โถโด โ 1, which
is also the largest unsigned 64-bit integer. It is still the classic way to
explain exponential growth.
So we set the bar at 64 languages. Next comes 99, a toast to
99 Bottles of Beer, the classic
collection of one song in a thousand languages. After that the ladder goes
back to binary: 128 is 2โท, the size of the ASCII table, and 256 is 2โธ,
the values of a single byte.
๐ฎ๐น The algorithm: the Italian Fiscal Code
Every Italian resident has a 16-character codice fiscale. It looks simple,
but computing it exercises string manipulation, vowel and consonant rules, date
encoding, lookup tables and modular arithmetic. That makes it complex enough to
be a real program and small enough to write in COBOL or Assembly.
ROSSI ยท MARIO ยท 1980-01-01 ยท M ยท born in Rome (H501)
RSS MRA 80 A 01 H501 U
โ โ โ โ โ โ โโ check character
โ โ โ โ โ โโโโโโโโโ place of birth
โ โ โ โ โโโโโโโโโโโโโโ day (+40 if female)
โ โ โ โโโโโโโโโโโโโโโโโโ month (A, B, C, D, E, H, L, M, P, R, S, T)
โ โ โโโโโโโโโโโโโโโโโโโโโโโ year
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ name consonants
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ surname consonants
The full rules are in SPECIFICATION.md.
๐บ๏ธ Language board
|
Language |
|
Language |
|
Language |
|
Language |
| โ
|
C |
โ
|
C++ |
โ
|
Go |
โ
|
Java |
| โ
|
JavaScript |
โ
|
Perl |
โ
|
PHP |
โ
|
Python |
| โ
|
Ruby |
โ
|
Rust |
๐ |
Haskell |
๐ |
Prolog |
| ๐ |
COBOL |
๐ |
FORTRAN |
๐ |
Common Lisp |
๐ |
โฆyour favourite |
โ
verified ยท ๐ wanted: pick an open issue or propose another language
โก Try it in 30 seconds
You only need Docker and bash. Every toolchain, including the test
runner, lives in a container, so nothing gets installed on your machine.
$ git clone https://github.com/openapi/every-language-fiscal-code.git
$ cd every-language-fiscal-code
$ echo '{"surname":"ROSSI","name":"MARIO","birth_date":"1980-01-01","sex":"M","birthplace_code":"H501"}' | ./elc run python
{"fiscal_code": "RSSMRA80A01H501U"}
$ ./elc test
LANGUAGE STATUS TESTS
PHP verified 87/87
Python verified 87/87
Verified: 2/2 โ report written to reports/report.json
| Command |
What it does |
./elc list |
list implementations |
./elc test |
build and verify every implementation |
./elc test rust go |
verify only some of them |
./elc run <lang> |
pipe stdin through one implementation |
./elc shell <lang> |
open a shell inside a language image |
โ๏ธ How verification works
flowchart LR
A["languages/<lang>/<br/>source + Dockerfile"] --> B["docker build<br/>(pinned toolchain)"]
B --> C["87 test vectors<br/>JSON on stdin"]
C --> D{"output and exit code<br/>match?"}
D -- "100%" --> E["โ
verified"]
D -- "any failure" --> F["โ rejected"]
E --> G["report.json<br/>+ evidence"]
F --> G
Loading
Every program speaks the same contract: JSON in on stdin, JSON out on
stdout, exit code 0 or 1. Containers run with networking disabled, so the
algorithm really has to be in the code.
๐ฃ๏ธ Roadmap
|
Milestone |
Why |
What happens |
| โ
|
Foundation |
|
Spec, 87 test vectors, dockerized runner, CI |
| ๐ฏ |
64 |
2โถ |
Built by the core team, ten languages per session |
| ๐บ |
99 |
99 Bottles of Beer |
Community takes over; dashboard and Guinness application |
| ๐ค |
128 |
2โท, ASCII |
Historical machines and emulators |
| ๐พ |
256 |
2โธ, one byte |
Formal record attempt, second challenge (SHA-256) |
| ๐ |
512 โ 1024 |
2โน โ 2ยนโฐ |
The long tail, and the moonshot |
No deadlines, just milestones. Full plan in ROADMAP.md.
๐ค Contribute a language
The unit of contribution is one language not yet on the board.
- ๐ Pick a language issue and comment to claim it (or propose a new one).
- ๐ Create
languages/<lang>/ with your source, a Dockerfile, run.sh and manifest.yaml.
- ๐งช Run
./elc test <lang> until it shows 87/87.
- ๐ Open a Pull Request. CI verifies it and your name goes on the board.
Historical languages, esoteric runtimes and forgotten compilers are especially
welcome. See CONTRIBUTING.md for the rules and look at
languages/python for a complete example.
๐ Hacktoberfest
We take part in Hacktoberfest! Every language is
a self-contained, meaningful contribution: one folder, one program, 87 green
tests.
- Browse the
hacktoberfest issues.
Look for good first issue
if it is your first time.
- Comment on the issue to claim it, so nobody duplicates your work.
- Pull Requests that pass CI and follow CONTRIBUTING.md get
the
hacktoberfest-accepted label. Low-effort or spam PRs get spam.
๐ A world record?
We would like to propose a new record: the most programming languages used
to independently implement and execute the same algorithm. It has not
been submitted or recognized yet. RECORD.md explains the plan and
the evidence we are collecting.
๐ Learn more
Promoted with โค๏ธ by Openapi. Open to everyone, with no API keys, accounts or commercial services required.
A code computed here is the theoretical fiscal code for the given data, not necessarily the one officially assigned by the Italian Revenue Agency. All test data is synthetic. Released under the MIT License.