LFN is a Lisp dialect that compiles to Nim. It processes s-expressions into Nim AST via macros, giving you Lisp syntax with full access to the Nim ecosystem and type system. Inspired by Hylang. Docs are hosted here, and release builds are here.
(import std/strutils)
(proc greet ((name string)) (: string)
(toUpperAscii name))
(echo (greet "lfn"))Compile and run:
lfn compile hello.lfn && ./hello
# LFNRequires Nim >= 2.2.4.
nimble buildThis produces a bin/lfn binary. To run it against a file:
lfn check file.lfn # type-check only
lfn compile file.lfn # compile to binary- Getting Started — installation, first program, core concepts
- Language Reference — all language forms
- Macro System — writing and using macros
- Nim Interop — calling Nim stdlib, dot notation, exports, pragmas
- CLI Reference — every
lfnsubcommand and flag - The REPL —
lfn repl's interactive session model - Package Layout — organizing application and library projects
- API documentation is generated from source via
nimble docs(see man/api.md) intodocs/, served via GitHub Pages - Changelog — notable changes per release
The examples/ directory contains runnable .lfn programs covering types, loops, error handling, macros, pragmas, and Nim interop.
LFN — Lisp Flavoured Nim
Copyright (C) 2025 George Watson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.