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

lhj
## 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:

bash
legion run hello.lhj

Output:

lhj
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, invoke for super calls
  • Built-in math, strings, and os modules
  • Package manager with community registry
  • Interactive REPL with history and :commands
  • Static type hints (optional, unenforced at runtime)

Quick example: classes

lhj
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: 55

Next steps

Install the legion CLI and run your first .lhj file. Build something real in under 5 minutes. Full syntax reference for variables, functions, classes, and more. Try legionhjyu in your browser without installing anything.