Skip to content
LexerLangv0.1.0

Cache

lexer cache — where the parsed AST is kept and when it goes stale.

Terminal
lexer cache info  [--dir path]
lexer cache list  [--dir path]
lexer cache clear [--dir path]

What is stored#

What is stored is the parsed AST — not compiler output. LexerLang is not compiled; the cache only removes the cost of parsing the same file again on every request.

Terminal
lexer cache info --dir .

When it goes stale#

Validity is decided from the file's modification time and size. If either changed, the file is parsed again.

That is cheaper than hashing the contents, but it has a limit: if you change a file and then set its mtime back to an older value — with touch -t, or a copy that preserves mtime — the cache keeps using the stale AST.

Terminal
lexer cache clear --dir .

Where it lives#

Under the directory given with --dir, in .lexer/cache. The default is the application's working directory.

That matters for a service running under systemd: the service needs write access to that directory.

.env
# in the systemd unit
ReadWritePaths=/var/www/application

Without permission the server still runs, but it reparses on every request.

Next#

Syntax — the shape of the language.