Re: [racket-users] IO in racket is painful

2017-07-20 Thread Sorawee Porncharoenwase
Sorry for reviving an old thread. As someone who did a lot of programming competition in the past, I can totally see why IO in Racket is difficult. As mark.engelberg said, the goal is to solve as many problems as possible. After the competition is over, it's over. No one is going to care about

Re: [racket-users] Understanding compilation costs and creating persistent values

2017-07-20 Thread David Storrs
On Thu, Jul 20, 2017 at 2:56 PM, Matthew Flatt wrote: > Adding to other replies: > > At Thu, 20 Jul 2017 13:32:49 -0400, David Storrs wrote: > > Will any of the above items be compiled away? > > You can compile a module with `raco make` and look at the compiled code > with `raco decompile`. If I

Re: [racket-users] Racket7 Conceit

2017-07-20 Thread Lehi Toskin
Yes, my first question was definitely answered already. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more optio

Re: [racket-users] Understanding compilation costs and creating persistent values

2017-07-20 Thread Matthew Flatt
Adding to other replies: At Thu, 20 Jul 2017 13:32:49 -0400, David Storrs wrote: > Will any of the above items be compiled away? You can compile a module with `raco make` and look at the compiled code with `raco decompile`. If I put your code in a module and try that, the output includes (de

Re: [racket-users] Understanding compilation costs and creating persistent values

2017-07-20 Thread Neil Van Dyke
David Storrs wrote on 07/20/2017 01:32 PM: sub foo { state $x = 0; say $x++; } # $x is not visible in this scope foo(); foo(); foo(); (define foo (let ((x 0)) (lambda () (printf "~s~n" x) (set! x (add1 x) ; x is not visible in this scope (foo) (foo) (foo) Doing this wi

Re: [racket-users] Understanding compilation costs and creating persistent values

2017-07-20 Thread Leif Andersen
> Will any of the above items be compiled away? To answer your first question, I would recommend taking a look at the optimization coach. It can help you figure out what code was inlined away and what wasn't. You can find it in: View -> Show Optimization coach > How many times will each thing be

[racket-users] Understanding compilation costs and creating persistent values

2017-07-20 Thread David Storrs
Given this code: (define (foo) (define num (+ 1 1)); result of a function that is program-local (define size (file-size "/some/path")) ; result of a function that touches the disk, but result never used (define other-size (file