-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
identifier-binding-symbol: contract violation
after raco demod
#1420
Comments
I think this is a |
I forgot to post Racket versions: 8.15 (latest main release, not a snapshot or self-compiled), and presumably a relatively up-to-date TR package (I haven't run I also know there have been repairs to demod in the snapshot versions, so if I get time to rebuild the latest Racket I'll try to reproduce on latest. |
A similar but naïve Typed Racket program is slower, though it can't be demodded at the moment [1] so make the exe without running demod: #lang typed/racket (define length #e1e4) (define inner-loop (* 10 length)) (define u (cast (string->number (vector-ref (current-command-line-arguments) 0)) Natural)) (define r (random (add1 length) (make-pseudo-random-generator))) (: a (Vectorof Natural)) (define a (make-vector length)) (for ([i (in-range 0 length)]) (for ([j : Natural (in-range 0 inner-loop)]) (vector-set! a i (+ (vector-ref a i) (remainder j u)))) (vector-set! a i (+ (vector-ref a i) r))) (displayln (vector-ref a r)) With just 3 runs in hyperfine: ./racket/code 43 ran 1.69 ± 0.03 times faster than ./racket/typed-code 43 [1]: racket/typed-racket#1420
A similar but naïve Typed Racket program is slower, though it can't be demodded at the moment [1] so make the exe without running demod: #lang typed/racket (define length #e1e4) (define inner-loop (* 10 length)) (define u (cast (string->number (vector-ref (current-command-line-arguments) 0)) Natural)) (define r (random (add1 length) (make-pseudo-random-generator))) (: a (Vectorof Natural)) (define a (make-vector length)) (for ([i (in-range 0 length)]) (for ([j : Natural (in-range 0 inner-loop)]) (vector-set! a i (+ (vector-ref a i) (remainder j u)))) (vector-set! a i (+ (vector-ref a i) r))) (displayln (vector-ref a r)) With just 3 runs in hyperfine: ./racket/code 43 ran 1.69 ± 0.03 times faster than ./racket/typed-code 43 [1]: racket/typed-racket#1420
A similar but naïve Typed Racket program is slower, though it can't be demodded at the moment [1] so make the exe without running demod: #lang typed/racket (define length #e1e4) (define inner-loop (* 10 length)) (define u (cast (string->number (vector-ref (current-command-line-arguments) 0)) Natural)) (define r (random (add1 length) (make-pseudo-random-generator))) (: a (Vectorof Natural)) (define a (make-vector length)) (for ([i (in-range 0 length)]) (for ([j : Natural (in-range 0 inner-loop)]) (vector-set! a i (+ (vector-ref a i) (remainder j u)))) (vector-set! a i (+ (vector-ref a i) r))) (displayln (vector-ref a r)) With just 3 runs in hyperfine: ./racket/code 43 ran 1.69 ± 0.03 times faster than ./racket/typed-code 43 [1]: racket/typed-racket#1420
I'm not 100% sure this is a TR bug, but here's the program:
The compiler steps:
And the output:
Making an exe the normal way (
raco exe -o racket/typed-code{,.rkt}
) and running as above works just fine. However, the exe is 69MiB instead of 47MiB.System specs, in case they end up relevant:
I uploaded a hexdump of the
.zo
file created fromxxd
, if that helps.The text was updated successfully, but these errors were encountered: