@robby is there a tour de force on contracts, maybe explaining where they started up and where we are today and what is still to do research-wise, maybe with some connections to Racket? Maybe an internal/technical report or something of the sort that you can share.
Nothing comes to mind sorry
Thanks.
@pocmatos I would say that @robby’s ICFP 2014 keynote would be the best thing
@samth icfp14 doesn’t seem to be online. do you have a link to the keynote?
got it
lol
thanks!
I’m not sure it is what you’re looking for, tho …..
Thanks anyhow. Will take a look. :slightly_smiling_face:
Perhaps I miss something really simple. How can I transform an expanded code?
Right now I have something like:
(define-for-syntax (my-expand stx)
(define expanded (local-expand stx 'expression '()))
(syntax-parse expanded
#:datum-literals (#%app)
[(#%app x y)
expanded]))This works, but if I change expanded to #'x, I start to get cannot use identifier tainted by macro transformation
Which #%app is expanding? Racket’s #%app or one that you’re defining?
If it’s one that you’re defining, does the my-expand code work if you use it only with Racket’s #%app?
Racket’s app
(define-syntax ex
(lambda (stx)
(syntax-parse stx
[(_ e) (my-expand #'e)])))
(ex (add1 5))?
Ohh interesting.
Where the #%app inserted before add1 is Racket’s #%app and not a custom one
Yeah, probably not racket’s app
Right, so if I change:
(provide (rename-out [module-begin #%module-begin])
build
(except-out (all-from-out rosette) #%module-begin))to
(provide (rename-out [module-begin #%module-begin])
build
(except-out (all-from-out racket) #%module-begin))(that is, change rosette to racket), then disassembling the expanded syntax works.
But since I need to use rosette, how could I make this work?
Also, I thought that local-expand is supposed to turn rosette’s #%app to Racket’s #%app. Isn’t that the case?
@pocmatos Have you checked out this? https://andykeep.com/pubs/dissertation.pdf
@soegaard2 I’ve read it because I tried to understand the insides of Chez too, but it does not document many important parts of it. Some stuff you can find in some of Dybvig’s papers, though scattered and incomplete information
@sorawee Rosette’s #%app uses syntax-protect on its output, and that makes this harder. Maybe syntax-disarm somewhere will help?
Yup, I think I have a solution now
Agree.
nanopass itself is great though
A Scheme compiler written with Nanopass - including some comments:
Anyone knows about readscheme / Jim Bender?
the domain expired?
I would be happy to chip in - to get the web site back up.
I think someone in the freenode #scheme IRC channel tried to contact him
Even hosting the references on Github would be great.
Thanks. Hadn’t seen that before.
@alexknauth thanks, it works now. I was aware of syntax-disarm but it doesn’t seem to fix the issue. It turns out that is indeed the issue, but I need to disarm at every level. E.g. in [(_ foo (bar)) ...], I can disarm foo straightforwardly, but for bar, I need to disarm (bar) first and then disarm the actual bar.