ku-lang
Version:
An esolang with syntax like haikus!!!
129 lines (83 loc) • 4.3 kB
Markdown
<p align="center">
<img src="./assets/banner.png" alt="Ku Lang Logo" style="max-width: 100%; width: 100%;"/>
</p>
<p align="center">
<h1>🌸 Ku-Lang: A Poetic Esoteric Programming Language</h1>
</p>
<p align="center">
<em>"A language where code must be poetry. Literal haikus."</em>
</p>
<p align="center">
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.
</p>
<p align="center">
<em>"In Japanese, ku (句) literally means "verse" - the exact term used for lines in a haiku."</em>
</p>
<div align="center">
<h1>♨︎ What Makes Ku-Lang Special?</h1>
<strong>Syllable Validation</strong>: Each line must follow strict 5-7-5 syllable counting<br><br>
<strong>Variable Memory System</strong>: Store values using "remembers" and "echo" patterns<br><br>
<strong>Natural Language Arithmetic</strong>: Perform math with English words (one plus five)<br><br>
<strong>Conditional Execution</strong>: Use "if greater" to control program flow<br><br>
<strong>Loop Constructs</strong>: "count from" creates iterative word consumption<br><br>
<strong>Function Definition & Calling</strong>: "summon" creates functions, "call the" executes them<br><br>
<strong>Rhyme Detection Algorithm</strong>: Automatically detects rhyming lines and doubles values<br><br>
<strong>Palindrome Word Detection</strong>: Finds palindromic words and reverses entire haikus<br><br>
<strong>English Word Validation</strong>: Ensures all words exist in comprehensive dictionary<br><br>
<strong>Haiku Fusion System</strong>: Combines summoned and calling haikus into new poems<br><br>
<strong>Error Handling</strong>: Provides descriptive error messages with line numbers<br><br>
<strong>Visual Feedback</strong>: Shows syllable counts, iteration progress, and special effects
</div>
<h1>Try it!!</h1>
<strong>Get ku-lang running in minutes on your machine!</strong>
<h2>Installation</h2>
<strong>◦ Option 1: Install globally (recommended)</strong>
```bash
npm install -g ku-lang
```
<em>Note: On macOS/Linux, you may need to use <code>sudo npm install -g ku-lang</code> if you get permission errors.</em>
<strong>◦ Option 2: Clone and install locally</strong>
```bash
git clone https://github.com/NewSmoke38/ku-lang
cd ku-lang
npm install
npm link
```
<em>Note: You might need <code>sudo npm link</code> on macOS/Linux if you get permission errors.</em>
<h2>Your First Ku-Lang Program</h2>
Create a file <code>hello.ku</code>:
```ku
value remembers
five plus five is the answer
echo value now
```
Run it:
```shell
ku hello.ku
```
<strong>Verify CLI installation:</strong>
```shell
ku --version
ku --help
```
<h2><strong>⭐︎ What I Learned Building Ku-Lang</strong></h2>
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!!!
<p>Read my notion Doc on how i made it! (coming soon)</p>
<h1>⛳︎ Contributing in Ku-Lang!</h1>
<strong>Contributions are welcomed to ku-lang!</strong>
<strong>Hop onto the "Try it" section and run it on your machine! </strong>
<em>Every contribution, no matter how small, helps make ku-lang more beautiful! 🌸</em>
---
<p align="center">
<strong>❝ 言語の美学 ❞</strong>
</p>
<p align="center">
この言語では:<br>
・それぞれの俳句の行には目的がある<br>
・リズムは見せかけではなく、構造である<br>
・意味は形式からではなく、言葉による機能から生まれる<br>
<br>
他のものが詩を真似るなら、<br>
この言語は詩に計算させる。<br>
装飾ではなく、ただの動作。
</p>