uwulisp
Syntax highlighting for uwulisp, a Lisp dialect with a trampoline-based evaluator, lexical closures, hygienic macros, and optional bytecode compilation.
Features
- Syntax highlighting for all uwulisp constructs:
- Special forms:
define, lambda, if, let, begin, for, tailcall, defmacro, import, quote, quasiquote
- Quasiquote shorthands:
`, ,, ,@
' reader shorthand for quote
- String literals with escape sequences (
\n, \t, \r, \", \\)
- Numbers including negatives and scientific notation (
-1.5, 3.14e2)
- Line comments starting with
;
- Predicate symbols (
is-even?, null?, …)
- Arithmetic and comparison operators (
+, -, *, /, =, <, >, …)
- Bracket matching and auto-close for
() and ""
- Word selection aware of uwulisp's atom rules — hyphens and
? are part of identifiers
Language overview
uwulisp is a dynamically typed Lisp. A program is a sequence of expressions:
; comment
(define square (lambda (x) (* x x)))
(square 9) ; ⇒ 81
(let ((a 3) (b 4))
(+ a b)) ; ⇒ 7
(for i 0 5 (print i)) ; prints 0 1 2 3 4
`(the answer is ,(+ 40 2)) ; ⇒ (the answer is 42)
Tail calls inside if, begin, let, and lambda bodies are automatically trampolined. Use tailcall explicitly for mutual recursion:
(define is-even?
(lambda (n)
(if (= n 0) 1 (tailcall is-odd? (- n 1)))))
(define is-odd?
(lambda (n)
(if (= n 0) 0 (tailcall is-even? (- n 1)))))
(is-even? 1000000) ; ⇒ 1 (no stack overflow)
Requirements
No external dependencies. Install the extension and open any .uwu file.
Release Notes
1.0.0
Initial release — syntax highlighting, bracket matching, and language configuration for uwulisp.
| |