← All messages

The first .phlo files, and four words to build on

Eight files, 273 lines. Not an application: a language being tried out, with four declarations doing all the work.

prop, method, view and route. Along with the distinction that carries the most weight in daily use:

prop PI = 3.14159
prop title => "Hallo $this->name"

= is a value, => is an expression evaluated when it is asked for. One character, and it decides whether something is stored or computed.

A view is HTML after a colon, ended by a blank line, with variables written straight into it. No delimiters to learn, no template language layered on top of the markup:

view before(string $name):
<header>Header $name</header>
<main>

And % is the shortest path to another object. %res->end(%model($model)) in the source becomes phlo('res')->end(phlo('model', $model)) in the generated PHP, which is exactly what it means. Making a call to another object as cheap to write as reading a variable is what lets objects stay small: nothing rewards putting one more thing into the class you happen to be in.

Styles and scripts already sit in the same file as the logic they belong to, and the CSS already drops its semicolons and nests. Whether that co-location holds up on something larger than a test file is the next thing to find out.

We use essential cookies to make this site work. With your permission we also use analytics to improve the site.