A fully functional native compiler for JOVIAL J73 (MIL-STD-1589C), a programming language from 1959 designed for bombing things more accurately. Now you too can experience the joy of military avionics software development from your gaming PC.
I wrote this whilst learning Rust (mistake) and kind of applied a tutorial which heavily featured LLVM. Hence this compiler. I'm currently looking at doing a rewrite in C, also JOVIAL is still featured in embedded software. Running LLVM which is a heck of a dependency is not a good idea in the embedded space.
So please watch out for the rewrite (I've also done a version of this in OCaml but thats neither here nor there)
JOVIAL (Jules' Own Version of the International Algebraic Language) was created in 1959 because apparently FORTRAN wasn't violent enough. It was used extensively in:
It's basically what happens when the Pentagon asks "what if ALGOL, but angrier?"
This compiler goes harder than it has any right to:
PRINT and READ because even fighter jets need to say hello sometimesGrab a release from the Releases page. Unzip. Run. Pretend it's 1959.
| Platform | File |
|---|---|
| Windows x64 | jovialc-x86_64-pc-windows-msvc.zip |
| Linux x64 | jovialc-x86_64-unknown-linux-gnu.tar.gz |
| macOS ARM | jovialc-aarch64-apple-darwin.tar.gz |
For those who enjoy suffering:
git clone https://github.com/Zaneham/jovial
export LLVM_SYS_180_PREFIX=/path/to/llvm
cargo build --release
LLVM_SYS_180_PREFIX to your LLVM installation)jovialc myprogram.jov -f exe
./myprogram
jovialc myprogram.jov -f exe -o bomber.exe
| Flag | Output | Use Case |
|---|---|---|
-f exe |
Executable | Just works. Compiles and links automatically. |
-f c |
C source code | When you want to see the horror |
-f llvm |
LLVM IR | When you want to see more horror |
-f object |
Native .o file | When you need manual control |
-f ast |
AST dump | Debugging (or masochism) |
START HELLO;
PRINT('Hello from 1959!');
TERM
Yes, TERM instead of END. Yes, strings use single quotes. Yes, semicolons everywhere. Welcome to the past.
START FIBONACCI;
ITEM N S 32 = 10;
ITEM A S 32 = 0;
ITEM B S 32 = 1;
ITEM TEMP S 32 = 0;
ITEM I S 32 = 0;
PRINT('Fibonacci sequence:');
WHILE I < N;
PRINT(A);
TEMP := A + B;
A := B;
B := TEMP;
I := I + 1;
END
TERM
Output:
Fibonacci sequence:
0
1
1
2
3
5
8
13
21
34
It runs. On your modern computer. In native code. A language designed when computers were the size of rooms is now printing Fibonacci numbers faster than the original programmers could blink.
' in identifiers like CURRENT'WAYPOINT. This is called an "apostrophe identifier" and it's exactly as cursed as it sounds.WAYPOINTS(5) is array access, not a function call. The parser just has to figure it out.┌─────────────────────────────────────────────────────────────┐
│ JOVIAL J73 Compiler │
├─────────────────────────────────────────────────────────────┤
│ Source (.jov) │
│ ↓ │
│ Lexer (Logos) → Tokens │
│ ↓ │
│ Parser (Recursive Descent) → AST │
│ ↓ │
│ Semantic Analysis → Symbol Table, Type Checking │
│ ↓ │
│ LLVM Codegen (inkwell) → LLVM IR │
│ ↓ │
│ LLVM Backend → Native Object File │
│ ↓ │
│ Linker → Executable │
│ ↓ │
│ Your code runs on silicon that would blow the minds │
│ of every engineer who worked on the original compilers │
└─────────────────────────────────────────────────────────────┘
If you've made it this far, you're clearly interested in languages that predate common sense. Good news: there's more where this came from.
Because syntax highlighting is a human right, even for languages the Geneva Convention forgot:
| Project | What It Is | Why It Exists |
|---|---|---|
| jovial-lsp | Language Server for JOVIAL | IntelliSense for bombing things |
| hals-lsp | HAL/S Language Server | The Space Shuttle's favourite |
| cms2-lsp | CMS-2 Language Server | US Navy missiles deserve autocomplete |
| coral66-lsp | CORAL 66 Language Server | British military computing, stiff upper lip included |
| mumps-lsp | MUMPS Language Server | Healthcare IT from the shadow realm |
| chill-lsp | CHILL Language Server | Telecom switches and existential dread |
| racf-lsp | IBM RACF Language Server | Mainframe security, now with squiggly lines |
| IBM-system360-lsp | System/360 COBOL & PL/I | For when you need to debug your grandfather's code |
When compilers aren't enough and you need to simulate entire extinct and new computers:
| Project | What It Emulates | Level of Concerning |
|---|---|---|
| Conway | RISC-V & x86 binary translator | Moderate |
| voyager-fds-emulator | Voyager Flight Data Subsystem | High |
| viking-marsrover-emulator | Viking Mars Lander | Very High |
| minuteman-computer-emulator | Minuteman missile guidance | FBI watchlist |
| setun70-emulator | Soviet trinary computer | Cold War nostalgia |
If you're seeing a pattern here, congratulations. You've identified a problem.
Found a bug? Want to discuss the finer points of MIL-STD-1589C? Simply need to tell another human being that you write JOVIAL and have them not immediately change the subject?
I can't promise I'll fix your problem, but I can promise I'll be unreasonably interested in it. If you're maintaining legacy avionics code and need moral support, I'm your man. If you're from the Pentagon and this compiler somehow ended up in something important, I would like to state for the record that I included a test suite.
Based in New Zealand, where it's already tomorrow and the sheep outnumber the JOVIAL programmers roughly eight million to one.
Apache License 2.0. Do whatever you want with it, no strings. See LICENSE.