[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] Eval sets incorrect runtime metainformation
From: |
Rob Browning |
Subject: |
Re: [BUG] Eval sets incorrect runtime metainformation |
Date: |
Sat, 06 Jul 2024 11:42:49 -0500 |
Philip McGrath <philip@philipmcgrath.com> writes:
> I hadn't realized that other languages in Guile might compile to Tree-IL
> directly instead of generating syntax objects. Is that common and/or
> encouraged? It seems like it would require the new language's compiler
> to do a lot of work that could otherwise be delegated to Guile, and it
> would make it difficult to implement parts of the new language using macros.
For what it's worth, Lokke (a Clojure dialect) does both. For the most
part it compiles by producing Scheme code from its reader that's then
rewritten by macros. But it also includes a pass or two at the Tree-IL
level to handle some things that would be difficult to get right
otherwise (while also preserving the fairly tight integration with
Scheme that's intended).
For example, they handle adding support for "keywords as functions" (in
a generalized way), and resolving Clojure's namespaced symbols to Guile
module refs.
For anyone interested in the current arrangement (the README also covers
a bunch of limitations, differences, etc.):
https://codeberg.org/lokke/lokke/src/branch/main/DESIGN.md
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4