No Need for Semicolons to Separate Statements in Tyl

In classic C, C++ style languages, as well as programming languages as C# and Java, each statement should end with a semicolon, thus enabling their parser to identify the end of the statement.

Intuitively it sounds pretty logical and efficient and all programmers happily put the ending semicolon and hitting ENTER, to proceed to next statement.

Other languages as Basic and Python, do not use semicolons and each line is a statement on its own. Yet to identify a composite statement, such as an “if” statement, they come up with a solution that involves either using keywords such as BEGIN and END, or an indentation scheme.

Tyl addresses these issues with its own attitude. It goes in the same path as other scripting languages by omitting the mandatory semicolon, yet it is also not needed to use indentation and instead uses a symbol to denote a statement end, and other separators such as an “else” statement.

Tyl also has an ENTITY-REST statement parsing scheme, that allows to construct chained statements.

Here is an example of a Fibonacci calculator in Tyl:

fibonaccimap { 0 0 1 1 }

go » i 101 ~ print i + ': ' + fibonacci i

fibonacci n »
    not null fibonaccimap n ? ✖✖ fibonaccimap n

    n1 n - 1
    n2 n - 2
    fib1 fibonaccimap n1
    fib2 fibonaccimap n2
    fibonaccimap n fib1 + fib2

More on Tyl in