@pocmatos what’s the easiest way to replicate the bug in #2018?
Unfortunately there’s no easy way unless you have hardware access. Do you have access to any non intel hardware?
Alternatively you can setup a qemu environment. I can help with that.
For that you’d probably need access to linux or linux through docker.
@samth ^^^
It’s almost dinner time around here so I will soon have to go feed the children but when I come back we get repro this together.
linux is not a problem :slightly_smiling_face:
I don’t have any non-intel hardware
Also the correct response text is “OK” not “Okay” and I am willing to die on that hill. :smile:
So I like that part.
Does anyone know why this program actually works?:
#lang racket
(module* editor racket
(require syntax/location)
(define this-ns (current-namespace))
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(namespace-attach-module-declaration this-ns (quote-module-path ".." foo))
(namespace-require/expansion-time (quote-module-path ".." foo))
(eval 'y)))
(module* foo racket
(define y (let () 8))
(provide y))
Especially since this one doesn’t (which is what I would have expected):
#lang racket
(module* editor racket
(require syntax/location)
(define this-ns (current-namespace))
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(namespace-attach-module-declaration this-ns (quote-module-path ".." foo))
(namespace-require/expansion-time (quote-module-path ".." foo))
(eval 'y)))
(module* foo racket
(define y (let () (writeln "running") 8))
(provide y))
The difference being the second to last line (define y (let () 8)
vs (let () (writeln "running") 8)
.
About the only thing I was able to come up with was that it was the result of a compiler optimization?
If so have you tried on both normal Racket and on Racket-on-Chez?
Also what expression do I use to see the problem?
@soegaard2 I don’t currently have a racket-on-chez build running on my system. But I have tried it with older versions of racket to the sameresults.
Umm…in the repl you could run: (require (submod "<filename.rkt>" editor))
Which should run the editor submodule.
Does it help if you give eval
an explicit namespace?
Hmm - the evaluated expression is just a reference. How can that go wrong?!?
Does (namespace-require/expansion-time (quote-module-path ".." foo))
mean you are only attaching the module at phase 1 -
and the evaluation takes place at phase 0?
@soegaard2 So, if you don’t give eval
a namespace, it defaults to current-namespace
, which I set explicitly to a new base namespace.
Also yes, namespace-require/expansion-time
only visits the module, not instantiate it. (I might have that backwards…but yes, it only runs the phase 1 stuffs.)
Now I get why you are surprised the first program works.
Ya, basically. I suspect @mflatt might know something.
If you have a racket-on-chez build on your current system, wanna see what it does?
Haven’t yet - but this is a nice excuse to install it.
Oh. You can install it these days without compiling it yourself?
That’s pretty cool.
I mean, its certainly ‘related’ to compiler optimizations. (Given that (let () 8)
can be easily compiled to just 8
…(at least in this context), but the real question is why are constants run…
(define y (begin 1 2))
works fine
Yup. Because that get’s compiled to (define-values (x) 2)
(Which you can test by using raco decompile
Basically:
(module simp racket
(#%plain-module-begin
(define x (begin 1 2))))
$ raco make simp.rkt && raco decompile simp.rkt
(module simp ....
(require (lib "racket/main.rkt"))
(provide)
(define-values (x) '2)
(void))
I think http/2 doesn’t even send the status message