Over the years, I have grown increasingly found of the idea that code should read like prose. Clear, intentional, and free from unnecessary noise.
This curiosity led me to build Coluber a compiled, statically-typed programming language designed around three core values: Fun, Simple, and Fast.
What is Coluber?
Coluber is a personal hobby project and an open-source language written in Pascal. It works by transpiling .clbr source files into Pascal, which are then compiled by their respective toolchains into native binaries.
The name comes from Coluber, a genus of non-venomous snakes, known for being fast, agile, and adaptable.
Syntax Overview.
Here is what a typical Coluber function looks like:
public task calculate_score(points: int, bonus: int) -> int:
serve total = points + bonus
cond first (total > 100):
say("Excellent score.")
cond other (total >= 50):
say("Good result.")
cond nothing:
say("Keep going.")
serve total
Enter fullscreen mode Exit fullscreen mode
A few things worth to knows:
-
serveis used to declare variables. The type is inferred automatically, though explicit annotations are supported. -
cond first/cond other/cond nothingreplace the if / elif / else structure. -
loopandcrawlreplacewhileandforrespectively. -
taskdefines functions.
The syntax is intentionally orthogonal there is one clear way to do each thing, which keeps
code consistent and easy to follow.
Transpiles.
Coluber transpiled into pascal, which using an free pascal compiler coluber compiled through free pascal compiler return an executable file which as much usable for any needs. Yet before transpiled into two backends instead to pascal because it’s much powerfull and high community supports.
String Features.
Coluber supports standard string interpolation using {expression} syntax, as well as the full set of escape characters you would expect from a C-family language:
serve name = "World"
say("Hello, {name}!\nThis is a new line.\tAnd this is a tab.")
Enter fullscreen mode Exit fullscreen mode
Supported escape sequences include: \n, \t, \r, \a, \b, \f, \v, \0, \', \", and \\.
Project Status
Coluber is, frankly, a work in progress and that is part of what makes it interesting to work on.
Repository:
답글 남기기