legionhjyu
legionhjyu (.lhj) is a programming language built from scratch in Python 3.12. Every keyword is original — nothing borrowed from Python, JavaScript, or Ruby. You write forge instead of let, blade instead of def, ritual instead of class. The interpreter is a tree-walking evaluator that runs your .lhj files directly.
It ships with a REPL, a formatter, a static checker, and a package manager (legion pkg). You can install community packages with one command or write your own and publish them to the registry.
Why legionhjyu
Most toy languages reuse familiar syntax from existing languages to lower the learning curve. legionhjyu takes the opposite approach: every construct has a fresh name, so reading code written in it requires actually learning the language rather than pattern-matching against Python or JavaScript.
The result is something that forces you to think about what you're typing instead of falling back on muscle memory. It's also just more interesting to write.
What it looks like
## hello.lhj
forge name = "Legionnaire"
echo "Hello, {name}!"
blade greet(who: str) -> str:
release "Welcome, {who}!"
march i in 1..5:
echo greet("warrior {i}")Running it:
legion run hello.lhjOutput:
Hello, Legionnaire!
Welcome, warrior 1!
Welcome, warrior 2!
Welcome, warrior 3!
Welcome, warrior 4!
Welcome, warrior 5!Key features
- Unique syntax —
forge,blade,ritual,march,shatter,skip,summon - String interpolation with
{expr}inside double-quoted strings - Pipeline operator
|>for chaining function calls - Pattern matching with
blade/case - Classes with inheritance,
invokefor super calls - Built-in
math,strings, andosmodules - Package manager with community registry
- Interactive REPL with history and
:commands - Static type hints (optional, unenforced at runtime)
Quick example: classes
ritual Warrior:
blade awaken(self, name: str, hp: int = 100):
self.name = name
self.hp = hp
blade attack(self, target):
echo "{self.name} strikes {target.name}!"
target.hp <- target.hp - 25
blade alive(self) -> yep:
release self.hp > 0
forge w = Warrior("Aria")
forge m = Warrior("Shadow", 80)
w.attack(m)
echo "Shadow HP: {m.hp}" ## Shadow HP: 55Next steps
Install the legion CLI and run your first .lhj file.