// Recursive Fibonacci function
def fibonacci(
n : Int32
)
{
if ( n <= 1 )
{
return 1;
}
else
{
return fibonacci( n - 1 ) + fibonacci( n - 2 );
}
}
puts fibonacci( 5 );
Clearly NOT intended for the typical Ruby/Crystal lover, but rather to allow those who find a curly-bracket language syntax more pleasant to their eyes, to not disregard Ruby or Crystal just because of a silly syntactic preference…
The compilation is instantaneous even for big files, and only the modified files are compiled when Cibyl is running in watch mode.
And the resulting code is 100% similar to handcrafted code, as Cibyl is implemented as an immediate transpiler, for productivity and performance reasons.
Even the line numbers are kept identical by default, to ease debugging.
Therefore there is absolutely no overhead of any sort.
The only downside is that you must properly align your blocks, as Cibyl uses their indentation to find their braces.