How I took Java annotations to their logical extreme by implementing a fully functioning, Turing-complete LISP dialect within them.
I have created AnnotationScript, a programming language whose syntax is expressed entirely in Java annotations. Yes, you read that right: Java annotations.
The pandemic lockdowns of 2020 did strange things to people. Some people started learning the guitar. Others decided to get in shape. But not me. I decided to take Java annotations to their logical extreme.
I think annotations are over-used in the Java ecosystem: you can use them for dependency injection, handling HTTP requests, and interacting with databases. You can even use them to generate code in various ways. But for some reason, nobody has actually used them to implement a full-blown, Turing-complete programming language. Until now.
Do you want to know how easy it is to actually implement LISP? Do you want to know how easy it is to recursively implement LISP in the LISP you just implemented? Do you want to know about the weird restrictions that Java annotations have?
You will be amazed. Weirded-out and amazed.
What’s this AnnotationScript language?
You can find it on GitHub!
- annotationscript - by moinart on Fiverr
- architecture-1 - by Jan Ouwens
- architecture-2 - by Jan Ouwens
- background - by Jan Ouwens
- bored - by DALL·E with prompt “photo of a bored white nerd with a neckbeard, sitting at a desk with a computer displaying java code, glancing at an alarm clock while surrounded by melting clocks” (not sure where the neckbeard went 😉)
- code-generator - by DALL·E with prompt “pixel art of a monkey typing at a computer”
- duke-says-no - by Jeff Dinkins for Sun/Oracle - source
- duke-says-yes & duke-says-yes-background - by Jeff Dinkins for Sun/Oracle - source
- environment-1 - by Jan Ouwens
- environment-2 - by Jan Ouwens
- evaluator - by Jan Ouwens
- fun - by DALL·E with prompt “childrens drawing of stick fligure children playing in a school playground with a swing, a slide and a tree”
- jan-ouwens - by Riemke Ouwens
- lockdown - by DALL·E with prompt “photo of a programmer wearing only short pants and no shirt sitting behind a computer in his man cave showing code on the screen, surrounded by amazon packages, books, game controllers and a guitar”
- meta-evaluator & meta-parser & meta-tokenizer - by Jan Ouwens
- mind-blown-1 - by DALL·E with prompt “meme of a person looking very surprised whose head explodes”
- mind-blown-2 - by DALL·E with prompt “meme of a person looking very surprised”
- nerd-cred - by DALL·E with prompt “hip hop album cover with nerds”
- parser - by Jan Ouwens
- rite-of-passage - by DALL·E with prompt “photo of a fat nerd with a spear in attack pose facing an angry male lion on the african savannah”
- the-little-schemer - by MIT Press - source
- tokenizer - by Jan Ouwens