Cyqra [/ˈsiːkrə/] - is an experimental shell language that aims to seamlessly unify shell scripting and functional programming into a single coherent syntax.
Warning
Cyqra is still in early development. Its syntax and features are subject to change.
The following are the core features established so far:
let x = 4
# shadowing - x is rebound, not reassigned
let x = "hello" # x is now a string, the int is gone
echo $x # "hello"let name = "world"
echo "Hello ${name}" # ${ } for expressions
echo "hello $name" # $ident shorthand
echo "result: ${1 + 2 * 3}" # arbitrary expressions insidefn greet(name) {
return "hello, ${name}!"
}
# last expression is the implicit return value
fn add(a, b) { a + b }greet("World") #a function style call
greet World # a shell style call
greet ("World") # a shell style call with first arg as an expression
# same applies to external commands
echo("World")
echo World
echo ("World")Cyqra disambiguates shell calls from expressions based on whether the name has been declared. If unknown, the name is treated as a shell command and everything after it becomes arguments. Consider the following:
echo - echo # echo is unknown -> shell call -> passes "- echo" as args
let echo = 366
echo - echo # echo is a variable -> arithmetic -> 366 - 366 = 0Note
Grab the latest nightly build from Releases to try it out.