HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
sctb
lumen
JavaScript2015–2024
sctb / lumen

lumen

A Lisp for Lua and JavaScript

14Distinct people
54Mentions
1Explicit recommenders
571GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A Lisp for Lua and JavaScript

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Lots of Lisp interest today! Here are a few resources. On Lisp: https://www.lurklurk.org/onlisp/onlisp.pdf Lumen - a Lisp for JavaScript and Lua: https://github.com/sctb/lumen…

shawn used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 4:43:50 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year54 dated mentions

Observed mentions: 2015-10-16 03:04:02 UTC to 2024-03-25 08:25:16 UTC.

0510152015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 17 mentions; 2 submissions, 15 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC606
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC615
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC17215
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC1019
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC624
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC211

What Hacker News says

10 sources
Ah, finally, the ideas from Lumen are percolating slowly into the mainstream: https://github.com/sctb/lumen (It's a lisp for both JS and Lua.) Eslisp is 2015, which is around the same time that Lumen was started: https://news.ycombinator.com/item?id=10264970 Though from the commit history, Lumen was actually started in 2012. Regardless, both projects seem to be roughly the same idea, which I find very interesting. "block" is better named "do", and "lambda" is better as "fn", but those are minor details. Most of the power of the idea seems present.
In Eslisp – An S-expression syntax for ECMAScript/JavaScript, with Lisp-like macros
For a very simple, very readable Lisp reader, see Lumen's reader.l file: https://github.com/sctb/lumen/blob/master/reader.l It compiles to Javacript and Lua, so if you prefer reading those, you can: https://github.com/sctb/lumen/blob/master/bin/reader.js https://github.com/sctb/lumen/blob/master/bin/reader.lua It turns out that you can greatly simplify the code by e.g. "does an atom start with 0x, 0-9, or dash? if so, try converting it to a number." That turns out to handle cases like 1e9 too. Whereas "1e" becomes a valid lisp symbol. So you can set it to your own value. The emacs source code is also worth reading. It's not simple, but it's simple enough to be understandable: https://github.com/emacs-mirror/emacs/blob/7b3e94b6648ed00c6... I like emacs source code because it handles "every possible real-world case that you can think of."
In Compiling a Lisp: Reader
Lumen – Lisp in Lua and JavaScript: https://github.com/sctb/lumen Scott Bell wrote a lot of that. I was fascinated by the self-hosting technique. The whole repo is so small that you can almost dismiss it as some kind of academic toy, if you don't realize it's a full-featured production-grade lisp. (Not to take anything away from Fennel! The more lisp, the better.)
In Fennel – Lisp in Lua
You can also write your own dialect of lisp within elisp, too. I ported Lumen[1] to emacs: https://github.com/shawwn/y/blob/abcf6f4406178880390308ff0b7... (define-global cut (x &optional from upto) (with l (dup x) (let (j 0 i (if (or (nil? from) (< from 0)) 0 from) n (\# x) upto (if (or (nil? upto) (> upto n)) n upto)) (while (< i upto) (set (at l j) (at x i)) (inc i) (inc j)) (each (k v) x (unless (number? k) (set (get l k) v)))))) The destructuring LET is so nice. Emacs' reader can also be completely overridden by user code. I used this technique to port pg's Arc to elisp: https://repl.it/repls/UnluckySturdyCharactercode#main.el (If you click "run" and type #\a you'll notice you get "a" rather than a syntax error.) [1] Lu
Read the rest
In Guilemacs – Emacs with Guile Scheme
Since this is getting a surprising amount of interest, let me sum up the technique here. It's really not hard to implement it in Javascript using Express. 1. inside of your express endpoint, create a closure that captures some state. For example, the user's IP address. (This is a dumb example, but the point is that you can capture whatever state you want. Some cases are mentioned here: http://paulgraham.com/road.html and here: http://ep.yimg.com/ty/cdn/paulgraham/bbnexcerpts.txt) EDIT: I updated this to capture the date + time the original page was loaded, which is slightly more compelling than a mere IP address. app.get('/', function (req, res) { let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; let now = new Date(); let date = now.getFullYear()+'-'+(now.getMonth()+1)+'-'+now.getDate(); let time
Read the rest
= now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(); let fn = (req, res) => { res.send(`hello ${req.query.name}. On ${date} at {time}, your IP address was ${ip}`) } ... see below ... }) 2. insert that closure into a global hash table, keyed by a random ID. g_fnids = {}; app.get('/', function (req, res) { let fn = ... let id = <generate random ID> g_fnids[id] = fn; res.send(`<a href="/x?fnid=${id}&name=bob">Say hello</a>`); }) 3. create an endpoint called /x which works like `/x?fnid=<function id>&foo=1&bar=2`. Use <function id> to look up the closure. Call the closure, passing the request to it: app.get('/x', function (req, res) { let id = req.query.fnid; let fn = g_fnids[id]; fn(req, res) } Done. Congratulations, your closure is now an express endpoint. Except you didn't have to name it. You can link users to it like `<a href="/x?fnid=<function id>&name=bob">Say hello</a>`. The reason this is a powerful technique is that you can use it with forms. The form target can be /x, and the query params are whatever the user types into the form fields. I bet you already see a few interesting use cases. And you might notice that this makes scaling the server a little more difficult, since incoming requests have to be routed to the server containing the actual closure. But in the meantime, you now have "inner functions" in your web framework. It makes implementing password reset functionality completely trivial, and no database required. If it seems slightly annoying to use – "I thought you said this was a productivity boost. But it's annoying to type all of that!" – lisp macros hide all of this boilerplate code, so there's zero extra typing. You can get lisp macros for Javascript using Lumen lisp: https://github.com/sctb/lumen Even without macros, though, I bet this technique is shorter. Suppose you had to store the date + time + IP address somewhere. Where would you put it? I assume some sort of nosql database like firebase. But wouldn’t that code be much longer and more annoying to write? So this technique has tremendous value, and I’m amazed no one is using it circa 2020.
In I’ve Consed Every Pair

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.