I made a programming language called Zen, wanted to share some examples

Hey, I’ve been working on this for a while now and finally feel okay sharing some code examples.

Zen is a statically typed language that compiles to native binaries through LLVM. Still a work in progress but the core stuff works.

One thing I’m kind o…


This content originally appeared on DEV Community and was authored by Jishith Mp

Hey, I've been working on this for a while now and finally feel okay sharing some code examples.

Zen is a statically typed language that compiles to native binaries through LLVM. Still a work in progress but the core stuff works.

One thing I'm kind of proud of is reactive variables. It's a first class feature where a variable automatically recomputes when something it depends on changes:

int cartItems = 3
int pricePerItem = 50
reactive int total = cartItems * pricePerItem

screen(`Total: $${total}`)   # 150

cartItems = 5
screen(`Total: $${total}`)   # 250, updates automatically

pricePerItem = 60
screen(`Total: $${total}`)   # 300

no event listeners or anything, it just stays in sync. got the idea from how spreadsheet cells work honestly

also has a standard library with time, fs, sys etc. here's a small example using both:

fn greet() {
    string t = time.time()
    List<string> parts = split(t, ":")
    int hour = Int(parts[0])

    string greeting = ""

    if (hour < 12) {
        greeting = "Good Morning"
    } else if (hour < 17) {
        greeting = "Good Afternoon"
    } else {
        greeting = "Good Evening"
    }

    screen(greeting + ", Welcome to Zen!")
}

greet()

and file I/O:

string path = "notes.txt"
string content = "Zen is minimal, fast, and fun to write."

fs.writeFile(path, content)

string data = fs.readFile(path)
screen(`File content: ${data}`)

fs.appendFile(path, " — written in Zen.")

string updated = fs.readFile(path)
screen(`Updated: ${updated}`)

anyway the full pipeline works, lexer parser AST LLVM IR native binary and a CLI. still lots to do but it's at a point where I can actually write real programs in it.

docs if anyone wants to look: https://jishith-dev.github.io/zen-doc/site/

open to feedback, especially on the syntax.


This content originally appeared on DEV Community and was authored by Jishith Mp


Print Share Comment Cite Upload Translate Updates
APA

Jishith Mp | Sciencx (2026-06-13T16:37:51+00:00) I made a programming language called Zen, wanted to share some examples. Retrieved from https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/

MLA
" » I made a programming language called Zen, wanted to share some examples." Jishith Mp | Sciencx - Saturday June 13, 2026, https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/
HARVARD
Jishith Mp | Sciencx Saturday June 13, 2026 » I made a programming language called Zen, wanted to share some examples., viewed ,<https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/>
VANCOUVER
Jishith Mp | Sciencx - » I made a programming language called Zen, wanted to share some examples. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/
CHICAGO
" » I made a programming language called Zen, wanted to share some examples." Jishith Mp | Sciencx - Accessed . https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/
IEEE
" » I made a programming language called Zen, wanted to share some examples." Jishith Mp | Sciencx [Online]. Available: https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/. [Accessed: ]
rf:citation
» I made a programming language called Zen, wanted to share some examples | Jishith Mp | Sciencx | https://www.scien.cx/2026/06/13/i-made-a-programming-language-called-zen-wanted-to-share-some-examples/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.