TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Common Lisp running natively over WebAssembly for the first time

97 pointsby metagamealmost 3 years ago
A month or so ago, I ported a Common Lisp implementation (npt) to WebAssembly to make a silly blog post, because I was bored and have a lot of time on my hands to waste with things like this (I don&#x27;t have a job, and because I have next to no experience, these meaningless, silly projects tend to fill what time I do have).<p>This is significant as it&#x27;s the first time Common Lisp in particular has ever been hosted on it; wasm has a few poor decisions in its design that make it less-than-conducive to being a target for Common Lisp, and a lot of the more interesting implementations require an implementation to already be on the platform for bootstrapping purposes.<p>My previous attempts using other implementations haven&#x27;t gone so well, despite throwing a <i>lot</i> of time at it (as an example, I have a fork of Eclipse Common Lisp, a defunct implementation from the 1990s, sitting on my disk with a few hundred lines of changes that I finally got to successfully compile and run a handful of very basic expressions, but it blows up when you try and define anything). In comparison, I was pleasantly surprised by how little I had to do, even though I did end up scrapping <i>loads</i> of lines of my own changes to npt in the process as I got a handle on how to make it work acceptably.<p>The Emscripten toolchain and I don&#x27;t get along, partially because I don&#x27;t like inlining ECMAScript into my C and vice-versa, so it&#x27;s little more than a neat little demo right now.<p>You can load slightly more complex programs into it by hijacking the &quot;imp&quot; ECMAScript function every few hundred milliseconds with strings containing <i>complete forms</i> (this is essentially a batch processor, so there&#x27;s no interactivity that allows it to wait while you decide what the rest of a form should be). Only one at a time, though. It&#x27;s not that fancy.<p>If you mess up at all, even just a little error, it will crash. This is by design; I disabled the debugger. It&#x27;s a giant hack, and the hack I eventually decided on left it impossible to have a debugging experience, with the benefit of getting to use a closer-to-unmodified npt.<p>This could be more useful, if I spent more time on it, but it&#x27;s more fun if it&#x27;s just a demo. I hope you enjoy the toy I made for you.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Batch_processing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Batch_processing</a><p>If you don&#x27;t know what forms are in the context of Common Lisp:<p><a href="http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;03_aba.htm" rel="nofollow">http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;03_aba...</a><p><a href="http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;26_glo_c.htm#compound_form" rel="nofollow">http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;26_glo...</a>

7 comments

aidenn0almost 3 years ago
This probably doesn&#x27;t count as &quot;natively&quot; but I&#x27;ve run ABCL[1] under Doppio[2]. Startup times are under a minute in Chromium based browsers and under an hour in Firefox. I&#x27;ve run into zero stability issues, but its no speed demon.<p>[edit]<p>Just tried again today and Firefox gets to a REPL in about 3.5 minutes, while chromium is still right about 1 minute.<p>1: <a href="https:&#x2F;&#x2F;abcl.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;abcl.org&#x2F;</a><p>2: <a href="https:&#x2F;&#x2F;plasma-umass.org&#x2F;doppio-demo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;plasma-umass.org&#x2F;doppio-demo&#x2F;</a>
评论 #31601370 未加载
gumbyalmost 3 years ago
Great work! You write,<p>&gt; …wasm has a few poor decisions in its design that make it less-than-conducive to being a target for Common Lisp…<p>Could you say a bit more about those design decisions?
评论 #31596305 未加载
评论 #31604681 未加载
评论 #31593894 未加载
评论 #31601115 未加载
catchclose8919almost 3 years ago
...god, my eyes ...why is <i>everything</i> CL plagued by such horrible design choices (hyperspec, Lisp-IDEs... all!) - why such ugly colors, ugly typography, bad contrasts, ugly logos, ugly diagrams, ugly supporting graphics?!<p>I know that even the language itself is kind of the opposite of &quot;beautiful&quot;, but the way all docs, blogs, websites etc. look ...seriously, is this intended to scare away any aesthetically sensitive people? Programming languages are about aesthetics too, and Lisp at its core (not CL ofc) <i>is</i> absolutely <i>beautiful!</i>
评论 #31602075 未加载
评论 #31593879 未加载
评论 #31593872 未加载
评论 #31595069 未加载
评论 #31595917 未加载
评论 #31595054 未加载
评论 #31594232 未加载
评论 #31593960 未加载
评论 #31593970 未加载
评论 #31594739 未加载
评论 #31593806 未加载
评论 #31595950 未加载
kotborealisalmost 3 years ago
Great work! A small nitpick — the page is a bit hard to read, links have low contrast, you can check it using accessibility tools.
评论 #31593558 未加载
评论 #31595965 未加载
FraaJadalmost 3 years ago
So much complaint about color schemes. Hitting the Reader View formatted the page beautifully.<p>I&#x27;m thankful it is a simple HTML page that could be easily formatted using browser-built-in tools.
评论 #31594812 未加载
评论 #31595962 未加载
ngcc_hkalmost 3 years ago
Like reading Rfc in 1990s … a bit odd choice to use this format and font to sell anything these days.
评论 #31602082 未加载
评论 #31600480 未加载
评论 #31596004 未加载
Existenceblinksalmost 3 years ago
I hope someone would create a tutorial which is using a toy programming language to compile to webassembly from scratch. Using existing language is too opaque to understand anything.
评论 #31601374 未加载
评论 #31595973 未加载