Skip to content

Ku is a poetic one-dimensional esoteric programming language where every program must be written in haiku format (5-7-5 syllables)

License

Notifications You must be signed in to change notification settings

NewSmoke38/ku-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ku Lang Logo

🌸 Ku-Lang: A Poetic Esoteric Programming Language

"A language where code must be poetry. Literal haikus."

Ku-Lang is an esoteric programming language where every program must be written in haiku format (5-7-5 syllables), combining poetic beauty with code through features like rhyme detection, palindrome magic, and natural language arithmetic.

"In Japanese, ku (句) literally means "verse" - the exact term used for lines in a haiku."

♨︎ What Makes Ku-Lang Special?

Syllable Validation: Each line must follow strict 5-7-5 syllable counting

Variables/Operators: Store values using "remembers" and "echo" patterns

Natural Language Arithmetic: Perform math with English words (one plus five)

Conditional Execution: Use "if greater" to control program flow

Loop Constructs: "count from" creates iterative word consumption

Function Definition & Calling: "summon" creates functions, "call the" executes them

Rhyme Detection Algorithm: Automatically detects rhyming lines and doubles values

Palindrome Word Detection: Finds palindromic words and reverses entire haikus

English Word Validation: Ensures all words exist in comprehensive dictionary

Haiku Fusion System: Combines summoned and calling haikus into new poems

Error Handling: Provides descriptive error messages with line numbers

Visual Feedback: Shows syllable counts, iteration progress, and special effects

Try it!!

Get ku-lang running in minutes on your machine!

Installation

◦ Option 1: Install globally (recommended)

npm install -g ku-lang

Note: On macOS/Linux, you may need to use sudo npm install -g ku-lang if you get permission errors.

◦ Option 2: Clone and install locally

git clone https://github.com/NewSmoke38/ku-lang
cd ku-lang
npm install
npm link

Note: You might need sudo npm link on macOS/Linux if you get permission errors.

Your First Ku-Lang Program

Create a file hello.ku:

value remembers
five plus five is the answer
echo value now

Run it:

ku hello.ku

Verify CLI installation:

ku --version
ku --help

⭐︎ What I Learned Building Ku-Lang

Creating ku-lang taught me that programming languages are more than just about writing the correct syntax. I learned how to make a rigid 5-7-5 haiku structure work, where every line must be both functional and beautiful. Now i understand what an interpreter really does, from syllable counting of haikus to palindrome detection and rhyme analysis (its really cool btw). i leanred how to publish my own CLI on npm,yaayy! Even lines left empty between code blocks are to be specified so that the code doesnt crash lol. also comment functionality is a thing which i never gave attention to!! It was a great journey!!!

📖 Read my Notion Doc on how I made it!

⛳︎ Contributing in Ku-Lang!

Contributions are welcomed to ku-lang!

Hop onto the "Try it" section and run it on your machine!

Every contribution, no matter how small, helps make ku-lang more beautiful! 🌸

🔗 Links

  • GitHub - Source code and issues
  • Wiki - Official esolang wiki entry
  • npm - Package on npm registry
  • Lore - Development journey and decisions

❝ 言語の美学 ❞

この言語では:
・それぞれの俳句の行には目的がある
・リズムは見せかけではなく、構造である
・意味は形式からではなく、言葉による機能から生まれる

他のものが詩を真似るなら、
この言語は詩に計算させる。
装飾ではなく、ただの動作。

About

Ku is a poetic one-dimensional esoteric programming language where every program must be written in haiku format (5-7-5 syllables)

Resources

License

Stars

Watchers

Forks

Packages

No packages published