* Gexp news
@ 2017-07-12 22:40 Ludovic Courtès
0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2017-07-12 22:40 UTC (permalink / raw)
To: guix-devel
Hello Guix!
Last week I fiddled with gexps:
• I rebased ‘wip-build-systems-gexp’ on ‘core-updates’ and
improved/optimized a bunch of things. It’s now close to ‘master’
performance-wise, which was the main blocker for this branch.
Hopefully I’ll look into it again next week or so.
There’s more work to do, such as adapting some of the newer build
systems, but the goal is to make it our next ‘core-updates’.
• The ‘wip-gexp-hygiene’ branch makes gexps “hygienic”—i.e., gexps
cannot capture lexically-bound identifiers introduced by other
gexps, as in:
(let* ((inner (lambda (x)
#~(let ((x 40)) (+ x #$x))))
(outer #~(let ((x 2))
#$(inner #~x))))
(primitive-eval (gexp->sexp* outer)))
This returns 42 because the ‘x’ in ‘inner’ does not shadow the ‘x’
in ‘outer’ (and neither shadows the ‘x’ that is the formal parameter
of ‘inner’.) In current ‘master’ it returns 80.
It does so through a custom alpha-renaming phase inspired by
Kiselyov’s MetaScheme¹, similar to but much simpler than what the
macro expander does. That needs a bit more testing, but I think we
can make probably try and add it on top of the above branch.
Feedback welcome!
Ludo’.
¹ http://okmij.org/ftp/meta-programming/#meta-scheme
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-12 22:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12 22:40 Gexp news Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).