[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Gexp news
From: |
Ludovic Courtès |
Subject: |
Gexp news |
Date: |
Thu, 13 Jul 2017 00:40:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Gexp news,
Ludovic Courtès <=