Hello, world!
THP source code
Unlike PHP, THP code is written directly. There is no need to use any <?php
tags,
just write the code like any other programming language.
As a consequence of this, HTML templates are defined in other ways, which will be detailed later on.
To write a hello world program write the following code in a file:
print("Hello, world!")
thp
Then run thp hello.thp
from your terminal.
Instruction separation
THP uses whitespace to determine when a statement is over. In short,
where PHP uses a semicolon ;
, THP uses a newline.
echo("A");
echo("B");
echo("C");
print("A")
print("B")
print("C")
thp
As a consequence of this, there can only be 1 statement per line.