Bark#
A programming language emphasizing simplicity and consistency via function chaining.
Origin#
The idea for bark first came to mind around ten years ago. Over the years, bark would randomly resurface and some unresolved syntax issue would find its resolution. I wasn’t close enough to a complete syntax to attempt implementation, even though I did try couple of times with both Go and Rust. Those didn’t go far because I’d quickly run into an unresolved issue with the syntax.
Eventually the syntax felt well-defined enough to try again. With the help of Claude Code, an interpreted version of the language was born. A working version allowed me to identify the design gaps and work through a wide arrange of issues.
The idea of a compiled version of the language came about early, but it was a lot easier to iterate with the interpreted version. The intepreted version will be where I’ll continue to work on language design. The compiled version is where I’ll continue improving performance and pushing the language to handle more than the intepreted version can handle. I ran into limitations pretty early on while working on some Rosetta Code examples. It was those limitations that really pushed the idea of a compiled version.
Bark never had a functional purpose in mind, I didn’t have a programming problem I thought this language would solve. The project was always about the syntax challenge. Now that it actually works, I have some thoughts on where it might be useful. I’ll update the site if those become a reality.
The Link Operator#
Bark’s core feature is the > link operator, which chains function calls by passing the left-hand value as the first argument to the right-hand function:
// Anonymous function - case/switch style example
//
// Anonymous functions can implement case/switch logic using return?().
// The function receives input and tests conditions, returning early on matches.
fn full_day_name(abbr string) {
// The value returned by str.lower() is passed to the anonymous function.
// Each condition is checked and return?() exits early if true.
//
// Example flow for input "WED":
// "WED" > str.lower() -> "wed"
// Anonymous function receives "wed"
// Check 1: "wed" > eq?("mon") -> false > return?("monday") -> no exit, continue
// Check 2: "wed" > eq?("tue") -> false > return?("tuesday") -> no exit, continue
// Check 3: "wed" > eq?("wed") -> true > return?("wednesday") -> exits function!
// Function returns "wednesday"
// "wednesday" > day_name -> variable binding
//
// The return?() function takes a boolean (from eq?) and a value.
// If the boolean is true, it exits the function and returns that value.
abbr > str.lower() > (day string) {
day > eq?("mon") > return?("monday")
day > eq?("tue") > return?("tuesday")
day > eq?("wed") > return?("wednesday")
day > eq?("thu") > return?("thursday")
day > eq?("thur") > return?("thursday")
day > eq?("fri") > return?("friday")
day > eq?("sat") > return?("saturday")
day > eq?("sun") > return?("sunday")
return("unknown day abbreviation") // Default case
}(string) > day_name
return(day_name)
}(string)
full_day_name("WED") > println()