jeapostrophe
2017-9-5 15:40:46

joelmccracken: it doesn’t matter


joelmccracken
2017-9-5 15:40:56

thanks sir


jeapostrophe
2017-9-5 15:41:33

The only way it matters is if you expect the argument to embed/url to return


jeapostrophe
2017-9-5 15:41:43

because they all return to the same s/s/d


joelmccracken
2017-9-5 15:48:28

ah; didn’t realize that was possible! I don’t really understand what that would do, lol



joelmccracken
2017-9-5 15:57:01

oh wow, that’s nuts. thanks. I might use this feature


pavpanchekha
2017-9-5 18:34:51

I have a weird bug in a large program due to subprocess I/O that affects Racket 6.10 only


pavpanchekha
2017-9-5 18:34:59

I understand there was a big rewrite for that version.


pavpanchekha
2017-9-5 18:35:12

Can anyone here help diagnose and work around it?


pavpanchekha
2017-9-5 18:35:30

I’ve gone about as deep as I think I can without entering the Racket internals.


royall
2017-9-5 19:55:10

can you isolate the problem into a short section of code and post that?


pavpanchekha
2017-9-5 20:23:15

Unfortunately, I haven’t, and in fact the bug is quite finicky


pavpanchekha
2017-9-5 20:23:43

It seems to depend, for example, on weird timing choices.


pavpanchekha
2017-9-5 20:24:54

This bug, from a friend, seems related: https://github.com/racket/racket/issues/1769


pavpanchekha
2017-9-5 20:25:11

It also has to do with juggling multiple Z3 processes and killing some of them.


lexi.lambda
2017-9-5 20:33:05

@pavpanchekha Can you reproduce the bug on a nightly snapshot? https://plt.eecs.northwestern.edu/snapshots/


pavpanchekha
2017-9-5 20:40:51

@lexi.lambda Working on it


pavpanchekha
2017-9-5 20:42:17

The bug does not occur on nightlies


pavpanchekha
2017-9-5 20:49:38

So looks like it will be fixed when the next version of Racket 6.10 comes out. Thanks all!


stamourv
2017-9-5 21:06:56

@pavpanchekha: There are no planned updates for 6.10. The fix will most likely be in 6.11, which is scheduled for late October.


pavpanchekha
2017-9-5 21:55:35

Ok, great!


cfinegan
2017-9-5 23:41:48

For defining contracts on functions, is it generally preferred to use contract-out over define/contract? It seems like contract-out is more popular, and I’m curious what the reasoning is for this. If you already know the domain and range of a function, is there any benefit to pushing the contract definition out to the module boundary?


royall
2017-9-5 23:56:32

Having the contract right there in the function definition seems more readable, doesn’t it?


cfinegan
2017-9-5 23:57:45

it does, which is why I ask :slightly_smiling_face:


dan
2017-9-6 00:16:00

Contracts can have a non-trivial performance overhead that you may not want to incur wherever a function is used within a module, whereas it’s more likely to want to protect a function from invalid inputs that come from other modules


joelmccracken
2017-9-6 00:32:53

I’m using define/contract right now to debug something. I might remove them, or convert them to module level contracts when I’m done


notjack
2017-9-6 00:46:24

contract-out turns the function exported into a macro that can pick up information about the module it’s used in, so contract errors tell you both which module the contract is from (the module that used contract-out) and the module that misused the function.


notjack
2017-9-6 00:47:54

also, when using contract-out, you can skim the first few lines of a module to get a sense of what functions it exports and what they do instead of having to dig through the entire module looking for contracts and function signatures


notjack
2017-9-6 00:48:40

philosophically speaking, a module is a single “unit of trust” so it doesn’t make sense for it to guard against inputs from itself (as define/contract would)


joelmccracken
2017-9-6 01:06:46

(unless, of course, you have buggy code to fix, or maybe i just am a poor racketeer)


notjack
2017-9-6 01:08:05

that’s a valid point. I think the counter argument is that contracts are not meant for debugging :)


cfinegan
2017-9-6 01:09:36

Thanks, that’s a lot of good info! And yeah, I’m basically building something from scratch and want to make sure I get good error message when I accidentally violate my assumptions as the code evolves over time. But it sounds like you actually get better error reporting when you do it at the module level, so I’m inclined to stick with that.


notjack
2017-9-6 01:10:50

oh have you seen the debug package? it’s a really, really good debugging tool to be aware of


joelmccracken
2017-9-6 01:10:56

yeah i’m not sure how to debug this web server stuff,


joelmccracken
2017-9-6 01:11:14

i feel like youre about to be my hero after I look it up


cfinegan
2017-9-6 01:11:24

I haven’t seen it, I’ll look into it. Thanks!


notjack
2017-9-6 01:12:04

not the one from the mischief package, which should probably be considered deprecated


notjack
2017-9-6 01:12:29

joelmccracken
2017-9-6 01:13:02

nice.


joelmccracken
2017-9-6 01:14:04

does racket have the ability to specify/lock versions of packages? you used to be able to include the planet specs directly in a file


notjack
2017-9-6 01:14:31

nope, packages also can’t declare that they depend only on a specific range of versions of another package


notjack
2017-9-6 01:14:53

this is an area that needs more work..


notjack
2017-9-6 01:15:09

you also can’t install different versions of the same package


joelmccracken
2017-9-6 01:16:45

interesting


notjack
2017-9-6 01:17:01

that’s one word for it


joelmccracken
2017-9-6 01:17:02

(that it was removed, since it used to work)


notjack
2017-9-6 01:17:26

planet let you do it but you had to specify the version in source code of every module that used the dependency


joelmccracken
2017-9-6 01:17:27

(maybe i’m misremembering though)