Formal grammars and syntax definitions for lykn — a Lisp-flavoured JavaScript.
| Directory | Description |
|---|---|
ebnf/ |
Formal W3C-style EBNF grammar with railroad diagram SVGs |
text-mate/ |
TextMate grammar (source.lykn) for syntax highlighting and GitHub Linguist |
lykn uses two file extensions:
| Extension | Layer | Description |
|---|---|---|
.lykn |
surface | User-facing language: bind, func, type, match, threading macros, contracts |
.lyk |
kernel | Low-level s-expression IR: direct mapping to JavaScript constructs |
The formal grammar in ebnf/lykn.ebnf covers four
sections:
- Lexical — tokens (symbols, numbers, keywords, strings, comments)
- Reader — s-expression structure (lists, vectors, maps, quotation)
- Surface — language forms (
bind,func,type,match, etc.) - Kernel — reference only (tracks ESTree/JavaScript)
Railroad diagrams for each production are in
ebnf/diagrams/. To regenerate them:
cargo runThe TextMate grammar at
text-mate/syntaxes/lykn.tmLanguage.json
provides syntax highlighting for both .lykn and .lyk files. It is
used by GitHub Linguist for language detection and by editors that
support TextMate grammars (VS Code, Sublime Text, etc.).
MIT — see LICENSE.