ku-lang: a poetic programming language (esolang) where haikus become executable code. Write beautiful 5-7-5 syllable programs—the user gets playful, poetic feedback: variables, functions, and conditions all expressed in verse.
WHAT'S A HAIKU?
ha·ku | 'hīˌko͞o |
noun (plural haiku or plural haikus | 'hīˌko͞oz |)
a Japanese poem of seventeen syllables, in three lines of five, seven, and five, traditionally evoking images of the natural world.
• a poem in English written in the form of a haiku.
ORIGINJapanese, contracted form of haikai no ku ‘light verse’.
WHAT'S A SYLLABLE?
syl·la·ble | 'sɪləb(ə)l | A syllable is a part of a word that contains a single vowel sound and that is pronounced as a unit.ORIGINGreek syllabē (συλλαβή), meaning "that which is held together" or "a taking together".
how to use ku-lang
feature
example
what it does
variable/operators
the moon remembers five plus two in the night sky echo moon bright now
Assigns and prints variable
Variable Anatomy:
Line 1:the [name] remembers - Variable declaration
Line 2:[expression] - Math using number words (one, two, three...) and operators (plus, minus)
Line 3:echo [name] - Print the variable value
Syntax:
the [variable] remembers [expression] echo [variable]
Example:
(syntax template - not a valid haiku to test)
the moon remembers five plus two echo moon
Number words: one, two, three, four, five, six, seven, eight, nine, ten
Operators: plus, minus
summon function
summon the sun now the light remembers the day three plus four is bright
Defines a function
Summon Function Anatomy:
Line 1:summon [function_name] - Function declaration
Line 2:[any haiku line] - Function body (must be 7 syllables)
Line 3:[any haiku line] - Function body (must be 5 syllables)
the sun remembers one plus two plus two civic echo civic now
Becomes:
now civic echo civic two plus two plus one remembers sun the
Validation: Palindrome word must be valid English word
rhyming
the stars remember five plus two in the dark night echo stars shine bright
Doubles variable value if lines rhyme
Rhyme Anatomy:
Trigger: Any two lines rhyme (end with same sound)
Effect: Doubles the variable value
Detection: Checks line 1-2, 1-3, and 2-3 for rhymes
Example:
the stars remember five plus two in the dark night echo stars shine bright
Result: "night" and "bright" rhyme, so stars = 14 (7×2)
Output: Variable prints with doubled value
function fusion
summon magic now civic flows at dawn today birds fly in the sky
call the magic now kayak glides on lake today ripples in the blue
Fuses summoned and calling haikus, reverses if palindromes found
Function Fusion Anatomy:
Process: When calling a summoned function
Fusion: Takes line 2 from summoned + line 2 from calling
Result: Creates new haiku: [summoned line 2, calling line 2, summoned line 3]
Example:
summon magic now civic flows at dawn today birds fly in the sky
call the magic now kayak glides on lake today ripples in the blue
Fused Result:
civic flows at dawn today kayak glides on lake today birds fly in the sky
Palindrome check: If either haiku has palindrome, fusion gets reversed
Output: Shows "✨ Fused Haiku:" followed by the result
loop
count from one to three words disappear one by one until none remain
Loops and consumes words
Loop Anatomy:
Line 1:count from [number] to [number] - Loop range
Line 2:[words to consume] - Words that get eaten (7 syllables)
Line 3:[any haiku line] - Loop body (5 syllables)
Syntax:
count from [number] to [number] [words to consume] [any haiku line]
Example:
count from one to three words disappear one by one until none remain
Output:
Loop in action: words disappear from the edges each round: 🌀 Iteration 1: "words disappear one by one" (7 syllables) 🌀 Iteration 2: "disappear one by" (5 syllables) 🌀 Iteration 3: "one by" (2 syllables)
Range: Uses number words: one, two, three, four, five, etc.
comments
the moon remembers five plus two // assign value echo softly now
Ignores // comments
Comments Anatomy:
Syntax:// [comment text] - Double slash followed by text
this is not right too many syllables here error will appear
Prints error with visual feedback
Error Handling Anatomy:
-_- : Syllable count errors - "Line X has Y syllables (expected Z)"
+_+ : Loop range errors - "Invalid loop range"
> : Condition errors - "No haiku to evaluate after condition"
English: "'[word]' is not a valid English word!!"
Palindrome: "'[word]' is not a valid English word palindrome"
Function: "Function '[name]' not found" or "Error in function '[name]'"
ERROR GALLERY
A collection of poetic failures, where haikus break free from their 5-7-5 chains. Each error tells a story of syntax gone astray.
Syllable Symphony Gone Wrong
-_- : Line 1 has 6 syllables (expected 5)
the beautiful moon remembers five plus two in the night echo moon bright
Solution: Use a shorter word like "bright" or "soft" instead of "beautiful"
-_- : Line 2 has 8 syllables (expected 7)
the moon remembers five plus two plus three plus four echo softly now
Solution: Use fewer numbers or combine them into a single expression
Words That Don't Belong
'supercalifragilistic' is not a valid English word!!
the supercalifragilistic remembers five plus two echo magic
Solution: Use a valid English word from the dictionary
'xyzzy' is not a valid English word!!
the xyzzy remembers five plus two echo portal
Solution: Use a real English word instead of made-up terms
Palindrome Puzzles
'racecar' is not a valid English word palindrome
the moon remembers racecar speeds through night echo softly now
Solution: Use a valid English palindrome word like "radar" or "level"
'kayak' is not a valid English word palindrome
the sun remembers kayak glides on water echo river now
Solution: Use a recognized English palindrome word
Loop Logic Lost
+_+ : Invalid loop range
count from five to three words disappear one by one until none remain
Solution: Count from smaller to larger number (e.g., "count from three to five")
+_+ : Invalid loop range
count from apple to orange words disappear one by one until none remain
Solution: Use number words "one" through "ten" for loop ranges
Function Fables
Function 'moonlight' not found
call the moonlight now the stars remember five plus five
Solution: Define the function first using "summon" before calling it
> : No haiku to evaluate after condition
if moon is great the stars remember one plus one
Solution: Add a haiku after the condition to specify what happens when true
meow
ABOUT KU-LANG
Discover the story behind ku-lang, a programming language where poetry meets code.
The Birth of Ku-Lang
why i made an esolang?
I didn't start this to change how people think about code or poetry.
I just saw a good challenge in Hack Club's "You Ship, We Ship," named "Twist" in which we gotta make an esolang to maybe win a keyboard!
and thought: what if a haiku could run?
also I like building strange, tiny things—like that beasty the HTTP server which I hand-wired from scratch.
Ku-Lang is just another one of those side quests ♨︎.
What Makes Ku-Lang Special
actually Haikus are not a very new concept for me, i first learned about it in my school english textbook.
i was 15, in class 10th, had a friend with whom i wrote some haikus in the back of a rough notebook maybe, in a free period.
we wrote em all wrong cause we did not know the 5-7-5 rule but we enjoyed writing three lines.
and from then i know what a Haiku is, Ku-Lang is special cause i get some nostalgia from it!!
LICENSE & COPYRIGHT
MIT License
Permission is granted, free of charge, to use, copy, modify, and distribute this software and its documentation for any purpose, including commercial use, subject to the following conditions:
The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software.
This software is provided "as is", without warranty of any kind. The authors are not liable for any claim, damage, or other liability arising from its use.
Comments Anatomy:
// [comment text]
- Double slash followed by text[any haiku line] // [comment]
[any haiku line]
five plus two // assign value
echo softly now