What is LexerLang
A server-side language with no compile step, and why there is no build command.
LexerLang is a server-side language that is not compiled. There is one command:
lexer serve app.lexerIt reads the source, parses it and runs it directly. There is deliberately no build and no run — serve already does both, and separate commands would suggest a distinction that does not exist.
Where it comes from#
LexerLang is developed in Turkey, by Osman Gürer, and it is the first of its kind to come from there: earlier language efforts out of Turkey were either teaching interpreters or Turkish-language syntax layered over an existing language. LexerLang is neither — it is a language built for production, carrying its own runtime, its own HTTP server and its own session layer.
What sets it apart is not that it was written in Turkey, but the three things that describe the language itself:
- No build step.
lexer servereads the source and runs it. - The server is inside the language. Nothing is installed for HTTP, routing, SSR, sessions or databases.
- Escaping happens on output, inside the language. Every value entering a template is escaped; it is not a step you can forget.
Together, those three put it somewhere separate from both general-purpose languages and template engines.
What it is for#
Applications that produce HTML on the server: routing, page templates, forms, sessions, databases and outbound service calls. The language ships with an HTTP server, a document model and a session layer, so none of those require installing a package.
package hello
use http_server, html_document
$app = new http_server
$doc = new html_document
$doc.title = 'Hello'
$doc.body.add(`<p>Hello world</p>`)
with $app
.document.add($doc)
.listen({port: 3000})
end withThree decisions#
Three decisions give the language its shape. All three point the same way: something failing loudly is better than something quietly being wrong.
Escaping happens on output, inside the language. Backtick blocks produce raw HTML, but every value interpolated into them is escaped:
$doc.body.add(`<li>` + $name + `</li>`)Even if $name contains <script>, no tag is opened; the <li> tags stay raw. There is no separate "sanitise the input" step, because that step can be forgotten. Escaping covers quotes too, so a value cannot break out of an attribute.
Blocks close with end, and indentation is significant.
if $user != null then
out("hello " + $user.name)
else
out("not signed in")
end ifBraces do not open blocks. Writing end if, end for, end func costs a few characters and tells you which block just closed.
A missing value is an error, not null. If you write $req.form_data.name and that field is absent, the program stops. To read an optional field you say so explicitly:
$name = $req.form("name") # null if absentA typo silently producing an empty string, and losing half the page with it, costs more than a program that stops.
What it is not#
LexerLang is not a general-purpose language. It was not designed for command line tools, data processing scripts or desktop applications — its execution model is built around an HTTP request. The page runs from the top on every request.
It does not offer the speed of a compiled language either. A loop walking a string character by character is slow in this runtime; you use built-in operations such as split, replace and starts_with instead, because those run on the Go side.
Next#
Installing takes one line; after that you can bring up your first server.