Hacker News new | ask | show | jobs
by potholereseller 381 days ago
It would probably depend on the Scheme/Lisp implementation and how it was secured.

If it used a Scheme implementation like in Halo:CE, then people would have justifiably hated it. If it used something more like MIT-Scheme, people might've been okay with it. But I suspect it would get the same hate that JS gets, since there is a lot of low-quality JS code floating around -- even though JS itself isn't remotely that bad -- and you would instead have a lot of low-quality Scheme code floating around. Damned if you do, damned if you don't.

FWIW, it is feasible to put Scheme/Lisp in a browser today, and it might even be fun. Take a browser that lacks JS (e.g. Dillo, w3m); figure out how to add Firefox's or Chromium's approach to isolating each Javascript instance; and embed a Scheme or Common Lisp implementation (e.g. Chez Scheme [1] or ECL [2]).

You will need to decide what Scheme/Lisp functions/macros to include/exclude. It may seem obvious to exclude file operations, but they did that with JS and now we have IndexedDB; a restricted, virtual file system might be fun to play with. Multithreading might seem like a great thing to include, until you start trying to implement secure multithreading. I would start with whatever cl-isolated [3] allows and expand/contract from there.

And before anyone asks, "would this actually be worth implementing in 2025?", the answer is decidely "yes". You could build powerful desktop applications without the full weight of Electron. You could develop local-network webapps for you and/or your company. But I think it would be a bad idea to deploy this on the open internet without first spending a lot of time securing the browser overall.

Another option is resurrecting Closure [4], which is written entirely in Common Lisp. In that, you could go on a wild tangent and support multiple scripting languages (e.g. Common Lisp via cl-isolated, cl-forth [5], cl-javascript [6], cl-python [7], scheme88 [8], and even Coalton [9]).

[1] <https://old.reddit.com/r/scheme/comments/a3oogf/questions_on...>

[2] With ECL, you could use cl-isolated in addition to OS-level containerization, to achieve more defense-in-depth. Or maybe port cl-isolated to Chez Scheme.

[3] <https://github.com/kanru/cl-isolated/>

[4] <http://closure.common-lisp.dev>

[5] <https://github.com/gmpalter/cl-forth>

[6] <https://marijnhaverbeke.nl/cl-javascript/>

[7] <https://clpython.common-lisp.dev/>

[8] <http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/s...>

[9] <https://github.com/coalton-lang/coalton>

1 comments

I imagine the sandboxing and existence of terrible code wouldn't have been especially different from JS. I think the ubiquity would have helped to make people more aware of the advantages of Lisp. We might have substantially more Lisp-derived languages in popular use today.

I'm currently working on a project in Clojurescript, and I'm aware of some of the other options for running Lisp in a browser.