Show HN: I made an esoteric programming language that's read like a spellbook
16 hours ago
- #python interpreter
- #magic syntax
- #esoteric programming
- Spellscript is an esoteric programming language designed to resemble magical incantations.
- Programs are called 'spells' and are written in 'grimoires' with no need for newlines or indentation.
- Variables are declared using 'summon the x with essence of 10' which translates to 'x = 10' in traditional code.
- Dynamic typing is supported, and variables can be modified with 'enchant x with 20'.
- Arrays are referred to as 'collections' and can hold multiple values.
- Functions are called 'rituals' and must have at least one parameter.
- Conditionals and loops are written in a poetic style, e.g., 'if the signs show x equals 5 then' for an if statement.
- String manipulation is done with 'whispers of "text"' to represent strings.
- User input is captured with 'inquire whispers of "prompt" into x'.
- Output is generated using 'inscribe whispers of "the power is amplified: " bound with result'.
- The language lacks features like nested arrays, string indexing, modulo operator, break/continue in loops, comments, and recursion.
- Spellscript can be executed by running a Python script on a .spell file.
- The language draws inspiration from the Muffin programming language and used AI for debugging interpreter issues.