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.

Autology: A Lisp with access to its own interpreter

136 pointsby simonpure2 months ago

16 comments

Kimbsyabout 2 months ago
Hi this is my project!<p>I&#x27;m giving a talk on this in May for London Clojurians, and I&#x27;ll also be talking about it at Lambda Days in Krakow in June.<p><a href="https:&#x2F;&#x2F;www.meetup.com&#x2F;london-clojurians&#x2F;events&#x2F;306843409&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.meetup.com&#x2F;london-clojurians&#x2F;events&#x2F;306843409&#x2F;</a><p>The project was initially inspired by Dr John Sturdy&#x27;s thesis &quot;A Lisp through the Looking Glass&quot; which is all about interpreter towers and the ability to modify them in both directions.<p>This is all just for fun, I&#x27;ve yet to think of anything truly useful you can do with this. If you have any cool ideas please let me know, they might even make it into my talk!
jlaroccoabout 2 months ago
In Common Lisp, at least, it&#x27;s pretty typical for the compiler or interpretter to have packages for interacting with its internals. For example, `sb-c`, `sb-vm`, and `sb-ext` packages in SBCL; and the `ccl` package with Clozure Common Lisp, etc.<p>That ability also shows up in the inspector - it&#x27;s possible to inspect types, classes, functions, etc. and inspect the internal data structures the compiler uses to represent them.<p>With SBCL it&#x27;s even possible to modify the &quot;virtual ops&quot; the compiler uses, and emit assembly code that SBCL doesn&#x27;t support out of the box.<p>It&#x27;s a really convenient feature, and it would be nice if to see other languages pick it up.
评论 #43465411 未加载
abeppuabout 2 months ago
I haven&#x27;t read any of the code to see how it compares, but this work reminds me of research from Nada Amin &amp; Tiark Rompf on &quot;towers of interpreters&quot;, where a stack of meta-circular interpreters uses some explicit staging operations that make it possible to specialize for the interpreter code in a way that removes overhead.<p><a href="https:&#x2F;&#x2F;www.cs.purdue.edu&#x2F;homes&#x2F;rompf&#x2F;papers&#x2F;amin-popl18.pdf" rel="nofollow">https:&#x2F;&#x2F;www.cs.purdue.edu&#x2F;homes&#x2F;rompf&#x2F;papers&#x2F;amin-popl18.pdf</a>
评论 #43464423 未加载
评论 #43467010 未加载
bandramiabout 2 months ago
Isn&#x27;t having access to the interpreter (and scanner, and parser, and compiler) kind of what makes something Lisp rather than something else with a lot of parentheses?
评论 #43461013 未加载
评论 #43464633 未加载
评论 #43463217 未加载
ludstonabout 2 months ago
You can actually get completely stupid with this in Common Lisp using something called a &quot;Reader Macro&quot; which lets you temporarily take complete control over the interpreter.<p>For example, I have this joke project that defines a DSL for fizzbuzz:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;DanielKeogh&#x2F;fizzbuzz" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;DanielKeogh&#x2F;fizzbuzz</a>
bsimaabout 2 months ago
If you like this, you&#x27;ll love Shen <a href="https:&#x2F;&#x2F;shenlanguage.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shenlanguage.org&#x2F;</a>
ape4about 2 months ago
Since its written in Clojure which runs on the JVM why not a *jvm* variable also ;)
sargstuff2 months ago
Lisp take on generating an embedded VM at runtime&#x2F;ad hoc basis (vs. polymorphic coding)?<p>How would use the most recent &#x27;trie of lisp git diffs&#x27; differ from command to do a system call fork of lisp &#x2F; duplicate lisp lists &#x2F; apply &#x27;diffs&#x27; to forked system call of lisp?<p>Perhaps, lisp concurrency support without a system()&#x2F;debugger.[1]<p>(humor) To bad iLisp would be confused with other brand name(s).<p>[1] : Evil Scheduler: Mastering Concurrency Through Interactive Debugging : <a href="http:&#x2F;&#x2F;aoli.al&#x2F;blogs&#x2F;deadlock-empire&#x2F;" rel="nofollow">http:&#x2F;&#x2F;aoli.al&#x2F;blogs&#x2F;deadlock-empire&#x2F;</a>
johnisgoodabout 2 months ago
These &quot;inter-lingual&quot; examples such as <a href="https:&#x2F;&#x2F;github.com&#x2F;Kimbsy&#x2F;autology&#x2F;blob&#x2F;main&#x2F;resources&#x2F;examples&#x2F;inter-lingual-4.atl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Kimbsy&#x2F;autology&#x2F;blob&#x2F;main&#x2F;resources&#x2F;examp...</a> are pretty cool. What is the use-case of this or why would one want to do this? Just trying to bounce off ideas.
评论 #43465967 未加载
评论 #43460315 未加载
souenzzoabout 2 months ago
It&#x27;s awesome to see the amount of ideas you can explore with 1kloc lines of clojure!
Ciericabout 2 months ago
I was working on something similar to this a while ago, but the goal of it was experimenting with what a language that could modify it&#x27;s own syntax would look like. I was going to write something as basic as possible and then have example scripts on transforming the syntax to other languages. I was probably just going to do brainfuck and c in the end, but I wanted something like that to be possible. I couldn&#x27;t figure out how to make a language modify a tree structure for tweaking the ast of the interpreter, but I guess lisp fits the bill there.
评论 #43461981 未加载
评论 #43462175 未加载
timonoko2 months ago
Mind blown when you write better language using the language itself. Why I wasted so much time in assembly? Then you remember there are certain restrictions as regards to time travel.
shadowgovtabout 2 months ago
Interesting!<p>Racket has the capacity to declare DSLs that are then applied at the file level, but this is even finer-grained.
lifthrasiirabout 2 months ago
I think CosmicOS had the same idea [1] to seamlessly introduce special forms without defining the implicit interpreter in advance.<p>[1] <a href="https:&#x2F;&#x2F;cosmicos.github.io&#x2F;message.html#section18" rel="nofollow">https:&#x2F;&#x2F;cosmicos.github.io&#x2F;message.html#section18</a>
评论 #43459884 未加载
behnamohabout 2 months ago
so it&#x27;s hot code reloading on steroids? really neat idea, I&#x27;m working on a similar Lisp-style language and will probably adopt this idea (and cite you of course). In my language, you can redefine any symbol, even numbers, so (def 10 12) is valid code (so is (def def 42), which breaks `def`!).<p>I wonder what use cases there are for such extreme flexibility, aside from funs and games!
评论 #43468770 未加载
评论 #43461423 未加载
评论 #43465935 未加载
JoelMcCrackenabout 2 months ago
reminds me a little bit of the Kernel programming language
评论 #43464205 未加载