[racket-dev] make --clone installed pkgs
Sam and I have run into a situation where `make` fails because we've set up clone pkgs and made local modifications in a way that makes the git commands fail [*]. My guess is that the right thing to do is for me to know about these pkgs and do something special when running make. I'm thinking that I could let make finish the initial steps until it gets to the step where it updates the pkgs and then do the update step myself and then run `make as-is`. But the problem with this is that I don't see what command I can run that will update all of the pkgs except the problematic ones. Like I could imagine a `raco pkg update --all-except-clones` or something, but that feels a bit strange as there could be other development modes that would also run into similar problems. Maybe `raco pkg update --all-things-from-this-catalog the-catalog-I-currently-get-main-distribution-from` or something along those lines is the way to go? In general, it seems right for me to run some commands whose complications are roughly proportional to the number of pkgs that I have installed as clones (and where I'm actively developing them) but not to run some commands that require me to do something special for each pkg that is installed. Any ideas? Or am I just missing the right command? Thanks, Robby [*] In my case, in case this suggests a better/different approach to a resolution: the `raco pkg update` step eventually gets to this git command: git merge --ff-only sha1 where the sha1 is the checksum from the pkg server, I believe. In my case, this is a different branch than is currently checked in my clone'd pkg and so the git merge command fails (and that command failing seems like the right behavior for the setup I'd like to be able to use). -- You received this message because you are subscribed to the Google Groups Racket Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+unsubscr...@googlegroups.com. To post to this group, send email to racket-...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/CAL3TdONOjL3_y8U_A1ZUoz_1Z%3DE3HjVV8by9e%2B2dS-W2mc51pg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-dev] What is the policy on what is included in the core libraries?
I don't think the libraries are sufficient as is, but I would resist adding aliases. Perhaps a better way to get people coming from Haskell would be to write an essay specifically aimed there? - Step 1: use variables. - Step 2: here are `for` loops! ;) Robby On Tue, Feb 17, 2015 at 1:18 AM, Alexis King lexi.lam...@gmail.com wrote: I was just thinking today that I would, for example, find it useful to have a (zip ...) function in racket/list that would be equivalent to (map list ...). Users coming from a Haskell background might even find it useful to have a zip-with function that is simply an alias for map. Admittedly, these are rather trivial, but (especially in the first case) I think they’d still be useful. I am all for avoiding feature creep and code bloat, but Racket’s “batteries included” approach seems to make functions like these prime candidates for libraries like racket/list. As long as they’re not in racket/base, they seem fairly harmless, especially considering they would only be needed at compile-time. Should I even consider adding things like this, or is the consensus that the libraries are mostly sufficient as-is? -- You received this message because you are subscribed to the Google Groups Racket Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+unsubscr...@googlegroups.com. To post to this group, send email to racket-...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/5D941DB1-8A55-4A41-98A2-A3BE1BFE6D40%40gmail.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+unsubscr...@googlegroups.com. To post to this group, send email to racket-...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/CAL3TdONpdpZX%3D63ZtmPxTytPfw_PrL6gR6dwQXcbnS5_cB2OcQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-dev] What is the policy on what is included in the core libraries?
Yes, that's true. Robby On Tue, Feb 17, 2015 at 10:50 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Tue, Feb 17, 2015 at 11:31 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: 2015-02-17 14:26 GMT+01:00 Robby Findler ro...@eecs.northwestern.edu: I don't think the libraries are sufficient as is, but I would resist adding aliases. A alternative: Added the word zip to the documentation index, link it to map and have an example where in (map list ...) is used. Since `zip` isn't an alias for anything, I think we should add it. Sam -- You received this message because you are subscribed to the Google Groups Racket Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+unsubscr...@googlegroups.com. To post to this group, send email to racket-...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/CAL3TdONe3-xhiVrpQ%3D8ZGc9AjYr9NBoxCj5JDVDdr0trckKPpw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-dev] feature request: thread-safe memoize-evt
Is the issue that the E_b from Jan's original message might produce multiple values and you are supposed to take the value that's available only after something syncs on the E_m? That is, I thought you could just create a separate thread that sync's on E_b and then whenever you get a value from it, then the E_m would just continue to produce that all the time. But I think you're saying that wouldn't work? I guess I'm not getting it. Thanks for more explanation. Robby On Thu, Jan 29, 2015 at 1:55 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Hi Jan, Interesting problem! I think I see what you mean: There's no way to combine the completion of an event plus saving its value as an atomic operation, except by putting the synchronization in its own thread. But if you put the synchronization in its own thread, then there's no way to prevent that thread's synchronization when a consumer synchronization (i.e., one that is waiting for the thread's result) picks a different event than the one represented by the thread. It's easy to make a complete+save combination atomic if it's built into the scheduler. So, I can easily imagine adding a simpler primitive, `once-evt`. The event OE created by `(once-evt E)` could save the first result produced by E, but not attempt to have only a single wait on E. That is, if OE1 is synchronized in multiple threads, then it would be like synchronizing E in multiple threads, but only the first result from E will be saved. Unfortunately, `once-evt` isn't enough to implement `memoize-evt`. The troublesome case is then thread T1 is synchronizing on OE1, T1 gets suspended, and T2 starts waiting on OE1. In that case, you'd like T2 to take over the wait, even if it means restarting E. You can detect that T1 is suspended and have T2 start waiting on E, but there's no way to cancel the wait of E in T1. Building `memoize-evt` into the core doesn't the avoid the need to, at some level, cancel T1's wait on E. I'll keep thinking about it, but it looks like that would require deep changes to the scheduler. Would the simpler `once-evt` work in your situation, or do you need the guarantee that only one wait of E happens at a time? Matthew At Wed, 28 Jan 2015 13:49:51 +0100, Jan Dvořák wrote: Hi, I would like to ask for another extension of the Racket's event handling system. A `memoize-evt` constructor with following semantics: Given a base event E_b, memoize-evt will produce a memoizing event E_m. Synchronizing on E_m from any number of threads will block until a single value is produced by E_b. This value is then stored inside the E_m. From that moment on, E_m will always be immediately ready for synchronization and produce the stored value in all waiting threads. The single-threaded implementation is a trivial guard-evt + replace-evt + (wrap-evt always-evt) combo, but for thread-safety a temporary thread would be needed to wait for the base event and the solution would have different semantics then rest of the event system. A lower-level approach would also be possible; create something along the lines of a dynamic-wind-evt that would, with some cleverness, allow for generic thread-safe events via locking. Or create a locked-wrap-evt constructor that will not be ready until it's handler finishes. Hoping that I am not being too bothersome, from Prague with thanks, Jan Dvorak _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [racket] Implementing contracts for async channels
Oh, sorry I missed that. Robby On Mon, Jan 19, 2015 at 6:40 PM, Alexis King lexi.lam...@gmail.com wrote: I already used blame-add-context, but the message I used wasn’t very good, so I’ve improved it. If everything else looks good, feel free to merge this whenever you get the chance! On Jan 19, 2015, at 15:52, Robby Findler ro...@eecs.northwestern.edu wrote: Ah: one other note. When you do something like this: ((contract (- (list/c (box/c integer?)) any) (λ (x) (unbox (car x))) 'pos 'neg) (list (box not an integer))) you get an error message that has this text in the middle: in: the content of the 1st element of the 1st argument of (- (list/c (box/c integer?)) any) This path information is collected in the blame records. So, instead of passing along just the blame record you got, call blame-add-context so you get some stuff in that portion of the error message. Maybe a value passed on or something like that would be a good phrase? I usually look at a few examples to pick something. Otherwise, this looks good to merge to me (but I don't use the generics as much as I should so if you wanted to you could try asking for someone specifically knowledgeable to look there). If you don't, I can push the commit to the appropriate repo. Let me know. Robby On Mon, Jan 19, 2015 at 5:44 PM, Alexis King lexi.lam...@gmail.com wrote: Yes, there are tests, and you can see them here. On Jan 19, 2015, at 13:29, Robby Findler ro...@eecs.northwestern.edu wrote: This seemed okay, but just a quick read of the code. But did I miss the test cases? (I just followed the link upthread -- sorry if I need to look somewhere else too.) Robby On Mon, Jan 19, 2015 at 3:15 PM, Alexis King lexi.lam...@gmail.com wrote: Any update on this? If there’s anything that still needs to be changed, let me know—otherwise, I’ll patiently wait for the process to run its course. Just checking in. On Jan 16, 2015, at 10:15, Alexis King lexi.lam...@gmail.com wrote: Ah, that makes sense, fixed. On Jan 16, 2015, at 05:37, Robby Findler ro...@eecs.northwestern.edu wrote: One comment. The contract combinators are curried so that you can do work on the partial applications. So don't write this: (define ho-val-first-projection impersonate/chaperone-async-channel) ctc) blame) val) instead try to do some work earlier, when you first can. (The most important thing is to minimize the work done after you get the 'val' argument.) Robby _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [racket] Implementing contracts for async channels
This seemed okay, but just a quick read of the code. But did I miss the test cases? (I just followed the link upthread -- sorry if I need to look somewhere else too.) Robby On Mon, Jan 19, 2015 at 3:15 PM, Alexis King lexi.lam...@gmail.com wrote: Any update on this? If there’s anything that still needs to be changed, let me know—otherwise, I’ll patiently wait for the process to run its course. Just checking in. On Jan 16, 2015, at 10:15, Alexis King lexi.lam...@gmail.com wrote: Ah, that makes sense, fixed. On Jan 16, 2015, at 05:37, Robby Findler ro...@eecs.northwestern.edu wrote: One comment. The contract combinators are curried so that you can do work on the partial applications. So don't write this: (define ho-val-first-projection impersonate/chaperone-async-channel) ctc) blame) val) instead try to do some work earlier, when you first can. (The most important thing is to minimize the work done after you get the 'val' argument.) Robby _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Announcing Soft Contract Verification tool
FWIW, (/c 0) already implies real?. Robby On Thu, Jan 15, 2015 at 10:30 AM, David Van Horn dvanh...@cs.umd.edu wrote: On 1/15/15, 11:27 AM, Matthias Felleisen wrote: Argh, I wanted the other way (negative). I always get the directions confused. Sorry. Right -- using (and/c real? (/c 0)) will also make this verify. Thanks for trying it out! David On Jan 15, 2015, at 11:26 AM, David Van Horn dvanh...@cs.umd.edu wrote: On 1/15/15, 11:17 AM, Matthias Felleisen wrote: On Jan 15, 2015, at 11:13 AM, David Van Horn dvanh...@cs.umd.edu wrote: On 1/15/15, 11:04 AM, Matthias Felleisen wrote: Well that got me all excited. So I tried to get the sample module to pass the verification step -- until I realized how restricted the grammar is! (module f racket (provide (contract-out [f (real? . - . integer?)])) (define (f n) (/ 1 (- 100 n I would love to be able to use at least (and/c real? (/c 0)) for the domain so I can get the example done. Or am I overlooking a way to make this work here? The /c contract is there, but missing from the grammar (we'll fix that). But (/c 0) will not make this program verify. You want this contract: ((and/c real? (lambda (x) (not (= x 100 . - . real?) Using this contract, the program verifies. My contract is stronger than yours. So why will it not go through? 100 is (/c 0) but (f 100) divides by zero. David _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Announcing Soft Contract Verification tool
I think this is saying that the result is going to be negative. (But it won't, since it doesn't terminate.) Robby On Thu, Jan 15, 2015 at 1:13 PM, Asumu Takikawa as...@ccs.neu.edu wrote: On 2015-01-14 19:11:59 -0500, David Van Horn wrote: If you have questions, comments, bugs, or any other feedback, let us know, or just file bug reports on the GitHub source code. Nice tool! I like the web interface too. I was confused by this interaction though. Clicking verify on this: (module fact racket (define (factorial x) (if (zero? x) 1 (* x (factorial (sub1 x) (provide (contract-out [factorial (- (=/c 0) (=/c 0))]))) gives me: Contract violation: 'fact' violates '='. Value 0.105 violates predicate real? An example module that breaks it: (module user racket (require (submod .. fact)) (factorial 0.105)) (Verification takes 0.05s) but the value 0.105 shouldn't violate the predicate real? I think. Cheers, Asumu _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Announcing Soft Contract Verification tool
Can you randomly make up programs from your grammar, get example errors from the tool, and then run those programs to see if you find bugs in the analysis like that one? That said, I don't see how the bug in =/c is coming in here. Can you explain more? Robby On Thu, Jan 15, 2015 at 1:42 PM, David Van Horn dvanh...@cs.umd.edu wrote: On 1/15/15, 2:13 PM, Asumu Takikawa wrote: On 2015-01-14 19:11:59 -0500, David Van Horn wrote: If you have questions, comments, bugs, or any other feedback, let us know, or just file bug reports on the GitHub source code. Nice tool! I like the web interface too. I was confused by this interaction though. Clicking verify on this: (module fact racket (define (factorial x) (if (zero? x) 1 (* x (factorial (sub1 x) (provide (contract-out [factorial (- (=/c 0) (=/c 0))]))) gives me: Contract violation: 'fact' violates '='. Value 0.105 violates predicate real? An example module that breaks it: (module user racket (require (submod .. fact)) (factorial 0.105)) (Verification takes 0.05s) but the value 0.105 shouldn't violate the predicate real? I think. This is reporting that the fact module can break the contract on = when it uses =/c; that's a bug in our modelling of =/c, which we currently have as: (define (=/c n) (lambda (m) (= m n))) But should be: (define (=/c n) (lambda (m) (and (real? m) (= m n That said, if you change it to (and/c real? (=/c 0)), it says there's a counterexample of 2.0, but that's because we check contracts on recursive calls (and should not). Thanks! David _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Implementing contracts for async channels
I think they should probably all be exported from racket/async-channel. Unless there is some reason to modify the internals of racket/contract to support them? Robby On Thu, Jan 15, 2015 at 4:50 PM, Alexis King lexi.lam...@gmail.com wrote: Sorry, I wasn’t clear. The chaperone/impersonate-async-channel functions are exported from racket/async-channel. The async-channel contracts, however, are exported from racket/contract. On Jan 15, 2015, at 14:41, Robby Findler ro...@eecs.northwestern.edu wrote: Just a small nit: why export that function from racket/contract and not an async-channel library? Robby On Thu, Jan 15, 2015 at 3:33 PM, Alexis King lexi.lam...@gmail.com wrote: As an update, I’ve made a bit more progress on this. I’ve implemented an impersonate-async-channel function, and I’ve actually included this in the exports from racket/contract. I also realized the blame information is correct, it works fine. Most of the other issues remain, as well as a few new questions: There is no impersonate-evt function, so I’m not sure that my implementation will work. What should I do about this? I’d assume this needs to be documented/tested as well. Where should those things be located? On Jan 14, 2015, at 23:44, Alexis King lexi.lam...@gmail.com wrote: Currently, async channels do not have contracts to check their contents. This is a problem for Typed Racket, and it prevents typed code from interacting with code that produces async channels. I started looking into how to add contracts to the language, and it seems to use the chaperones/impersonator system, as I suspected. However, async channels obviously cannot be impersonated, so I needed to implement that as well. I modified the async-channel struct to use generics to allow it to be impersonated or chaperoned, which I have exposed by implementing chaperone-async-channel. I then tried implementing async-channel/c. The internals of the contract system are a little beyond me, but I got a working solution by following the example of the box contracts. My work thus far can be found here: https://github.com/lexi-lambda/racket/commit/84b9f3604891f3f2061fb28ed4800af8afa4751b First of all, is this a correct approach? Have I done anything wrong, or should I have done anything differently? I didn’t find much documentation on the internals of either of these systems, so I mostly went about things as I found them. Second, obviously, not everything is implemented here. Among the additional necessary changes are: I need to implement support for impersonators and impersonator contracts (right now I’ve only bothered to do chaperones). I need to implement async-channel/c-first-order and async-channel/c-stronger. I can probably figure out the latter, but I’m not even sure what the former is supposed to do. I need to implement a wrap-async-channel/c macro for the export. I’m not sure how this works, either. From looking at wrap-box/c, it seems to add some syntax properties, but I’m not sure what they do or how they work. Somehow, the blame information has to be correct. Is that what the wrap function does? Or do the async-channel functions need to be updated to assign blame? I’d really like to get this working, and I think I’m close, but I’m a little inexperienced. I’d appreciate any help, even if it’s just pointing me in the right direction. Thanks! _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Implementing contracts for async channels
Just a small nit: why export that function from racket/contract and not an async-channel library? Robby On Thu, Jan 15, 2015 at 3:33 PM, Alexis King lexi.lam...@gmail.com wrote: As an update, I’ve made a bit more progress on this. I’ve implemented an impersonate-async-channel function, and I’ve actually included this in the exports from racket/contract. I also realized the blame information is correct, it works fine. Most of the other issues remain, as well as a few new questions: There is no impersonate-evt function, so I’m not sure that my implementation will work. What should I do about this? I’d assume this needs to be documented/tested as well. Where should those things be located? On Jan 14, 2015, at 23:44, Alexis King lexi.lam...@gmail.com wrote: Currently, async channels do not have contracts to check their contents. This is a problem for Typed Racket, and it prevents typed code from interacting with code that produces async channels. I started looking into how to add contracts to the language, and it seems to use the chaperones/impersonator system, as I suspected. However, async channels obviously cannot be impersonated, so I needed to implement that as well. I modified the async-channel struct to use generics to allow it to be impersonated or chaperoned, which I have exposed by implementing chaperone-async-channel. I then tried implementing async-channel/c. The internals of the contract system are a little beyond me, but I got a working solution by following the example of the box contracts. My work thus far can be found here: https://github.com/lexi-lambda/racket/commit/84b9f3604891f3f2061fb28ed4800af8afa4751b First of all, is this a correct approach? Have I done anything wrong, or should I have done anything differently? I didn’t find much documentation on the internals of either of these systems, so I mostly went about things as I found them. Second, obviously, not everything is implemented here. Among the additional necessary changes are: I need to implement support for impersonators and impersonator contracts (right now I’ve only bothered to do chaperones). I need to implement async-channel/c-first-order and async-channel/c-stronger. I can probably figure out the latter, but I’m not even sure what the former is supposed to do. I need to implement a wrap-async-channel/c macro for the export. I’m not sure how this works, either. From looking at wrap-box/c, it seems to add some syntax properties, but I’m not sure what they do or how they work. Somehow, the blame information has to be correct. Is that what the wrap function does? Or do the async-channel functions need to be updated to assign blame? I’d really like to get this working, and I think I’m close, but I’m a little inexperienced. I’d appreciate any help, even if it’s just pointing me in the right direction. Thanks! _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] raco pkg update --clone and git URL config
FWIW, I have just been doing git remote set-url origin url from github error message and it has worked well and been easy. Robby On Tuesday, December 16, 2014, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: I think this is the case for everyone. I've used the `hub` [1] tool to address this. Once I have a checkout, if I need to push, I do: $ hub remote add -p racket/typed-racket and then $ git push racket Having an option to `raco pkg update` and `raco pkg install` to use the corresponding ssh URL for `--clone` would be nice, though, and I think it should be pretty easy to add. :) Sam On Tue, Dec 16, 2014 at 4:42 PM, Asumu Takikawa as...@ccs.neu.edu javascript:; wrote: Hi all, I've been trying to adjust to the new package-split workflow now and I've bumped into a small usability problem and I wanted to see if anyone else has encountered this or if my config is just broken somehow. On a fresh build of Racket, if I do the following: raco pkg update --clone typed-racket it will install TR from github and reinstall. An excerpt from the config for that git repo looks like this: [remote origin] url = git://github.com/racket/typed-racket/ The problem is that this URL is not as useful as it could be because github won't let you push to it (at least I can't seem to). The corresponding SSH URL g...@github.com:racket/typed-racket.git lets me push. Is this something other people have encountered or is there some git config that I should fix on my end? Cheers, Asumu _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Multiple 'raco make' processes
I think they can stomp on each other and you can get inconsistent results, theoretically. Robby On Tuesday, December 9, 2014, Dan Liebgold dan.liebg...@gmail.com wrote: If I have multiple instances of raco make running and some of the files they are checking/rebuilding are shared across the instances... what happens? Does raco make have lock to ensure no contention? Or does each process potentially redo some work? -- Dan Liebgold[dan.liebg...@gmail.com javascript:_e(%7B%7D,'cvml','dan.liebg...@gmail.com');] _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Multiple 'raco make' processes
I think even stranger things can happen because of race-conditions at the filesystem level (altho we could probably protect against that if we wanted). Robby On Tue, Dec 9, 2014 at 6:22 PM, Jay McCarthy jay.mccar...@gmail.com wrote: Specifically, you can get errors like Called export 72 and expected set-list but got list-set. Chaos! Jay On Tue, Dec 9, 2014 at 3:09 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Unfortunately, the bytecode compiler is not completely deterministic. Generating the same .zo file from the same source is likely to produce different bytes each time. The root causes are various counters and hash orders, and I hope to fix that eventually. For now, since the generated bytecode is different, there can be inconsistencies instead of just duplicated work. At Tue, 9 Dec 2014 11:54:16 -0800, Dan Liebgold wrote: If the multiple 'raco make's would produce the same results, then there should be no inconsistency, just duplicate work, right? And my use case is a bit different... I need to spawn the multiple 'raco makes', rather than have raco make spawn multiple racket instances (via the -j flag). Although this particular setup will bear some examination. On Tue, Dec 9, 2014 at 11:47 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Ah sorry: meant to add: did you try the -j flag? On Tuesday, December 9, 2014, Robby Findler ro...@eecs.northwestern.edu wrote: I think they can stomp on each other and you can get inconsistent results, theoretically. Robby On Tuesday, December 9, 2014, Dan Liebgold dan.liebg...@gmail.com wrote: If I have multiple instances of raco make running and some of the files they are checking/rebuilding are shared across the instances... what happens? Does raco make have lock to ensure no contention? Or does each process potentially redo some work? -- Dan Liebgold[dan.liebg...@gmail.com] -- Dan Liebgold[dan.liebg...@gmail.com] _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev -- Jay McCarthy http://jeapostrophe.github.io Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great. - DC 64:33 _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrDr the split repository
And just to confirm: we should be checking into our own failures in drdr and fixing the info files now, right? Robby On Fri, Dec 5, 2014 at 6:14 AM, Jay McCarthy jay.mccar...@gmail.com wrote: Since we split the repository, there have been significantly more errors on DrDr: http://drdr.racket-lang.org/ This is mainly because DrDr used to use a monolithic metadata file: https://github.com/plt/racket/blob/master/pkgs/plt-services/meta/props This meta-data file included things like Don't run this file and Give it a timeout of 5 minutes or This program fails randomly, so don't blame the committer. But we can't use this centralized metadata with the decentralized repository. Instead, Matthew changed raco test (which is how DrDr tests programs) to support all these options. They can be test on a per-directory or per-file basis. The documentation for this is here: http://docs.racket-lang.org/raco/test.html?q=raco%20test#%28part._test-config%29 Jay -- Jay McCarthy http://jeapostrophe.github.io Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great. - DC 64:33 _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] new package system collections and conflicts
I think there is perhaps a misunderstanding. The design of the pkg system is (partly) driven by the observations the core team has about what gives us special privilege and then working to lift those restrictions so we don't need to operate under that special privilege. And I'll note that this theme is one that has long been part of the design of Racket, going back at least as far as Matthew's MrEd as OS (aka 'the revenge of the son of the Lisp machine' paper). So: it isn't about you at all, really. I don't think anyone claims to know what you want or need. It's about putting ourselves on the same footing (in terms of access) as everyone else. We see this an important step in making more effective use of the community and driving Racket forward in a more distributed, global way. As far as charity goes, I generally think the world needs more of it, even if you don't, so I'm glad to see a little of balance being restored to this particular thread. Robby On Wed, Dec 3, 2014 at 10:32 AM, Neil Van Dyke n...@neilvandyke.org wrote: I don't think I need charity. I thought the vision for the new package system had already been explained adequately. I would be very interested to learn how the model is well-suited to third-party developers like me. But -- I mean this constructively -- I'd be happy if someone simply came out and said this model is great for core developers, we still have to figure out everyone else, and maybe the model isn't great for everyone else. The reason is that I've looked at the new package system seriously 5-6 times since it was announced, and I keep being told that the model is intended for non-core people like me, and that someone else knows my needs better than me. Open source reuse was an especial area of interest to me, the package system is very important, and I've given the benefit of the doubt 5-6 times now. (This has actually stalled most of my public Racket work, one way or another, for about 2 years.) I'm not harshing on Racket; just on how the new package system was sprung on non-core people, and the narrative. It doesn't look typical of Racket. Racket is usually in the position that it could say we have a better idea (on, e.g., module system sophistication, various syntax extension mechanisms and mixed languages support, various aspects of DrRacket, the related pedagogic projects, etc.), and usually that doesn't have to be said, because the superiority of Racket is immediately apparent. That's why I've been a Racketeer for 13 years and counting. Neil V. _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
I've pushed a fix for the mac os x problem using materialize-user-docs because it seems to me to reduce rather than enlarge the number of different configurations are users are in. It may not actually turn out to be the conservative change and we can always revisit it when we have more concrete data. Robby On Mon, Nov 24, 2014 at 3:05 AM, Eli Barzilay e...@barzilay.org wrote: On Sun, Nov 23, 2014 at 9:01 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Sat, 22 Nov 2014 14:16:32 -0500, Eli Barzilay wrote: Oh, *that*'s the other solution? That sounds pretty bad not only because it complicates file installation which is already very complex, but also because it's a significant weight. (For example, the current size I see is about 180M, multiply that for a department with a thousand users and you get unhappy admins.) Just the documentation index (main page, search page, etc.) would get generated in the user's space. It's on the order of 1 MB. Ah, that's much better. But like I said, there's a point in doing this abstraction anyway since it's needed for the linux `xdg-open' thing. I made a PR for that, it includes wrapping the mac thing, but that can be dropped. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
On Fri, Nov 21, 2014 at 12:34 AM, Eli Barzilay e...@barzilay.org wrote: On Thu, Nov 20, 2014 at 10:38 PM, Robby Findler ro...@eecs.northwestern.edu wrote: No, the browser isn't hiding the query part. Here are the content of two script files: $ cat a.scrpt open location file:///Applications/r/doc/search/index.html?q=xyz $ cat b.scrpt open location file:///Users/robby/Library/Racket/development/doc/search/index.html?q=xyz Running osascript a.scrpt doesn't work, but running osascript b.scrpt does work. And by work I mean that in both cases the corresponding webpage is visited in Safari, but in the first case, the q parameter disappears. Not that it matters, but did you try to see if it's the file permissions? Oh, they are! $ ls -@l /Users/robby/Library/Racket/development/doc/search/index.html -rw-r--r-- 1 robby staff 5386 Nov 19 14:00 /Users/robby/Library/Racket/development/doc/search/index.html $ ls -@l /Applications/r/doc/search/index.html -rw-r--r--@ 1 robby admin 4929 Nov 20 03:41 /Applications/r/doc/search/index.html com.apple.quarantine 67 And that was it!! If I run: $ xattr -d com.apple.quarantine /Applications/r/doc/search/index.html then osascript works again! Another thing: I googled osascript open url drops query and got a bunch of racket results, and dropping osascript make the results more sensible. So perhaps osascript is outdated? Some more searching makes it look like you can just run the open command directly, and that might make a difference. It's the same. ... I don't know the ramifications of just calling xattr from inside DrRacket to fix things up. It may be better to just create the file in the user's directory instead. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
No that doesn't work. You can see why if you follow the technical details in the thread (and get a Mac maybe). Matthew is adding something to the setup collection and drr will use it and we will be all set I expect. Sam doing some testing after that point will be useful tho. Robby On Friday, November 21, 2014, Eli Barzilay e...@barzilay.org wrote: On Fri, Nov 21, 2014 at 9:45 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu javascript:; wrote: We have labs of macs here at IU. [*sigh* at that kind of spending...] And this is why I said that it's not really relevant -- AFAICT, the fact that things are setup in a way that prevents passing queries and fragments means that you just have to deal with it rather than try to play games with the filesystem. Could we just write a file with the query embedded in it, and open that? That is exactly what that trampoline is: a page with just a immediate redirection to the search file with the query. (Unless you mean write a version of the search page with a specific query hard-wired into it, which is a bad idea for a reasons...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
On Fri, Nov 21, 2014 at 3:13 PM, Eli Barzilay e...@barzilay.org wrote: On Fri, Nov 21, 2014 at 3:16 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Oh, my apologies. I thought you meant something different. Yes, this works. Ah, in this case, the patch that I sent earlier should work fine. (I could do a pull request, but it should really be tested...) I don't have a good idea which is the better approach now. [Bear in mind that I don't really know what the issue with the file permissions is (looks more like some security attributes):] I think that playing with such attributes is a worse option -- it's something that I'm not sure would work in all settings (but see above), and if there is a way to make it work now, it might not be possible in the future. The trampoline approach is relatively robust and well behaved. There is a minor price of these temporary files, but they do get cleaned out (whenever `send-url/contents' is called), so it should settle on a small number that will not grow indefinitely[*], so this is not a problem. Also, on the it's already there side -- this trampoline approach is already there for the windows version, and it's needed for the `xdg-open' thing anyway, so abstracting it into a new (internal) function makes sense already, so in terms of additional code there's no cost for doing the mac version too. ([*] It might be a problem if, for example, your cat sits on the f1 key and the os doesn't take the focus away from drracket... It might be useful to change it from using a random temp file to a name based on a hash of the forwarded url, which will further minimize the number of files.) Oh, absolutely. The two candidates are the trampoline approach and the just move the documentation files over into the user space as if a package had been installed. I guess the latter is better because it means there will be more homogeneity in the sets of files and whatnot, such that these kinds of bugs will be less likely to be unnoticed by in house folk. That is, I never noticed this problem because my documentation is already in the user-specific place because I build from source. The other option will make our users operate more like how my drracket operates. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
Ah, thanks! I see that if it is trying to load the docs that are in /Applications then it runs the code below, which somehow magically drops the query argument by the time safari gets it. It's not because of the space, either; when I rename Racket v6.1.1.5 to just r, it also doesn't work. But if I change the path to one in my home directory (just like the one you write below), then I see it works. Puzzling. It's almost like there is special handling for /Applications instead of /Users. #lang racket (define url file:///Applications/Racket%20v6.1.1.5/doc/search/index.html?q=xyz) (define-values (stdout stdin pid stderr control) (apply values (process*/ports (open-output-nowhere) #f (current-error-port) (find-executable-path osascript #f) -e (format open location \~a\ url (close-output-port stdin) On Thu, Nov 20, 2014 at 4:02 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: Is it significant that on the non-working machine running 6.1.1.5 (perform-search xyz) returns file:///Applications/Racket%20v6.1.1.5/doc/search/index.html But my working instance running 6.1.1.5 (it is a day later build) running (perform-search XYX) returns file:///Users/spdegabrielle/Library/Racket/snapshot/doc/search/index.html?q=XYX Is anyone else getting the same behaviour? S. On Thu Nov 20 2014 at 12:13:51 AM Stephen De Gabrielle spdegabrie...@gmail.com wrote: This: file:///Applications/Racket%20v6.1.1.5/doc/search/index.html it just shows the search screen as usual - just without the search text. s. On Wed Nov 19 2014 at 11:58:01 PM Robby Findler ro...@eecs.northwestern.edu wrote: If you navigate to the file in the file: url, is it empty? Robby On Wed, Nov 19, 2014 at 5:52 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: I'm such a doofus I forgot to put it on the bug report Safari, Version 8.0 (10600.1.25.1) file:///Applications/Racket%20v6.1.1.5/doc/search/index.html OS X 10.10.1 (14B25) all updates up-to-date Welcome to DrRacket, version 6.1.1.5--2014-11-19(6c9172f/a) [3m]. Language: racket/gui; memory limit: 128 MB. the top/right popup works fine FWIW. S. On Wed Nov 19 2014 at 11:26:05 PM Robby Findler ro...@eecs.northwestern.edu wrote: You won't be surprised to learn that my machine is one of the ones where it works. :( If I understand correctly, you're getting to the browser, but not seeing the right thing in the browser? Is that right? If so, what is the url in the url bar? And which browser? Does it work if you switch to safari? Robby On Wed, Nov 19, 2014 at 4:21 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: I just tried it on the latest osx 64 bit full build. Logged as http://bugs.racket-lang.org/query/?cmd=view%20audit-traildatabase=defaultpr=14844return_url=http%3A%2F%2Fbugs.racket-lang.org%2Fquery%2F%3Fdatabase%3Ddefault%3Bdebug%3D%3BState%3Dany%3Bignoreclosed%3DIgnore%2520Closed%3BSynopsis%3Df1%3Bmultitext%3D%3Bcolumns%3DState%3Bcolumns%3DSynopsis%3Bcolumns%3DCategory%3Bcolumns%3DLast-Modified%3Bcolumns%3DRelease%3Bcmd%3Dsubmit%2520query%3Bsortby%3DNumber On Wed Nov 19 2014 at 9:01:25 PM Kevin Forchione lyss...@gmail.com wrote: On Nov 19, 2014, at 1:53 PM, Geoffrey S. Knauth ge...@knauth.org wrote: I tried F1 on my Racket 6.1.1 on OSX 10.10.1 and the browser came up with Racket help. Is that the same thing? --Geoff Yes. Interesting. Looks like we’re running the same OS. F5 runs the program for me, F1 does nothing. Are you using any “meta” keys? I’m using option as meta. -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
No, the browser isn't hiding the query part. Here are the content of two script files: $ cat a.scrpt open location file:///Applications/r/doc/search/index.html?q=xyz $ cat b.scrpt open location file:///Users/robby/Library/Racket/development/doc/search/index.html?q=xyz Running osascript a.scrpt doesn't work, but running osascript b.scrpt does work. And by work I mean that in both cases the corresponding webpage is visited in Safari, but in the first case, the q parameter disappears. I tried fiddling with various things, but I don't understand what exactly is considered to be the important difference between those paths. Robby On Thu, Nov 20, 2014 at 7:22 PM, Eli Barzilay e...@barzilay.org wrote: On Thu, Nov 20, 2014 at 7:51 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: in DrRacket: (send-url file:///Users/spdegabrielle/hello.html?q=aaaba) works (send-url file:///Applications/hello.html?q=xyz) works In that case I think that it's a different problem than what I described. (send-url file:///Applications/Racket%20v6.1.1.5/doc/search/index.html?q=xyz) fails This is weird. To debug it, the text thing I'd do is make that /Applications/hello.html show the location string -- perhaps the browser hides the query part. Another thing to look into is the permissions of the files -- maybe it descides to drop the query bit on a file that you don't personally own. in bash: Miriams-MacBook-Pro-2:~ spdegabrielle$ open file:///Users/spdegabrielle/hello.html?q= fails It shouldn't be `open' -- it's something with osascript. (I don't remember it now, but Robby had it in the other email.) I've just had a quick go at '(send-url/file ' but I cant remember how to escape the '?' Should be something like (send-url/file /Some/file.html #:query 123) but it's probably won't help to try it, since it uses the same functionality as the above. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
You won't be surprised to learn that my machine is one of the ones where it works. :( If I understand correctly, you're getting to the browser, but not seeing the right thing in the browser? Is that right? If so, what is the url in the url bar? And which browser? Does it work if you switch to safari? Robby On Wed, Nov 19, 2014 at 4:21 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: I just tried it on the latest osx 64 bit full build. Logged as http://bugs.racket-lang.org/query/?cmd=view%20audit-traildatabase=defaultpr=14844return_url=http%3A%2F%2Fbugs.racket-lang.org%2Fquery%2F%3Fdatabase%3Ddefault%3Bdebug%3D%3BState%3Dany%3Bignoreclosed%3DIgnore%2520Closed%3BSynopsis%3Df1%3Bmultitext%3D%3Bcolumns%3DState%3Bcolumns%3DSynopsis%3Bcolumns%3DCategory%3Bcolumns%3DLast-Modified%3Bcolumns%3DRelease%3Bcmd%3Dsubmit%2520query%3Bsortby%3DNumber On Wed Nov 19 2014 at 9:01:25 PM Kevin Forchione lyss...@gmail.com wrote: On Nov 19, 2014, at 1:53 PM, Geoffrey S. Knauth ge...@knauth.org wrote: I tried F1 on my Racket 6.1.1 on OSX 10.10.1 and the browser came up with Racket help. Is that the same thing? --Geoff Yes. Interesting. Looks like we’re running the same OS. F5 runs the program for me, F1 does nothing. Are you using any “meta” keys? I’m using option as meta. -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket PF1 Search Bug?
If you navigate to the file in the file: url, is it empty? Robby On Wed, Nov 19, 2014 at 5:52 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: I'm such a doofus I forgot to put it on the bug report Safari, Version 8.0 (10600.1.25.1) file:///Applications/Racket%20v6.1.1.5/doc/search/index.html OS X 10.10.1 (14B25) all updates up-to-date Welcome to DrRacket, version 6.1.1.5--2014-11-19(6c9172f/a) [3m]. Language: racket/gui; memory limit: 128 MB. the top/right popup works fine FWIW. S. On Wed Nov 19 2014 at 11:26:05 PM Robby Findler ro...@eecs.northwestern.edu wrote: You won't be surprised to learn that my machine is one of the ones where it works. :( If I understand correctly, you're getting to the browser, but not seeing the right thing in the browser? Is that right? If so, what is the url in the url bar? And which browser? Does it work if you switch to safari? Robby On Wed, Nov 19, 2014 at 4:21 PM, Stephen De Gabrielle spdegabrie...@gmail.com wrote: I just tried it on the latest osx 64 bit full build. Logged as http://bugs.racket-lang.org/query/?cmd=view%20audit-traildatabase=defaultpr=14844return_url=http%3A%2F%2Fbugs.racket-lang.org%2Fquery%2F%3Fdatabase%3Ddefault%3Bdebug%3D%3BState%3Dany%3Bignoreclosed%3DIgnore%2520Closed%3BSynopsis%3Df1%3Bmultitext%3D%3Bcolumns%3DState%3Bcolumns%3DSynopsis%3Bcolumns%3DCategory%3Bcolumns%3DLast-Modified%3Bcolumns%3DRelease%3Bcmd%3Dsubmit%2520query%3Bsortby%3DNumber On Wed Nov 19 2014 at 9:01:25 PM Kevin Forchione lyss...@gmail.com wrote: On Nov 19, 2014, at 1:53 PM, Geoffrey S. Knauth ge...@knauth.org wrote: I tried F1 on my Racket 6.1.1 on OSX 10.10.1 and the browser came up with Racket help. Is that the same thing? --Geoff Yes. Interesting. Looks like we’re running the same OS. F5 runs the program for me, F1 does nothing. Are you using any “meta” keys? I’m using option as meta. -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #29518: master branch updated
You ran raco setup with no arguments to completion? On Tuesday, November 18, 2014, j...@racket-lang.org wrote: jay has updated `master' from 26fe66b141 to 804599fe98. http://git.racket-lang.org/plt/26fe66b141..804599fe98 =[ One Commit ]= Directory summary: 100.0% pkgs/data-pkgs/data-lib/ ~~ 804599f Jay McCarthy j...@racket-lang.org javascript:; 2014-11-18 10:44 : | Adding dep that raco setup doesn't show on my machine : M pkgs/data-pkgs/data-lib/info.rkt | 2 +- =[ Overall Diff ]=== pkgs/data-pkgs/data-lib/info.rkt --- OLD/pkgs/data-pkgs/data-lib/info.rkt +++ NEW/pkgs/data-pkgs/data-lib/info.rkt @@ -1,6 +1,6 @@ #lang info (define collection 'multi) -(define deps '(base)) +(define deps '(base math-lib)) (define build-deps '(rackunit-lib)) (define pkg-desc implementation (no documentation) part of \data\) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1, Second Draft
I like the last sentence of Sam's latest bullet. Robby On Thursday, October 30, 2014, Matthias Felleisen matth...@ccs.neu.edu wrote: On Oct 30, 2014, at 3:45 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu javascript:; wrote: How about this one? (Starting from Matthias's offering and editing the apology from Sam's a bit.) Typed Racket closes a safety hole in the typing for the exception system. The revised type system restricts raise so that only instances of the exn structure type and flat data are communicated to handlers. As a side-effect, previously well-typed programs may fail to typecheck. How about: Typed Racket now checks uses of the exception system more strictly, eliminating safety bugs. The revised type system restricts raise so that only instances of the exn structure type and flat data are communicated to handlers, and enforces that exception handlers deal with all possible arguments. As a side-effect, previously well-typed programs may fail to typecheck. Can we please, pretty please, pretty please, pretty please drop these nows? _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1, Second Draft
Sam: can you elaborate on precisely what the hole was? In particular, if there are any safe programs that the type system now rejects, I'd be in favor of a slightly different wording. Robby On Wed, Oct 29, 2014 at 2:35 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Wed, Oct 29, 2014 at 3:30 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: * Exception handling changed to be safe. This may break existing programs that rely on unsafe behavior. * Casts and predicates are supported in typed regions. I think these two bullets (esp the first one) need to make clear that they're about Typed Racket. How about: * Typed Racket's rules for exception handlers are now more restrictive, as required for safety. This may cause type errors for existing programs that rely on unsafe behavior. * Typed Racket now supports casts and predicates in typed regions. Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1, Second Draft
Yes, that's what I mean. I don't think that the sentence This may break existing programs that rely on unsafe behavior. is accurate. How about This may break existing programs. or Closing this hole requires us to disallow some programs that do not signal runtime errors. or something like that? Robby On Wed, Oct 29, 2014 at 4:35 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: There were two holes. 1. We allowed exception handlers to assume that they received values of type `exn`, even when that wasn't right. 2. We allowed typed programs to throw arbitrary values, which means that you could throw a typed function to an untyped handler, which could then misuse it. Both of these changes could lead to type errors in programs that won't fail at runtime, but that's true of just about everything in Typed Racket, so I don't really understand what you're asking. Here are examples of programs that will now type-error for each change. 1. (with-handlers ([void exn-message]) #f) 2. (raise (lambda ([x : Integer]) x)) I think the second problem is more what you mean, in that the first program is wrong in some sense, even though it doesn't go wrong, but the second example is a perfectly fine Racket program (if perhaps poor style), but not one that can be allowed in the presence of untyped code. Does that help explain things? Sam On Wed, Oct 29, 2014 at 5:17 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Sam: can you elaborate on precisely what the hole was? In particular, if there are any safe programs that the type system now rejects, I'd be in favor of a slightly different wording. Robby On Wed, Oct 29, 2014 at 2:35 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Wed, Oct 29, 2014 at 3:30 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: * Exception handling changed to be safe. This may break existing programs that rely on unsafe behavior. * Casts and predicates are supported in typed regions. I think these two bullets (esp the first one) need to make clear that they're about Typed Racket. How about: * Typed Racket's rules for exception handlers are now more restrictive, as required for safety. This may cause type errors for existing programs that rely on unsafe behavior. * Typed Racket now supports casts and predicates in typed regions. Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1, Second Draft
I prefer the second sentence I sent to either of those. Fundamentally I think it is reasonable for the sentence to be slightly apologetic. There was a problem, we fixed it, but the fix may require some pain of our users. There's nothing wrong with that; it's just a fact of life. No shame in hiding it. Robby On Wed, Oct 29, 2014 at 4:55 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Wed, Oct 29, 2014 at 5:47 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Yes, that's what I mean. I don't think that the sentence This may break existing programs that rely on unsafe behavior. is accurate. How about This may break existing programs. or Closing this hole requires us to disallow some programs that do not signal runtime errors. or something like that? How about This may result in type errors in existing programs that rely on the original behavior; specifically, programs that `raise` higher-order values. Sam Robby On Wed, Oct 29, 2014 at 4:35 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: There were two holes. 1. We allowed exception handlers to assume that they received values of type `exn`, even when that wasn't right. 2. We allowed typed programs to throw arbitrary values, which means that you could throw a typed function to an untyped handler, which could then misuse it. Both of these changes could lead to type errors in programs that won't fail at runtime, but that's true of just about everything in Typed Racket, so I don't really understand what you're asking. Here are examples of programs that will now type-error for each change. 1. (with-handlers ([void exn-message]) #f) 2. (raise (lambda ([x : Integer]) x)) I think the second problem is more what you mean, in that the first program is wrong in some sense, even though it doesn't go wrong, but the second example is a perfectly fine Racket program (if perhaps poor style), but not one that can be allowed in the presence of untyped code. Does that help explain things? Sam On Wed, Oct 29, 2014 at 5:17 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Sam: can you elaborate on precisely what the hole was? In particular, if there are any safe programs that the type system now rejects, I'd be in favor of a slightly different wording. Robby On Wed, Oct 29, 2014 at 2:35 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Wed, Oct 29, 2014 at 3:30 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: * Exception handling changed to be safe. This may break existing programs that rely on unsafe behavior. * Casts and predicates are supported in typed regions. I think these two bullets (esp the first one) need to make clear that they're about Typed Racket. How about: * Typed Racket's rules for exception handlers are now more restrictive, as required for safety. This may cause type errors for existing programs that rely on unsafe behavior. * Typed Racket now supports casts and predicates in typed regions. Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1, Second Draft
I don't think that it's true of every type system everywhere is a good rationale for not owning backwards-incompatible changes (even when they are good backwards incompatible changes, as this one certainly is). I do agree with you, however, that what is especially bad is requiring changes to working code bases (for whatever definition of that word you wish to take (that is most friendly to people that use Racket)). How about this one? (Starting from Matthias's offering and editing the apology from Sam's a bit.) Typed Racket closes a safety hole in the typing for the exception system. The revised type system restricts raise so that only instances of the exn structure type and flat data are communicated to handlers. As a side-effect, previously well-typed programs may fail to typecheck. Robby On Wed, Oct 29, 2014 at 5:12 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: The reason I don't like the second sentence you wrote is that it's true of every type system everywhere. And also, the more significant change for users will almost certainly be the first one (it's required changes to several packages already) -- almost no one raises anything that isn't an exn, and so I haven't seen any code actually affected by the second change. _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1
For me: * Added the drracket/check-syntax library to facilitate check syntax-like behavior in other IDEs * Redex: explained the benchmark programs added a conditional-form to metafunctions * 2htdp/image's notion of equality no longer considers an image's baseline. * Contracts: contract-stronger? is now more consistently useful and contract error messages now admit the contract itself might be wrong Robby On Mon, Oct 27, 2014 at 12:08 PM, Matthew Flatt mfl...@cs.utah.edu wrote: At Mon, 27 Oct 2014 12:25:22 -0400, Ryan Culpepper wrote: mflatt: - optimizations (most from Gustavo Massaccesi) (82ffd405, 25c05d66, a7a912ee, 1f2f7a1d, d14b4a80, 769c5b6e, 35eb6562, 15423988) - add replace-evt (as suggested by Jan Dvořák) (bc69a9b0) - fixing letrec updates? (eg 926e64f5?) - Mac OS X Yosemite Pango repair (76f1ebde) - DPI-aware racket/gui on Windows (a64a1cb1) - raco pkg add '--binary-lib' (05523a0b, b2b00010) Plus the 32-bit Windows repair: * Mac OS X Yosemite: fixed compatibility problems, mainly by patching the Pango text-drawing library that is bundled with Racket. * Windows, 32-bit version: fixed window-update crashes by patching the Cairo drawing library that is bundled with Racket. * Windows: made the GUI library DPI-aware. * Added a binary library installation mode to install packages without source or documentation. Use the `--binary-lib` option with `raco pkg install`. * Repaired the compiler's use-before-defined analysis for certain forms of nested `letrec`, some `let` forms, and some uses of `set!` or `with-continuation-mark`. * Added bytecode optimizations (thanks to Gustavo Massaccesi). * Added a `replace-evt` event constructor (as suggested by Jan Dvořák). - performance tuning (c570a862, 1809df45) - windows: use native api for dates (135ccf09) - allow mixing exceptions with ffi/unsafe/alloc (from Jan Dvořák) (8bd5aa38) - senora gc (2916fc34, a312f499, 881990ed) - throw out latex back-end for picts ? (77ddf71b) - chaperones w/o redirections (1f1a10db, a8d0534e) - Windows: fix handling of junctions as links (cf7c0134) - behavior of numpad Enter (7d388a07, a41cc0c3) - UDP improvements (2a387ace) - natipkg (40f5ec07) These seem too minor for the announcement. _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Nervous about all of this merging to 6.1.1 release?
Many of the changes are documentation, but there are some TR changes that we may go back on; it's not clear yet. Were there other changes that jumped out at you as worth double checking? And yes, once Ryan announces a new build built, re-running tests is always welcome! Robby On Wed, Oct 22, 2014 at 10:36 AM, John Clements johnbcleme...@gmail.com wrote: Is anyone else nervous about the number of not-obviously-trivial changes we're merging to the 6.1.1 release after the test bundles are out? I for one wouldn't mind re-running my tests before the release. John _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Pre-Release Checklist for v6.1.1
On Thu, Oct 16, 2014 at 8:13 AM, Ryan Culpepper ry...@ccs.neu.edu wrote: * Robby Findler ro...@eecs.northwestern.edu - DrRacket Tests - Framework Tests - Contracts Tests - Games Tests - Teachpacks Tests: image tests - PLaneT Tests - Redex Tests Done. Updates: - DrRacket Updates: update HISTORY - Redex Updates: update HISTORY Pushed. (updates should show v6.1.1 as the most current version) - Ensure that previous version of DrRacket's preference files still starts up with new DrRacket - Update man pages in racket/man/man1: drracket.1 Email me to pick the changes when they're done, or tell me if there are no such changes. Done. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] #f instead of path-string? when (require cKanren)
Do we have a github issue tracker for drracket? Robby On Sat, Oct 4, 2014 at 5:48 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: Could you use the github issue tracker to submit this? Thanks -- Matthias https://github.com/calvis/cKanren On Oct 2, 2014, at 12:05 PM, A.J. Lepper wrote: Windows 64-bit, Racket v6.1 64-bit If I install cKanren from the package manager then (require cKanren) works fine in Racket.exe from the command prompt, but produces an error in DrRacket. simple-form-path receives #f instead of a path-string?, from file-stamp-in-paths. Adding a [(false? (car paths)) #f] clause to the outer cond stops the error, but may not be a good fix - I got a bit lost digging through the stack above it and went for the easy option. I've attached the backtrace. Thanks very much, -Angus. backtrace.txt_ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] #f instead of path-string? when (require cKanren)
I'm not able to reproduce this bug, but it appears that the value of the current-load/use-compiled parameter is being passed #f for a first argument. The code in DrRacket seems to assume that things like this will raise errors: (parameterize ([current-load/use-compiled void]) ((current-load/use-compiled) #f #f)) but I see they don't so it seems entirely plausible that something is passing #f in there when it shouldn't be somewhere. I think one might reasonably consider the missing check to be a bug in racket, but I'm not sure how easy it is to fix. Also unfortunately, there is potentially a lot going on in between the drracket/private/rep.rkt step in the stacktrace and the drracket\private\eval-helpers.rkt step so I'm a bit stuck right now. Robby On Thu, Oct 2, 2014 at 11:05 AM, A.J. Lepper angus.lep...@gmail.com wrote: Windows 64-bit, Racket v6.1 64-bit If I install cKanren from the package manager then (require cKanren) works fine in Racket.exe from the command prompt, but produces an error in DrRacket. simple-form-path receives #f instead of a path-string?, from file-stamp-in-paths. Adding a [(false? (car paths)) #f] clause to the outer cond stops the error, but may not be a good fix - I got a bit lost digging through the stack above it and went for the easy option. I've attached the backtrace. Thanks very much, -Angus. _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #29228: master branch updated
On Mon, Sep 15, 2014 at 8:08 PM, Stephen Chang stch...@ccs.neu.edu wrote: Does starting a fresh drracket exhibit these problems, if you follow those steps right after starting up? Yes I can reproduce consistently. Hm. I'm stuck. I tried windows 32bit 6.1 in my windows 7 vm (as well as git head, and those two versions on my mac) and a bunch of other variations on those operations and I can't seem to make it happen. Just to confirm, you're using the popup menu in the bottom left to select the language, right? And you've left the insertion point on the close paren in the require, right? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #29228: master branch updated
I am not able to get the colorer to be stopped with these steps or anything like them. So maybe it would help if you'd add some code to framework/private/color (use control-shift-o and f/p/color to get directly to the file). In particular, look for (set! stopped? #t) which is around line 626 and add these lines just below it: (printf \n) (for ([x (in-list (continuation-mark-set-context (current-continuation-marks)))]) (printf ~s\n x)) and then report back what the printfs print? Thanks, Robby On Tue, Sep 16, 2014 at 9:26 AM, Stephen Chang stch...@ccs.neu.edu wrote: I realized I maybe left out some crucial information. I have every tool disabled except: htdp, rackunit, and test engine. Yes, here is a more detailed step by step: 1) start drracket 6.1 32bit in windows 7 64bit, language is BSL, cursor is in interactions 2) move cursor to defs, type (require rackunit) 3) press f5 to run, succeeds, cursor is in interactions 4) switch lang to determine language from source using bottom left menu 5) press f5 to run, get only a module expression is allowed error 6) switch lang to bsl using bottom left menu 7) skip-whitespace error Let me try to reproduce on another system. On Tue, Sep 16, 2014 at 10:14 AM, Robby Findler ro...@eecs.northwestern.edu wrote: On Mon, Sep 15, 2014 at 8:08 PM, Stephen Chang stch...@ccs.neu.edu wrote: Does starting a fresh drracket exhibit these problems, if you follow those steps right after starting up? Yes I can reproduce consistently. Hm. I'm stuck. I tried windows 32bit 6.1 in my windows 7 vm (as well as git head, and those two versions on my mac) and a bunch of other variations on those operations and I can't seem to make it happen. Just to confirm, you're using the popup menu in the bottom left to select the language, right? And you've left the insertion point on the close paren in the require, right? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #29228: master branch updated
I don't think so. I'm not able to reproduce what you're seeing, with either 6.1 or git head. I'm also a little puzzled why the colorer would be stopped in this situation. Does starting a fresh drracket exhibit these problems, if you follow those steps right after starting up? Robby On Mon, Sep 15, 2014 at 7:37 PM, Stephen Chang stch...@ccs.neu.edu wrote: My Drracket is crashing with the steps and error msg below. Does this commit fix what I'm seeing? Steps to reproduce: 1) start drracket 6.1 windows 32 bit 2) select BSL 3) add (require rackunit) and run 4) switch to determine language from source 5) switch back to BSL skip-whitespace: called on a color:text% whose colorer is stopped. context...: C:\Program Files (x86)\Racket\share\pkgs\gui-lib\framework\private\color.rkt:966:4: skip-whitespace method in ...rk/private/color.rkt:77:2 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\framework\private\color.rkt:813:12: seq-loop C:\Program Files (x86)\Racket\share\pkgs\gui-lib\framework\private\color.rkt:802:4: highlight-nested-region method in ...rk/private/color.rkt:77:2 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\framework\private\color.rkt:762:6: core1469 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\framework\private\color.rkt:1192:4: after-edit-sequence method in ...rk/private/color.rkt:77:2 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\mred\private\wxme\text.rkt:748:2: end-edit-sequence method in text% set-surrogate method C:\Program Files (x86)\Racket\share\pkgs\drracket\drracket\private\module-language.rkt:2642:6: set-current-mode method in .../module-language.rkt:2627:4 C:\Program Files (x86)\Racket\share\pkgs\drracket\drracket\private\module-language.rkt:2635:6: after-set-next-settings method in .../module-language.rkt:2627:4 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\mred\private\mrmenu.rkt:250:14: command method in basic-selectable-menu-item% C:\Program Files (x86)\Racket\share\pkgs\gui-lib\mred\private\mrpopup.rkt:49:38: go C:\Program Files (x86)\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:451:6 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:502:32 C:\Program Files (x86)\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:650:3 On Sun, Sep 7, 2014 at 4:35 PM, ro...@racket-lang.org wrote: robby has updated `master' from df3c56fae2 to bc83e9b778. http://git.racket-lang.org/plt/df3c56fae2..bc83e9b778 =[ 2 Commits ]== Directory summary: 14.5% pkgs/drracket-pkgs/drracket/drracket/private/ 79.5% pkgs/gui-pkgs/gui-lib/framework/private/ 5.8% pkgs/gui-pkgs/gui-test/framework/tests/ ~~ f4d66ad Robby Findler ro...@racket-lang.org 2014-09-07 15:34 : | fix magic-open-paren bug | | also, replace some eq?s with equal?s. : M pkgs/gui-pkgs/gui-lib/framework/private/racket.rkt | 11 ++- M pkgs/gui-pkgs/gui-test/framework/tests/racket.rkt | 1 + ~~ bc83e9b Robby Findler ro...@racket-lang.org 2014-09-05 08:28 : | Open Require Path: ignore .bak files under windows, but ~ files elsewhere | | instead of ignoring ~ files everywhere : M .../drracket/drracket/private/find-completions.rkt | 4 +++- =[ Overall Diff ]=== pkgs/drracket-pkgs/drracket/drracket/private/find-completions.rkt ~ --- OLD/pkgs/drracket-pkgs/drracket/drracket/private/find-completions.rkt +++ NEW/pkgs/drracket-pkgs/drracket/drracket/private/find-completions.rkt @@ -24,7 +24,9 @@ (define (ignore? x) (or (member x '(compiled)) - (regexp-match #rx~$ x))) + (if (equal? (system-type) 'windows) + (regexp-match #rx[.]bak$ x) + (regexp-match #rx~$ x (define (find-completions str the-current-directory #:alternate-racket [alternate-racket #f]) (cond pkgs/gui-pkgs/gui-lib/framework/private/racket.rkt ~~ --- OLD/pkgs/gui-pkgs/gui-lib/framework/private/racket.rkt +++ NEW/pkgs/gui-pkgs/gui-lib/framework/private/racket.rkt @@ -1787,7 +1787,7 @@ (if (and (send text get-overwrite-mode) (= start-pos end-pos)) (send text insert [ start-pos (add1 start-pos) #f) (send text insert [ start-pos 'same #f)) -(when (eq? (send text classify-position pos) 'parenthesis) +(when (equal? (send text classify-position pos) 'parenthesis) (let* ([before-whitespace-pos (send text skip-whitespace pos 'backward #t)] [keyword/distance (find-keyword-and-distance before-whitespace-pos text)]) (cond @@ -1852,9 +1852,10 @@ 0)]) (cond [(and second-backwards-match2
Re: [racket-dev] [racket] Performance. Higher-order function
And now (finally) the Northwestern snapshots do too. Robby On Wed, Aug 27, 2014 at 9:46 AM, Matthew Flatt mfl...@cs.utah.edu wrote: The Racket snapshots at http://www.cs.utah.edu/plt/snapshots/ now include the Optimization Coach package. _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] DrRacket Parenthesis bug
Thanks, I've pushed a fix. Robby On Sat, Sep 6, 2014 at 5:22 PM, Kevin Forchione lyss...@gmail.com wrote: Hi guys, I’ve noticed that the named let form parenthesis behavior is different when the name is “rec”. In that case the inner parenthesis isn’t square brackets. For instance: (let rec (())) instead of (let rec ([])). -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Should `register-finalizer` unwrap impersonators?
Seems simplest to be to have typed racket know to trust register finalizer and thus avoid wrapping it with a contract. Robby On Saturday, August 16, 2014, Neil Toronto neil.toro...@gmail.com wrote: Short version: the contract system doesn't allow `register-finalizer` to be used in Typed Racket. Long version: consider the following Typed Racket program, in which instances of `os-resource-wrapper` represent an operating system resource `os-resource`, which itself is just a counter. It attempts to register a finalizer for allocated wrappers, which decrements the counter. #lang typed/racket (require/typed ffi/unsafe [register-finalizer (All (A) (- A (- A Any) Void))]) (: os-resource Integer) (define os-resource 0) (struct os-resource-wrapper ()) (: alloc-os-resource (- os-resource-wrapper)) (define (alloc-os-resource) (set! os-resource (add1 os-resource)) (define w (os-resource-wrapper)) (register-finalizer w (λ (w) (set! os-resource (sub1 os-resource w) (define w (alloc-os-resource)) (printf os-resource = ~v~n os-resource) (collect-garbage) (sleep 1) ; give finalizers a chance to run (printf os-resource = ~v~n os-resource) I get this output: os-resource = 1 os-resource = 0 The finalizer is being run while the program still has a pointer to the wrapper object. I think it's because the wrapper object is being impersonated when it's sent across the contract barrier, and the *impersonator* is getting the finalizer. (Or it's a chaperone, or an impostor, or a charlatan, or whatever. Let's go with impersonator.) In my specific case, the OS resources are OpenGL objects; e.g. vertex object arrays. The call to `register-finalizer` *must* be in Typed Racket code because the wrapper contains an (Instance GL-Context%), which can't have a contract put on it, so it can't pass from untyped to typed code. Is there any reason for `register-finalizer` to behave this way? Does it ever make sense to register a finalizer on an impersonator? Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [racket] Performance. Higher-order function
I think you'd have to add a dependency to the 'main-distribution' pkg, but my guess is that that will require some work internally to make not be a pain for people who want to build from git. If you have the inclination, you could give it a try locally and let us know how it goes? Robby On Tue, Aug 12, 2014 at 6:49 AM, Vincent St-Amour stamo...@ccs.neu.edu wrote: Ok, let's try to do that. Is there currently a way to include packages from 3rd party repos to the main distribution? Vincent At Tue, 12 Aug 2014 00:03:04 -0400, Greg Hendershott wrote: Being in the main repo is different from being in the distribution (and thus automatically installed). I think that OC should be there when you download the full bundle. Definitely. 1. It's very useful. 2. Its existence says, Racket optimization is a thing. 3. It's used with one of Racket's most appealing and unique facets, DrRacket. c _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Seg fault
I also tried both the 64 and 32 bit builds on my windows vm and couldn't get it to crash. Is there something specific you're doing in drracket? I just opened a few files and clicked around and nothing untoward happened. Robby On Thu, Jul 31, 2014 at 9:42 AM, Matthew Flatt mfl...@cs.utah.edu wrote: Thanks for the report. Unfortunately, I'm not able to replicate the crash, so I'm not sure what to recommend. If you have Visual Studio installed, then it may offer to open a debugger, or you could attach to the process while a program has crashed dialog is showing. A C-level backtrace extracted from the debugger might be helpful. If you don't have Visual Studio installed, does the OS offer any additional information at all? At Thu, 31 Jul 2014 16:54:15 +0700 (NOVT), Evgeny Odegov wrote: Today some conditions met on my machine and DrRacket began to crash almost immediately after run. So I reproduced it many times. The results of last several crashes: * Seg fault (internal error) at 31a3a4c Seg fault (internal error) at 31a3a4c Seg fault (internal error) at 31a3a4c * Seg fault (internal error) at 25863a4c Seg fault (internal error) at 25863a4c Seg fault (internal error) at 25863a4c * Seg fault (internal error) at 29e93a4c Seg fault (internal error) at 29e93a4c Seg fault (internal error) at 29e93a4c * Seg fault (internal error) at 4223a4c Seg fault (internal error) at 4223a4c Seg fault (internal error) at 4223a4c * Seg fault (internal error) at 1c55392ac Seg fault (internal error) at 1c55392ac Seg fault (internal error) at 1c55392ac * Seg fault (internal error) at 256b41fc Seg fault (internal error) at 256b41fc Seg fault (internal error) at 256b41fc Racket version: (32 bit x86) 6.1.0.2--2014-07-14(c7dd72a/a) OS: Windows 7 Prof 64 bit I also decided to try current snapshot 6.1.0.3--2014-07-30(f3a8883/a). The crashes are repeated: * Seg fault (internal error) at 2b9c3a4c Seg fault (internal error) at 2b9c3a4c Seg fault (internal error) at 2b9c3a4c * Seg fault (internal error) at 28b53a4c Seg fault (internal error) at 28b53a4c Seg fault (internal error) at 28b53a4c _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1
On Tue, Jul 29, 2014 at 12:47 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: On Jul 28, 2014, at 2:33 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: matthias: - add check-random (aec84f4a) check-random is an addition to the preferred unit testing framework in the teaching languages. It enables the testing of students' functions that use random-number generation. (Thanks to David Van Horn (UMaryland) for proposing this idea.) ;;; --- Some grammatical suggestions the UNDEFINED issue: Racket now raises ... Instead of the ubiquitous 'now' I'd prefer 'Racket v6.1 raises ...' ;;; --- .. in Robby's section: - contracts: improved random generation for contracts; the contract system can now easily find simple mistakes in data-structure implementations (eg accidentally reversing a conditional in a heap invariant check), given strong enough contracts - contracts: the contract system's random testing facility has been strengthened so that it can easily find mistakes in contracted data structure implementations (e.g. an accidental reverse of a conditional in a heap invariant check) Lets keep simple as in easily find simple mistakes. - redex: the semantics of mis-match patterns (variables followed by _!_) inside ellipses has changed in a backwards incompatible way; they semantics is now much clearer and now potentially even useful this change simplifies the patterns' semantics and increases the usefulness of these patterns ;;; +1 on plumbers, if only for the word :-) _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1
On Mon, Jul 28, 2014 at 1:33 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: robby: - random generation from contracts (1cb1ff28, 76c6a1b7) - contract improvements (c64d70ab) - change semantics of _!_ variables under ellipses (69c96c62) - change metafunction contract formatting (d067311c) - recursive-contract and cyclic values (7728e062, d664ee14, ..., 0db4df1d, f49dd363) - add dvipdf backend to scribble (5280395f) - add history (???) (3cd15cea, 145644ac, 83e8cfba, fb048647, d9dae651) None of these seem particularly important to me. I guess the random generation and the _!_ semantics changes are the most important of the lot. Here are bullets for them, but feel free to leave them out: - contracts: improved random generation for contracts; the contract system can now easily find simple mistakes in data-structure implementations (eg accidentally reversing a conditional in a heap invariant check), given strong enough contracts - redex: the semantics of mis-match patterns (variables followed by _!_) inside ellipses has changed in a backwards incompatible way; they semantics is now much clearer and now potentially even useful Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Racket hash tables vs. Python dicts - Performance
Not an answer to your direction question, but this is the more idiomatic way to write that and it seems to be a bit faster: (time (for ([w (in-list words)]) (hash-set! d w (add1 (hash-ref d w 0) On Wed, Jul 23, 2014 at 10:54 AM, Pedro Ramos pedropra...@tecnico.ulisboa.pt wrote: Hi, I've been developing an implementation of Python in Racket, where I'm implementing Python's dictionaries over Racket custom hash tables. While my occasional benchmarks typically show better performance on Racket programs than their Python equivalents, Racket's hash tables generally seem to be slower than Python's dicts. I've set up this benchmark in Racket: #lang racket (define alphabet abcdefghijklmnopqrstuvwxyz) (define (random-word n) (build-string n (lambda (x) (string-ref alphabet (random 23) (define words (for/list ([k 100]) (random-word 3))) (define d (make-hash)) (time (for ([w words]) (if (hash-has-key? d w) (hash-set! d w (add1 (hash-ref d w))) (hash-set! d w 1 And its equivalent in Python: import random import time alphabet = abcdefghijklmnopqrstuvwxyz def random_word(n): return ''.join([random.choice(alphabet) for i in range(n)]) words = [random_word(3) for k in xrange(100)] d = {} a = time.time() for w in words: if w in d: d[w] = d[w] + 1 else: d[w] = 1 b = time.time() print b-a, 'seconds' The Racket example yields running times of around 500 ms (running on Racket v6.0.1) while the Python example yields running times of around 330 ms (running on Python 2.7.3). I find this unusual because Python is somewhat more dynamic than Racket, since (a) Python's equality and hashing functions have to dispatched at runtime for each key; (b) referencing and setting values in a Python dict is done using a very general operator, [], whose behaviour also has to be dispatched at runtime, unlike the more specific hash-ref and hash-set! Racket functions. Is there something I'm missing about Racket's hash tables which explains this slower speed? Thanks, Pedro Ramos _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] A tricky chaperone puzzle
I also lean towards #2. What does the redex model say? Most of those pieces are in it, I think. Robby On Thu, Jul 24, 2014 at 3:25 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Nice example. Offhand, I think that #2 is right, but I'll have to look at it more to be sure. At Thu, 24 Jul 2014 15:45:18 -0400, Sam Tobin-Hochstadt wrote: Consider the following module: (module m racket (struct x [a]) (define v1 (x 'secret)) (define v2 (x 'public)) (provide v1 v2) (provide/contract [x-a (- x? (not/c 'secret))])) It appears that this ensures that you can't get 'secret. But, it turns out that I can write a function outside of `m` that behaves like `x-a` without the contract: (require (prefix-in m: 'm)) (define (x-a v) (define out #f) (with-handlers ([void void]) (m:x-a (chaperone-struct v m:x-a (λ (s v) (set! out v) v out) Now this works: (displayln (x-a m:v1)) ;; = 'secret The problem is that `m:x-a` is treated as a `struct-accessor-procedure?`, which is a capability for accessing the a field, even though it's a significantly restricted capability. There are a couple possible solutions I've thought of: 1. Require a non-chaperoned/impersonated accessor. 2. Actually use the chaperoned/impersonatored accessor to get the value out instead of the underlying accessor. 1 is a little less expressive. But note that 2 means that you have to only allow chaperoned procedures with `chaperone-struct`, and imposes significant complication on the runtime. I favor 1. Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] A tricky chaperone puzzle
Ah, nope. That model doesn't include function chaperones! Robby On Thu, Jul 24, 2014 at 6:14 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I also lean towards #2. What does the redex model say? Most of those pieces are in it, I think. Robby On Thu, Jul 24, 2014 at 3:25 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Nice example. Offhand, I think that #2 is right, but I'll have to look at it more to be sure. At Thu, 24 Jul 2014 15:45:18 -0400, Sam Tobin-Hochstadt wrote: Consider the following module: (module m racket (struct x [a]) (define v1 (x 'secret)) (define v2 (x 'public)) (provide v1 v2) (provide/contract [x-a (- x? (not/c 'secret))])) It appears that this ensures that you can't get 'secret. But, it turns out that I can write a function outside of `m` that behaves like `x-a` without the contract: (require (prefix-in m: 'm)) (define (x-a v) (define out #f) (with-handlers ([void void]) (m:x-a (chaperone-struct v m:x-a (λ (s v) (set! out v) v out) Now this works: (displayln (x-a m:v1)) ;; = 'secret The problem is that `m:x-a` is treated as a `struct-accessor-procedure?`, which is a capability for accessing the a field, even though it's a significantly restricted capability. There are a couple possible solutions I've thought of: 1. Require a non-chaperoned/impersonated accessor. 2. Actually use the chaperoned/impersonatored accessor to get the value out instead of the underlying accessor. 1 is a little less expressive. But note that 2 means that you have to only allow chaperoned procedures with `chaperone-struct`, and imposes significant complication on the runtime. I favor 1. Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] A tricky chaperone puzzle
Yes, true! Robby On Thu, Jul 24, 2014 at 8:07 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Struct chaperones are the important part, I think. But the theorem would be false under option 1, I think. Adding contracts can add non-contract errors -- the error you get when a you supply the wrong accessor for struct-chaperone. Sam On Jul 24, 2014 7:54 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Ah, nope. That model doesn't include function chaperones! Robby On Thu, Jul 24, 2014 at 6:14 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I also lean towards #2. What does the redex model say? Most of those pieces are in it, I think. Robby On Thu, Jul 24, 2014 at 3:25 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Nice example. Offhand, I think that #2 is right, but I'll have to look at it more to be sure. At Thu, 24 Jul 2014 15:45:18 -0400, Sam Tobin-Hochstadt wrote: Consider the following module: (module m racket (struct x [a]) (define v1 (x 'secret)) (define v2 (x 'public)) (provide v1 v2) (provide/contract [x-a (- x? (not/c 'secret))])) It appears that this ensures that you can't get 'secret. But, it turns out that I can write a function outside of `m` that behaves like `x-a` without the contract: (require (prefix-in m: 'm)) (define (x-a v) (define out #f) (with-handlers ([void void]) (m:x-a (chaperone-struct v m:x-a (λ (s v) (set! out v) v out) Now this works: (displayln (x-a m:v1)) ;; = 'secret The problem is that `m:x-a` is treated as a `struct-accessor-procedure?`, which is a capability for accessing the a field, even though it's a significantly restricted capability. There are a couple possible solutions I've thought of: 1. Require a non-chaperoned/impersonated accessor. 2. Actually use the chaperoned/impersonatored accessor to get the value out instead of the underlying accessor. 1 is a little less expressive. But note that 2 means that you have to only allow chaperoned procedures with `chaperone-struct`, and imposes significant complication on the runtime. I favor 1. Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Pre-Release Checklist for v6.1
Believe it or not I actually tried that. Screenshot: http://www.eecs.northwestern.edu/~robby/tmp/x.png (that's Chome and Safari). Robby On Wed, Jul 23, 2014 at 7:02 AM, Neil Toronto neil.toro...@gmail.com wrote: They only do it on my system if the browser window is too narrow. And overlap is the wrong word: the margin notes are completely inside the blue boxes. BTW, #2 is fixed now. I added an #:unscaled? #t somewhere; Matthew did the actual work. :D Neil On 07/22/2014 07:20 PM, Robby Findler wrote: FWIW, I don't see the overlap in Chrome (on a mac) or in Safari. Robby On Tue, Jul 22, 2014 at 2:01 PM, Neil Toronto neil.toro...@gmail.com wrote: On 07/17/2014 08:03 PM, Ryan Culpepper wrote: * Neil Toronto neil.toro...@gmail.com - Plot Tests - Images Tests - Inspect icons - Math tests All tests pass, but two things need fixing: some margin notes in the math documentation, and `compiled-bitmap` and `compiled-bitmap-list` when they embed compressed bitmaps. 1. There's an issue with margin notes overlapping blue boxes in some of the math documentation. I haven't looked into it deeply yet, so I'm not sure what causes it or what should be done to fix it. You can see it in the pre-release docs here: http://pre-release.racket-lang.org/doc/math/matrix_basic.html 2. The `compiled-bitmap` and `compiled-bitmap-list` macros yield bitmaps that are the right size but with a half-size image tucked into the upper-left corner, when the bitmaps are stored in the module as JPEGs. (This doesn't affect DrRacket's icons because they're all stored as PNGs.) I suspect there's a missing #:unscaled? #t or two. Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Pre-Release Checklist for v6.1
FWIW, I don't see the overlap in Chrome (on a mac) or in Safari. Robby On Tue, Jul 22, 2014 at 2:01 PM, Neil Toronto neil.toro...@gmail.com wrote: On 07/17/2014 08:03 PM, Ryan Culpepper wrote: * Neil Toronto neil.toro...@gmail.com - Plot Tests - Images Tests - Inspect icons - Math tests All tests pass, but two things need fixing: some margin notes in the math documentation, and `compiled-bitmap` and `compiled-bitmap-list` when they embed compressed bitmaps. 1. There's an issue with margin notes overlapping blue boxes in some of the math documentation. I haven't looked into it deeply yet, so I'm not sure what causes it or what should be done to fix it. You can see it in the pre-release docs here: http://pre-release.racket-lang.org/doc/math/matrix_basic.html 2. The `compiled-bitmap` and `compiled-bitmap-list` macros yield bitmaps that are the right size but with a half-size image tucked into the upper-left corner, when the bitmaps are stored in the module as JPEGs. (This doesn't affect DrRacket's icons because they're all stored as PNGs.) I suspect there's a missing #:unscaled? #t or two. Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] flatten-begin
Yes, I agree. I don't have a good suggestion for the name, tho. Sorry. Robby On Mon, Jul 21, 2014 at 3:19 PM, Asumu Takikawa as...@ccs.neu.edu wrote: On 2014-07-19 23:12:51 -0400, Asumu Takikawa wrote: This sounds like a nice solution and it would be fine for my use-case too. Anyone have any reasons against? (otherwise I can make the change) I just realized that `flatten-begin` actually doesn't care if the form starts with a `begin`. In other words, the following evalutes like this: (flatten-begin #'(a 1 2)) = (list #'2 #'3) In which case the behavior of #:all? becomes a bit weird since it would care about the head being a `begin` (otherwise it would collapse too manay things). Maybe the recursive flattener should be a different function after all? Cheers, Asumu _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] flatten-begin
On Sun, Jul 20, 2014 at 1:27 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Fri, 18 Jul 2014 09:52:26 -0500, Robby Findler wrote: Unless someone knows why it is a bad idea, how about adding a #:all? argument that flattens all the way down? I don't see many uses of flatten-begin in our tree, but the one in compatibility/package sure looks like it could use the #:all? argument. I don't think so. Eagerly flattening would break examples like (begin (define begin +) (begin 1 2))) Oh, I see I missed the call to local-expand in the loop, sorry. But what is this supposed to do at the REPL? DrRacket and Racket at least agree, but it isn't what I would have predicted: (begin (define begin +) (begin 1 2)) . begin: function application is not allowed; no #%app syntax transformer is bound in: (begin 1 2) Are they doing the right thing? (Inside a module we get the expected 3.) Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Pre-Release Checklist for v6.1
On Thu, Jul 17, 2014 at 7:03 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: * Robby Findler ro...@eecs.northwestern.edu - DrRacket Tests - Framework Tests - Contracts Tests - Games Tests - Teachpacks Tests: image tests - PLaneT Tests - Redex Tests Updates: - DrRacket Updates: update HISTORY - Redex Updates: update HISTORY (updates should show v6.1 as the most current version) - Ensure that previous version of DrRacket's preference files still starts up with new DrRacket - Update man pages in racket/man/man1: drracket.1 Email me to pick the changes when they're done, or tell me if there are no such changes. Done. There are two commits for the HISTORY; just pushed and they are marked in the commit messages. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] flatten-begin
On Fri, Jul 18, 2014 at 9:37 AM, Asumu Takikawa as...@ccs.neu.edu wrote: On 2014-07-17 22:17:18 -0500, Robby Findler wrote: Why doesn't flatten-begin already do this? I'm not sure. I was hoping someone else could tell me. :) Ha! :) Maybe there's something you might want to do with the intermediate syntax objects in some cases? Properties maybe? I'm not sure. Looks like it's been that way for more than 5 years now, tho, so it seems unwise to change it. Unless someone knows why it is a bad idea, how about adding a #:all? argument that flattens all the way down? I don't see many uses of flatten-begin in our tree, but the one in compatibility/package sure looks like it could use the #:all? argument. Ditto the one in TR (in class-prims.rkt). And I'm pretty sure that replacing the hand-rolled loops in drracket for doing this (they predate that library) would use the #:all? argument if they were rewritten. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] flatten-begin
Why doesn't flatten-begin already do this? Robby On Friday, July 18, 2014, Asumu Takikawa as...@ccs.neu.edu wrote: Hi all, I was wondering what people think about a potential API addition to the `syntax/flatten-begin` library. Something like `flatten-begin*` (or a less terrible name) that would recursively flatten `begin` expressions like the `flatten` function does for plain lists. i.e., (flatten-begin* #'(begin (begin 1 2) 3 4)) = (list #'1 #'2 #'3 #'4) as opposed to (flatten-begin #'(begin (begin 1 2) 3 4)) = (list #'(begin 1 2) #'3 #'4) Would that be useful? I keep finding myself writing functions like this. Cheers, Asumu _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #29023: master branch updated
I do not buy this argument: the user didn't write the compiler but they wrote the contract. Robby On Monday, July 14, 2014, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: This seems like a situation where the new error message is potentially more confusing, even though it's technically more correct. There are lots of other caveats we could add (assuming there isn't a compiler bug, etc) but I think adding them would make Racket harder to use. Sam On Mon, Jul 14, 2014 at 9:11 AM, ro...@racket-lang.org javascript:; wrote: robby has updated `master' from 737330deb6 to 1dda800ca2. http://git.racket-lang.org/plt/737330deb6..1dda800ca2 =[ One Commit ]= Directory summary: 100.0% racket/collects/racket/contract/private/ ~~ 1dda800 Robby Findler ro...@racket-lang.org javascript:; 2014-07-14 08:09 : | add contract-correct caveat to contract violation error messages : M racket/collects/racket/contract/private/blame.rkt | 1 + =[ Overall Diff ]=== racket/collects/racket/contract/private/blame.rkt ~ --- OLD/racket/collects/racket/contract/private/blame.rkt +++ NEW/racket/collects/racket/contract/private/blame.rkt @@ -320,6 +320,7 @@ from-line on-line blaming-line + (assuming the contract is correct) at-line)) ;; combine-lines : (-* #:rest (listof (or/c string? #f))) string?) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #29023: master branch updated
Sorry-- I replied on my phone and too tersely the first time. What I'm trying to say is that I do not agree that compiler bugs or ffi bugs that corrupt memory or things along these lines are analogous. I do agree that those things do not deserve lines in our contract error messages. Contracts are different because the error message is really saying only I detected an inconsistency between the contract and the program. The messages in previous releases were 100% one-sided. I lean towards keeping the emphasis on the code is wrong side and not the contract is wrong side, since that seems to make more intuitive sense to people, but I would not mind a change that moves us more towards an error message that is more balanced (proposals welcome!). Not even admitting the second possibility seems unwise, however. Robby On Mon, Jul 14, 2014 at 8:30 AM, Robby Findler ro...@eecs.northwestern.edu wrote: I do not buy this argument: the user didn't write the compiler but they wrote the contract. Robby On Monday, July 14, 2014, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: This seems like a situation where the new error message is potentially more confusing, even though it's technically more correct. There are lots of other caveats we could add (assuming there isn't a compiler bug, etc) but I think adding them would make Racket harder to use. Sam On Mon, Jul 14, 2014 at 9:11 AM, ro...@racket-lang.org wrote: robby has updated `master' from 737330deb6 to 1dda800ca2. http://git.racket-lang.org/plt/737330deb6..1dda800ca2 =[ One Commit ]= Directory summary: 100.0% racket/collects/racket/contract/private/ ~~ 1dda800 Robby Findler ro...@racket-lang.org 2014-07-14 08:09 : | add contract-correct caveat to contract violation error messages : M racket/collects/racket/contract/private/blame.rkt | 1 + =[ Overall Diff ]=== racket/collects/racket/contract/private/blame.rkt ~ --- OLD/racket/collects/racket/contract/private/blame.rkt +++ NEW/racket/collects/racket/contract/private/blame.rkt @@ -320,6 +320,7 @@ from-line on-line blaming-line + (assuming the contract is correct) at-line)) ;; combine-lines : (-* #:rest (listof (or/c string? #f))) string?) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
Yeah, I'm realizing that my understanding of those of the complaints was wrong. My next step when I get back to this is to try to get a reasonably automatic setup for Redex that mimics that \usepackage{pslatex} setting in latex (which is, I think what sigplan uses). Robby On Tue, Jul 1, 2014 at 2:31 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: On Jun 27, 2014, at 4:47 PM, Robby Findler wrote: This effect is, I believe, one of the main things people mean when they say that Redex's typesetting is ugly (and it is indeed ugly in larger quantities). [[ Just now catching up ]] This is off topic in a sense but right on topic wrt the above quote. When people dislike Redex in scribble or latex document, they are saying that they chose some fonts (perhaps defaults) and that Redex fragments look different than their context because Redex chose a different font. Most latex users don't know much about fonts and certainly don't know how to adjust Redex so it uses their latex fonts. [[ I did some font loading and messing around in my TeX days and young LaTeX days and I am honestly glad I forgot those details. I am not looking forward to creating the .tex styles for 2e. ]] _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
Thanks. When I look at the dvipdf-produced pdf in my pdf viewer, it looks good, but the other one does not. I see no difference in these screenshots or the pdf.js ones you sent, tho. And when I view the pdfs in pdf.js via their demo features, I see no difference. What latex distribution are you using? Robby On Mon, Jun 30, 2014 at 6:50 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Attached are the two pdfs (x1 is --pdf, x is --dvipdf) and the two screenshots in Evince, my usual PDF viewer. Sam On Sat, Jun 28, 2014 at 9:03 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I'd like to see screenshots of the pdfs in whatever viewer you usually use, if you don't mind. Also: what latex distribution are you using? Robby On Sat, Jun 28, 2014 at 12:16 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Attached is a screenshot from the diffpdf tool. You can see that the font rendering is different in a few places. You can also see that --dvipdf loses the rest of the document after the Redex pict -- I don't know what could cause that. Basically the same things happen on my other linux machine. Sam On Fri, Jun 27, 2014 at 9:18 PM, Robby Findler ro...@eecs.northwestern.edu wrote: PS: Sam, were you able to produce two pdfs (via scribble --dvipdf and --pdf) and compare their output on your machine? Do you have screenshots to share? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
I see that too, in an ubuntu vm. Thanks. Robby On Mon, Jun 30, 2014 at 10:28 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Jun 30, 2014 3:34 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Thanks. When I look at the dvipdf-produced pdf in my pdf viewer, it looks good, but the other one does not. I see no difference in these screenshots or the pdf.js ones you sent, tho. And when I view the pdfs in pdf.js via their demo features, I see no difference. What latex distribution are you using? This is TeX Live, I think 2013 with some modifications that Debian/Ubuntu makes. Sam Robby On Mon, Jun 30, 2014 at 6:50 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Attached are the two pdfs (x1 is --pdf, x is --dvipdf) and the two screenshots in Evince, my usual PDF viewer. Sam On Sat, Jun 28, 2014 at 9:03 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I'd like to see screenshots of the pdfs in whatever viewer you usually use, if you don't mind. Also: what latex distribution are you using? Robby On Sat, Jun 28, 2014 at 12:16 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Attached is a screenshot from the diffpdf tool. You can see that the font rendering is different in a few places. You can also see that --dvipdf loses the rest of the document after the Redex pict -- I don't know what could cause that. Basically the same things happen on my other linux machine. Sam On Fri, Jun 27, 2014 at 9:18 PM, Robby Findler ro...@eecs.northwestern.edu wrote: PS: Sam, were you able to produce two pdfs (via scribble --dvipdf and --pdf) and compare their output on your machine? Do you have screenshots to share? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
I'd like to see screenshots of the pdfs in whatever viewer you usually use, if you don't mind. Also: what latex distribution are you using? Robby On Sat, Jun 28, 2014 at 12:16 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Attached is a screenshot from the diffpdf tool. You can see that the font rendering is different in a few places. You can also see that --dvipdf loses the rest of the document after the Redex pict -- I don't know what could cause that. Basically the same things happen on my other linux machine. Sam On Fri, Jun 27, 2014 at 9:18 PM, Robby Findler ro...@eecs.northwestern.edu wrote: PS: Sam, were you able to produce two pdfs (via scribble --dvipdf and --pdf) and compare their output on your machine? Do you have screenshots to share? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
I can't explain, no. The pdfs don't actually seem to _be_ worse when printing, so this pathway just seems to encourage viewers somehow. But apparently if you have a retina mac, this flag isn't necessary. Robby On Fri, Jun 27, 2014 at 7:22 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Fri, Jun 27, 2014 at 4:30 AM, ro...@racket-lang.org wrote: 5280395 Robby Findler ro...@racket-lang.org 2014-06-27 03:25 : | add the --dvipdf flag to scribble | | This adds a new back-end pipeline for generating pdf to | scribble, with the hope that included picts (e.g., those | generated by Redex) will look better when viewed with | on-screen pdf viewers Can you explain more about why this would work better? In particular, there are lots of things that work better/only with pdflatex (fonts, unicode, hyperlinks, etc) so I hope that there isn't some permanent barrier to getting both nice-looking Redex picts and fancy latex features. Sam _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
On Fri, Jun 27, 2014 at 7:59 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Is the program in the commit message what I should try to see the difference? It looks different for me, yes. I'm attaching two screenshots for the difference I see between --pdf and --dvipdf. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
No, the lower-down aspect is actually something else. The x and the y in the sans serif font on that line and the big f on the line above are from picts. The other characters on those lines are directly written in the latex code. The grammar is also a pict. The picts look worse in one screen shot than the other (the one whose name has 8.01.25 is the uglier one). This effect is, I believe, one of the main things people mean when they say that Redex's typesetting is ugly (and it is indeed ugly in larger quantities). Robby On Fri, Jun 27, 2014 at 9:23 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: And the one with the second x in the bottom line lower down is the one that's from --pdf and is not intended? Are there other differences between the pictures? Sam On Fri, Jun 27, 2014 at 9:02 AM, Robby Findler ro...@eecs.northwestern.edu wrote: On Fri, Jun 27, 2014 at 7:59 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Is the program in the commit message what I should try to see the difference? It looks different for me, yes. I'm attaching two screenshots for the difference I see between --pdf and --dvipdf. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
I am not understanding your question either but the two screenshots are using the same fonts. Just one is being rendered poorly for unknown reasons. Robby On Saturday, June 28, 2014, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Fri, Jun 27, 2014 at 2:23 PM, Matthew Flatt mfl...@cs.utah.edu javascript:; wrote: At Fri, 27 Jun 2014 13:43:46 -0400, Sam Tobin-Hochstadt wrote: On Fri, Jun 27, 2014 at 12:30 PM, Matthew Flatt mfl...@cs.utah.edu javascript:; wrote: At Fri, 27 Jun 2014 11:56:39 -0400, Sam Tobin-Hochstadt wrote: On Fri, Jun 27, 2014 at 11:45 AM, Matthew Flatt mfl...@cs.utah.edu javascript:; wrote: For some reason, the way that PDF fragments are pulled in by `pdflatex` makes the fragments look worse in some PDF viewers/machines than the way that PS fragments are pulled in by `latex` plus `dvips`. I think it has to do with heuristics in PDF viewers, and I think there's no difference when going to a printer. My impression was that PDF was supposed to be a pixel-accurate format, at least when self-contained and not using system fonts, and thus there wouldn't be any such heuristics. Is that not true? PDF is a vector-graphics format, not a raster-graphics format (so it doesn't really say anything about pixels). Right -- what I meant was that at a given size, rendering should be pixel-accurate, so that you shouldn't see differences between different viewers (unlike, say, HTML, which doesn't prescribe layout nearly as precisely). Maybe the alignment problem (now fixed) in Robby's example obscured the issue. It's just about the smoothness of the rendering. That is, PDF specifies exactly where things should be on a cartesian plane, but renderers draw the same image with different pixels depending on the display resolution, how much time the renderer spends on anti-aliasing, and so on. The look worse part above was meant only about the appearance of shape edges, and not about shapes being in the wrong location. In the particular `e ::= ...` example, this is an issue of font rendering, right? IOW, the shapes being drawn differently between dvipdf and pdflatex are fonts placed in particular spots on the page. Sam _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] 2htdp/image Feature Suggestion
I've generally tried to keep the image arguments last to make nested compositions of functions easier to read. Since we have to keep frame for backwards compatibilities reasons regardless, I don't think we need to worry about making color-frame's color argument optional. Robby On Fri, Jun 27, 2014 at 12:38 PM, Kevin Forchione lyss...@gmail.com wrote: On Jun 22, 2014, at 9:42 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Thanks! I've added these two functions. Robby On Sun, Jun 22, 2014 at 12:26 PM, Kevin Forchione lyss...@gmail.com wrote: On Jun 21, 2014, at 5:02 PM, Robby Findler ro...@eecs.northwestern.edu wrote: What do you think about a variant on center-crop called crop/align that accepts a width, a height, an image, and an x-place and a y-place? That would seem to fit better into the library the way it's currently constructed. For working around the frame issue, how about just a color-frame function that controls the color for now? I agree! That’s even better in terms of use and simplicity. -Kevin One question about color-frame’s arguments. I’ve played with it in the latest push, and it’s (color-frame color image) with color being first and required. Would it be better to have it 2nd and default to ‘black, so that by default color-frame reduces to frame? -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28945: master branch updated
PS: Sam, were you able to produce two pdfs (via scribble --dvipdf and --pdf) and compare their output on your machine? Do you have screenshots to share? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] 2htdp/image Feature Suggestion
I think that the prefer-define-over-let applies only to the first let in this program. The style guide also would recommend 'cond' over 'if' here, but it becomes very very important to do that only if there were nested 'let's or 'begin's or the like and you don't have that. Robby On Mon, Jun 23, 2014 at 12:32 PM, Jos Koot jos.k...@gmail.com wrote: In the recommendations of http://docs.racket-lang.org/style/index.html it is recommended to use (internal or module top-level) define rather than named let. I use named let a lot. How would you rewrite the following? For me it is rather difficult to make the change without loosing track of the scope of the variables. I also have a rather distinct way of indenting. #lang racket #| A rearrangement of a list L is a list with the same elements as L, but possibly in another order. Proc make-natural-rearrangement takes a list L and returns a proc. Let N be the number of distinct rearrangements of L. The returned proc takes an index K less than N and returns the K-th distinct rearrangement of L. Two rearrangements R0 and R1 are distinct if (not (andmap EQ? R0 R1)). EQ? must be an equivalence relation on the elements of L. E = element H = head of L T = tail of L (append H T) = L K = index N = nr of distinct rearrangements of L. |# (define (make-natural-rearrangement L (EQ? equal?)) (let ((N (nr-of-rearrangements L EQ?))) (lambda (K) (let rearrange ((L L) (K K) (N N) (result '())) ; Look for the K-th rearrangement of L and put it's elements in result. (if (null? L) result (let pseudo-rotate ((H L) (T '()) (K K)) ; Look in subsequent pseudorotations. (let ((E (car H)) (H (cdr H))) (if (member E T EQ?) ; Skip pseudorotation if it's car already was car of a previous one. (pseudo-rotate H (cons E T) K) (let ((M (/ (* N (count-occurrences E L EQ?)) (length L ; M is the nr of rearrangements of (append H T) ; computed by means of a recurrent relation. (if ( K M) ; The rearrangement is in this pseudorotation. (rearrange (append H T) K M (cons E result)) ; The rearrangement is not in this pseudorotation. ; Look in the following pseudorotation, but decrease K by the ; nr of rearrangements of the skipped pseudorotation. (pseudo-rotate H (cons E T) (- K M (define (nr-of-rearrangements L EQ?) ...) (define (count-occcurrences E L EQ?) ...) -Original Message- From: dev [mailto:dev-boun...@racket-lang.org] On Behalf Of Asumu Takikawa Sent: lunes, 23 de junio de 2014 7:35 To: Kevin Forchione Cc: dev@racket-lang.org Subject: Re: [racket-dev] 2htdp/image Feature Suggestion On 2014-06-22 20:27:21 -0700, Kevin Forchione wrote: Thanks! Is there any documentation or guide on which *styles* to prefer in writing Racket code? I find myself scratching my head at times in these matters! In recent Racket distributions and online docs there's now a style manual: http://docs.racket-lang.org/style/index.html Cheers, Asumu _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] 2htdp/image Feature Suggestion
FWIW, I think this is what the style guide would recommend. I found the transformation to be pretty straightforward, except that I had to rename on occurrence of 'H' to 'H2'. (I didn't try to test it, tho!) Robby (define (make-natural-rearrangement L (EQ? equal?)) (define N (nr-of-rearrangements L EQ?)) (λ (K) (let rearrange ((L L) (K K) (N N) (result '())) ; Look for the K-th rearrangement of L and put it's elements in result. (cond [(null? L) result] [else (let pseudo-rotate ((H L) (T '()) (K K)) ; Look in subsequent pseudorotations. (define E (car H)) (define H2 (cdr H)) (cond [(member E T EQ?) ; Skip pseudorotation if it's car already was car of a previous one. (pseudo-rotate H2 (cons E T) K)] [else (define M (/ (* N (count-occurrences E L EQ?)) (length L))) ; M is the nr of rearrangements of (append H T) ; computed by means of a recurrent relation. (cond [( K M) ; The rearrangement is in this pseudorotation. (rearrange (append H2 T) K M (cons E result))] [else ; The rearrangement is not in this pseudorotation. ; Look in the following pseudorotation, but decrease K by the ; nr of rearrangements of the skipped pseudorotation. (pseudo-rotate H2 (cons E T) (- K M))])]))] _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] 2htdp/image Feature Suggestion
Thanks! I've added these two functions. Robby On Sun, Jun 22, 2014 at 12:26 PM, Kevin Forchione lyss...@gmail.com wrote: On Jun 21, 2014, at 5:02 PM, Robby Findler ro...@eecs.northwestern.edu wrote: What do you think about a variant on center-crop called crop/align that accepts a width, a height, an image, and an x-place and a y-place? That would seem to fit better into the library the way it's currently constructed. For working around the frame issue, how about just a color-frame function that controls the color for now? I agree! That’s even better in terms of use and simplicity. -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] 2htdp/image Feature Suggestion
What do you think about a variant on center-crop called crop/align that accepts a width, a height, an image, and an x-place and a y-place? That would seem to fit better into the library the way it's currently constructed. For working around the frame issue, how about just a color-frame function that controls the color for now? Robby Robby On Sat, Jun 21, 2014 at 1:42 PM, Kevin Forchione lyss...@gmail.com wrote: Hi guys, I’ve been working with 2htdp/image and been struck by its monitor-oriented coordinate system and its image-centric perspective, both of which have proven a rich bed for new tools. I’ve found these two functions have been useful to me and might be useful for others. I’ve particularly found them useful as my racket sessions use the “white on black” color schemes, and with my eyesight a pixel’s contrast makes a difference. The center-crop function facilitates the image-cntric perspective of the library by centering the cropping rectangle on the image center. The frame function replaces the library’s existing function with one that does the same thing, but also provides parameters for setting the pixel frame coloring, background coloring within the frame, and x/y offsets that work with center-crop to expand or shrink the framing of the image. ;; center-crop: width height image - image? ;; crops image in a rectangle of width x height whose center is image center. (define (center-crop width height img) (crop (- (quotient (image-width img) 2) (quotient width 2)) (- (quotient (image-height img) 2) (quotient height 2)) width height img)) ;; frame: image frame-option ... - image? ;; Returns an image just like image, except with a frame-color'd, single pixel frame ;; around the bounding box of the image. The background-color indicates the color ;; inside the frame over which the image is laid. If an offset is provided it ;; indicates a center-crop in that dimension. A positive value extends the crop ;; beyond the image bounding box, a negative value center-crops the image within ;; the bounding box. (define (frame img #:frame-color (frame-color 'black) #:background-color (background-color 'transparent) #:frame-offset (frame-offset 0) #:frame-x-offset (frame-x-offset frame-offset) #:frame-y-offset (frame-y-offset frame-offset)) (let ([width (+ (image-width img) frame-x-offset)] [height (+ (image-height img) frame-y-offset)]) (overlay (rectangle width height 'outline frame-color) (center-crop width height img) (rectangle width height 'solid background-color -Kevin _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Slow contracts
Oh, sorry: I just meant that it may be useful information if we were to run some micro-benchmarks to determine where the break-even point is between #:lazy and strict for some fairly simple tree type and an untyped program that just walks over the tree, say, twice. I'm imagining measuring the break-even point in size of the tree. If the break-even point is a tree with 10 nodes than I think we'd come to very difficult conclusions than if the break-even point was a tree with 10,000 nodes. Robby On Fri, Jun 13, 2014 at 1:06 AM, Eric Dobson eric.n.dob...@gmail.com wrote: The issue is TR doesn't know statically know how the value will be used, thus we have do the computation for determining the break even point at run time. This puts the actual work in the contract system (or at least the contracts that TR generates), and I don't understand all the internal workings of these. I do believe there are optimizations that we can do, for example unrolling the contract so that only every 5 struct contracts is a lazy chaperone contract. But I have no idea how we could dynamically pick the best unrolling strategy. On Thu, Jun 12, 2014 at 10:20 PM, Robby Findler ro...@eecs.northwestern.edu wrote: On Tue, Jun 10, 2014 at 2:27 AM, Eric Dobson eric.n.dob...@gmail.com wrote: On Mon, Jun 9, 2014 at 9:46 PM, Eric Dobson eric.n.dob...@gmail.com wrote: Splitting this out because this is actually a different issue. This is about us generating slow contracts. There are two things in play here. One is that TR doesn't use the new lazy parts of struct/dc. This would require changing struct contracts from flat contracts to chaperone-contracts. Given that I think we are going to need to change struct contracts to sometimes be chaperone contracts anyways for soundness that might not be a huge loss. I did performance measurements and it is about a factor of 60 slower for lazy chaperone contracts. I see a couple of ways to improve these numbers, so they could be better in the future with a bit more work on optimizing. Given that strict contracts actually change the big O notation I think that this is a reasonable performance price to pay, given that data structures with more than 60 elements are fairly common. Does it make sense to try to find the break-even point for a program that, say, makes two passes over the data-structure? Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Machinery for eliding contracts
You also can't protect against someone using the FFI to fake whatever value you thought was safe. I think your best bet here is to document what you're doing any why you're doing it and then treat uses of some primitive things (like directly constructing blame records in this case) as unsafe operations. Robby On Fri, Jun 13, 2014 at 10:32 AM, Eric Dobson eric.n.dob...@gmail.com wrote: I believe thats what I need for the optimization-half, but I don't think it allows for soundly implementing the optimizations. I still don't see how to test if a value came from TR instead of someone trying to fake that, especially if they can get the blame object from one export and reuse it on a different value. On Fri, Jun 13, 2014 at 6:29 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Okay, I'll push has-blame? and value-blame. Let me know if there are any problems. Robby On Fri, Jun 13, 2014 at 5:59 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Yes, I think this would allow all the optimizations that Eric talked about. Sam On Jun 13, 2014 4:26 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Would it be useful to get blame information back from a value, just like you can currently get the contract back? Robby On Tue, Jun 10, 2014 at 11:53 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: I was thinking of associating the contract with the type from which it comes and no that's not hash-consing. And if it's slower, too bad. -- Matthias On Jun 10, 2014, at 12:47 PM, Eric Dobson eric.n.dob...@gmail.com wrote: On Tue, Jun 10, 2014 at 6:15 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: On Jun 9, 2014, at 6:02 PM, Eric Dobson eric.n.dob...@gmail.com wrote: Eric, are you talking about changing the proxy values that wrap HO/mutable contracted values? Yes. I want the proxy values to include information about who agreed to the contract in addition to the contract agreed to. I actually realize that I might need more than just the contract agreed to because of how TR changes the generated contract to remove checks for what it guarantees, so that info is not in the contract. But I believe that can be added back as a structure property on the contract. Would some form of hash-consing contracts work here? -- Matthias I don't think so. But not sure exactly what you are proposing. The issue is that there are 4 contracts here and 2 of them currently do not exist at runtime. The 4 are TRs checks/promises on an export/import. (Using import for a value flowing into an exported function). The promise contracts do not currently exist as removing them was my previous optimization (They never fail). What I want to do is change the check on import from (array/c symbol?) to (if/c (protected? (array/c symbol?)) any/c (array/c symbol?)). Where (protected? x/c) checks if TR already promised something stronger than x/c. I believe that you are proposing that we can use the identity of the contract returned by value-contract to determine what the promised contract would have been. This does not work as (Array Symbol) and (Array Float) both get translated to (array/c any/c) for export, and we would want to lookup different promised contracts for them. We could use weak hash map as an extra field but that seems like it would be slow. _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Machinery for eliding contracts
Am I right that the contract on 'f' is actually (- symbol? any)? And if so, where is the information coming from that lets you elide the check? One idea for this particular case: make 'g' be a macro that inspects its argument and if it see obvious things like this, then it can expand into a call to an unprotected use of 'g' instead of the protected one. I'm not sure how general this would be, tho, but it has two advantages: a) it can be done at compile time and b) it doesn't need to deal with arbitrary contracts, only the ones generated by types. Does that approach seem to have enough merit? Robby On Mon, Jun 9, 2014 at 2:19 AM, Eric Dobson eric.n.dob...@gmail.com wrote: One of the slowest parts when using TR is the contract boundary between untyped and typed code. Even with recent changes it still causes a large overhead. Example: #lang racket/load (module lib typed/racket (provide f g) (: f (Symbol - (Boxof Symbol))) (define (f x) (box x)) (: g ((Boxof Symbol) - Symbol)) (define (g x) (unbox x))) (module user-1 racket (provide go1) (require 'lib) (define (go1) (for ((i (in-range 20))) (g (f 'x) (module user-2 typed/racket (provide go2) (require 'lib) (define (go2) (for ((i (in-range 1))) (g (f 'x) (require 'user-1 'user-2) (for ((j 5)) (time (go1)) (time (go2))) It would be nice if the contract on the input to g could be elided. It seems like this could be done by using something like prop:contracted but that allowed accessing the parties that agreed to the contract. I'm imagining something like (lambda (v) (and (has-contract? v) (contracted-value-providing-side=? v 'the-typed-world) (contract-stronger? (value-contract v) new-contract))) One issue I see is that we need an unforgeable property that the value actually came from the typed world so we know that eliding the new contract is safe. Does this seem like a reasonable thing to support/do people see issues with it? Other related ideas I had were: A similar thing could be done if the same contract were being applied multiple times with the same blame parties. In that case the later contracts could be elided because they would error out in exactly the same cases with exactly the same messages. That in addition to not applying the new contract if it is weaker than the old contract, we remove the old contract (and access the unprotected value) if the new contract is stronger. In the case that they were the same contract this would mean that there would be no higher order contract checks while the typed code was executing. _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Machinery for eliding contracts
On Mon, Jun 9, 2014 at 8:35 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Mon, Jun 9, 2014 at 5:48 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Am I right that the contract on 'f' is actually (- symbol? any)? And if so, where is the information coming from that lets you elide the check? No, the `(boxof symbol?)` contract has to be kept around because of mutability. One idea for this particular case: make 'g' be a macro that inspects its argument and if it see obvious things like this, then it can expand into a call to an unprotected use of 'g' instead of the protected one. I'm not sure how general this would be, tho, but it has two advantages: a) it can be done at compile time and b) it doesn't need to deal with arbitrary contracts, only the ones generated by types. Does that approach seem to have enough merit? I don't understand how this is supposed to work. If `g` was a macro, how would it know that `f` was something it could specialize on? Would every TR export also have some static information about its contract so that macros like `g` could recognize them? Well, I was thinking it would have static information about its type, actually. But yes. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Machinery for eliding contracts
On Mon, Jun 9, 2014 at 8:38 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Mon, Jun 9, 2014 at 3:19 AM, Eric Dobson eric.n.dob...@gmail.com wrote: It would be nice if the contract on the input to g could be elided. It seems like this could be done by using something like prop:contracted but that allowed accessing the parties that agreed to the contract. I'm imagining something like (lambda (v) (and (has-contract? v) (contracted-value-providing-side=? v 'the-typed-world) (contract-stronger? (value-contract v) new-contract))) One issue I see is that we need an unforgeable property that the value actually came from the typed world so we know that eliding the new contract is safe. Does this seem like a reasonable thing to support/do people see issues with it? It seems like this could be simplified a little just by allowing contract parties to be compared. IOW, at the point where you're writing that function, we have two contracts, and we need to know if the negative party of one is the positive party of the other. Then you don't need to worry about unforgeability, I think. Yes, I think you'd just need to compare the blame parties (and equal? should be fine for that). Altho you would need to know that the contract came from the contract library to trust it, but that trust would be built into the contract-stronger? predicate. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Machinery for eliding contracts
On Mon, Jun 9, 2014 at 8:35 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Mon, Jun 9, 2014 at 5:48 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Am I right that the contract on 'f' is actually (- symbol? any)? And if so, where is the information coming from that lets you elide the check? No, the `(boxof symbol?)` contract has to be kept around because of mutability. Ah, right. Thanks. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #28706: master branch updated
(or/c #f x) seems better than maybe/c because it is nearly the same length and it is one less thing to memorize (and it's not like single-point of control applies here because this can never change). Robby On Thu, May 8, 2014 at 6:17 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: (We have maybe/c somewhere, and I think we should use it.) On May 8, 2014, at 4:19 PM, sa...@racket-lang.org wrote: samth has updated `master' from 98ae3d8b2d to e1ab2ffcf4. http://git.racket-lang.org/plt/98ae3d8b2d..e1ab2ffcf4 =[ One Commit ]= Directory summary: 100.0% pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/infer/ ~~ e1ab2ff Sam Tobin-Hochstadt sa...@cs.indiana.edu 2014-05-08 16:18 : | Fix contract. | | First bug caught with new test. Thanks Robby! : M .../typed-racket-lib/typed-racket/infer/infer-unit.rkt | 2 +- =[ Overall Diff ]=== pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/infer/infer-unit.rkt ~ --- OLD/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/infer/infer-unit.rkt +++ NEW/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/infer/infer-unit.rkt @@ -360,7 +360,7 @@ (Type/c Type/c . - . (or/c #f cset?)) (cgen V X Y S T)) (define/cond-contract (cg/inv S T) - (Type/c Type/c . - . cset?) + (Type/c Type/c . - . (or/c #f cset?)) (cgen/inv V X Y S T)) ;; this places no constraints on any variables in X (define empty (empty-cset X Y)) _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] A strange problem with namespaces
When I look at this code I can't figure out why (submod weird.rkt evaluator) _isn't_ available at phase 0! Could this be a bug? Robby On Wed, May 7, 2014 at 9:11 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: This program: https://gist.github.com/samth/e7b55fcef66da9b8416a works when line 33 is uncommented, otherwise it gives the error: ?: module mismatch; attempted to use a module that is not available possible cause: using (dynamic-require #f) but need (dynamic-require 0) module: (submod weird.rkt evaluator) phase: 0 in: phase1-phase0-run context...: weird.rkt: [running body] From reading the docs on `dynamic-require`, I can see that `(dynamic-require m 'f)` doesn't make anything available for higher phases. However, the actual `dynamic-require` in the program is just for a function -- the need for higher phases is an implementation detail that's leaking in because it doesn't behave like a regular value wrt `dynamic-require`. Is there something I can change in the implementation of the internals of `f` so that clients of `f` don't need to do the extra `(dynamic-require m 0)` in order for `f` to work? Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] A strange problem with namespaces
Yes, I've read those docs many times. :) I'll also note that changing the require in 'f' to this doesn't help, which seems suspicious: (require (submod .. evaluator) (for-meta 0 (submod .. evaluator)) (for-meta 1 (submod .. evaluator)) (for-meta 2 (submod .. evaluator)) (for-meta 3 (submod .. evaluator)) (for-meta 4 (submod .. evaluator)) (for-meta 5 (submod .. evaluator)) (for-meta -1 (submod .. evaluator)) (for-meta -2 (submod .. evaluator)) (for-meta -3 (submod .. evaluator)) (for-meta -4 (submod .. evaluator)) (for-meta -5 (submod .. evaluator))) On Wed, May 7, 2014 at 9:31 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: Well, to quote from the docs for `dynamic-require`: When provided is a symbol, the value of the module’s export with the given name is returned, and still the module is not visited or made available in higher phases. That's why I think the extra line is needed. You're right that the error message refers to phase 0, but I'm not sure who's phase 0 that is. Sam On Wed, May 7, 2014 at 10:27 AM, Robby Findler ro...@eecs.northwestern.edu wrote: When I look at this code I can't figure out why (submod weird.rkt evaluator) _isn't_ available at phase 0! Could this be a bug? Robby On Wed, May 7, 2014 at 9:11 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: This program: https://gist.github.com/samth/e7b55fcef66da9b8416a works when line 33 is uncommented, otherwise it gives the error: ?: module mismatch; attempted to use a module that is not available possible cause: using (dynamic-require #f) but need (dynamic-require 0) module: (submod weird.rkt evaluator) phase: 0 in: phase1-phase0-run context...: weird.rkt: [running body] From reading the docs on `dynamic-require`, I can see that `(dynamic-require m 'f)` doesn't make anything available for higher phases. However, the actual `dynamic-require` in the program is just for a function -- the need for higher phases is an implementation detail that's leaking in because it doesn't behave like a regular value wrt `dynamic-require`. Is there something I can change in the implementation of the internals of `f` so that clients of `f` don't need to do the extra `(dynamic-require m 0)` in order for `f` to work? Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] A strange problem with namespaces
Oh! So the evaluator module is available in phase 0 in 'ns', but not in 'namespace'. Is that right? Robby On Wed, May 7, 2014 at 9:58 AM, Matthew Flatt mfl...@cs.utah.edu wrote: I think the right change might be (module evaluator racket (define (prep!) (parameterize ([current-namespace namespace]) (dynamic-require (variable-reference-module-path-index (#%variable-reference)) 0))) (define-syntax phase1-phase0-eval (syntax-parser [(_ form:expr ...) #'(begin (prep!) (eval-syntax .))]))) The `prep!` function ensures that the enclosing module is available. At Wed, 7 May 2014 10:11:49 -0400, Sam Tobin-Hochstadt wrote: This program: https://gist.github.com/samth/e7b55fcef66da9b8416a works when line 33 is uncommented, otherwise it gives the error: ?: module mismatch; attempted to use a module that is not available possible cause: using (dynamic-require #f) but need (dynamic-require 0) module: (submod weird.rkt evaluator) phase: 0 in: phase1-phase0-run context...: weird.rkt: [running body] From reading the docs on `dynamic-require`, I can see that `(dynamic-require m 'f)` doesn't make anything available for higher phases. However, the actual `dynamic-require` in the program is just for a function -- the need for higher phases is an implementation detail that's leaking in because it doesn't behave like a regular value wrt `dynamic-require`. Is there something I can change in the implementation of the internals of `f` so that clients of `f` don't need to do the extra `(dynamic-require m 0)` in order for `f` to work? Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [racket] lab notebook on learning process (was: Re: Macros baffle me)
I don't think those are the things being complained about. I read a complaint about non-incremental GC, a complaint about DrRacket IO (which is really quite slow because it uses an editor which is overkill for a stream of text), possibly a complaint about the FFI (but maybe there's more there?). And, possibly even hiding in there is the usual complaint about scrolling. There's lots of work to do. :) Robby On Tue, May 6, 2014 at 12:43 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote: On Tue, May 6, 2014 at 12:14 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: Why does he think Performance sucks? Because here's the list of things that are slow DrRacket is an operating system running on top of your other OS to make life for Racket developers simple. It was originally developed for beginners, but I eat my own dog food, and I find it good (tm) for every day Racket work. To evaluate performance, run the programs at the command line. Measure there. Compare with other dynamically typed languages and report back what you find. If you still report performance problems, try to be precise. We are proud of Matthew and how far he has pushed Racket's performance on real software, the kind you use on a daily basis, not just minibenchmarks. I think ultimately that this answer isn't enough. If everyone who tries out Racket in the way we suggest comes away with the impression that it's really slow, suggestions on the mailing list to measure differently won't eliminate the negative first impression, let alone for all the people who _don't_ ask about it. Could we - warn people when they use `time` in DrRacket? - provide a performance mode that runs programs out-of-process, or just in another place? - something else? Sam _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] make gets hung up building documentation
thanks. Unfortunately I cannot reproduce this on my machine but the thing I would do if I could would be to start putting printfs in to try to find a smaller programs that gets stuck. Robby On Sunday, May 4, 2014, Geoffrey S. Knauth ge...@knauth.org wrote: On May 4, 2014, at 16:44 , Robby Findler ro...@eecs.northwestern.edujavascript:; wrote: That suggests to me that it is running of the of the examples in /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc/scribblings/guide/let.scrbl that's causing the problem. Does this terminate: $ racket -l scribblings/guide/let.scrbl While I watched two rabbits run in circles in the backyard and observed another rabbit ignore that race condition to bound across the neighbors', no dogs in sight, I let things get good and stuck, then I pressed ^C. Here sir, is your error trace: $ pwd /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc $ racket -l scribblings/guide/let.scrbl ^Cuser break context...: /Users/gknauth/test/plt/git/plt/pkgs/sandbox-lib/racket/sandbox.rkt:883:2: user-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:399:0: do-plain-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:261:2 /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:550:0: do-titled-interaction /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc/scribblings/guide/let.scrbl: [running body] _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] make gets hung up building documentation
The stack traces suggest it is in that one file. So if you open it up and put a printf right before each example and then see when the printfs stop, that'll probably tell us something good. You'd want to look for each place where there is an example (compare the documentation itself to the source) and then put something like @(printf 1\n) right before each of them. Or maybe do binary search. :) Robby On Sun, May 4, 2014 at 5:13 PM, Geoffrey S. Knauth ge...@knauth.org wrote: I'm happy to insert printfs in my tree if you tell me where. --Geoff On May 4, 2014, at 17:33 , Robby Findler ro...@eecs.northwestern.edu wrote: thanks. Unfortunately I cannot reproduce this on my machine but the thing I would do if I could would be to start putting printfs in to try to find a smaller programs that gets stuck. Robby On Sunday, May 4, 2014, Geoffrey S. Knauth ge...@knauth.org wrote: On May 4, 2014, at 16:44 , Robby Findler ro...@eecs.northwestern.edu wrote: That suggests to me that it is running of the of the examples in /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc/scribblings/guide/let.scrbl that's causing the problem. Does this terminate: $ racket -l scribblings/guide/let.scrbl While I watched two rabbits run in circles in the backyard and observed another rabbit ignore that race condition to bound across the neighbors', no dogs in sight, I let things get good and stuck, then I pressed ^C. Here sir, is your error trace: $ pwd /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc $ racket -l scribblings/guide/let.scrbl ^Cuser break context...: /Users/gknauth/test/plt/git/plt/pkgs/sandbox-lib/racket/sandbox.rkt:883:2: user-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:399:0: do-plain-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:261:2 /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:550:0: do-titled-interaction /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc/scribblings/guide/let.scrbl: [running body] _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] make gets hung up building documentation
Okay, that's just bizarre. If this were my machine, the next step I'd take would be to make a copy of that file and start throwing stuff out of it (running it at the command-line, not in drracket) until I got very small and and still had the bad behavior. Like start by throwing away everything after the quoted part below. Robby PS: thanks for taking this on! On Sun, May 4, 2014 at 6:11 PM, Geoffrey S. Knauth ge...@knauth.org wrote: Does this help? --Geoff $ racket -l scribblings/guide/let.scrbl GSK-1 GSK-2 C-c C-cuser break context...: /Users/gknauth/test/plt/git/plt/pkgs/sandbox-lib/racket/sandbox.rkt:883:2: user-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:399:0: do-plain-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:261:2 /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:550:0: do-titled-interaction /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc/scribblings/guide/let.scrbl: [running body] - @(printf GSK-2\n) @examples[ (let* ([x (list Borroughs)] [y (cons Rice x)] [z (cons Edgar y)]) (list x y z)) (let* ([name (list Borroughs)] [name (cons Rice name)] [name (cons Edgar name)]) name) ] On May 4, 2014, at 18:30 , Robby Findler ro...@eecs.northwestern.edu wrote: The stack traces suggest it is in that one file. So if you open it up and put a printf right before each example and then see when the printfs stop, that'll probably tell us something good. You'd want to look for each place where there is an example (compare the documentation itself to the source) and then put something like @(printf 1\n) right before each of them. Or maybe do binary search. :) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] make gets hung up building documentation
Oh! Well that code is clearly broken! I guess you have a cyclic symbolic link in your temporary directory? Or maybe just a ton of stuff? Unless you want to, I'll push a change somehow or other. Robby On Sun, May 4, 2014 at 7:09 PM, Geoffrey S. Knauth ge...@knauth.org wrote: On May 4, 2014, at 19:20 , Robby Findler ro...@eecs.northwestern.edu wrote: start throwing stuff out of it (running it at the command-line, not in drracket) until I got very small and and still had the bad behavior. I'm already small and have bad behavior, but I get your point. PS: thanks for taking this on! Thanks for firing up my teenager with [now] Typed Racket, which caused me to need to update my not-that-old Racket 6 to keep up with him. OK, here's what I got this time. If I take out the stuff between GSK-2h and GSK-2h1 below, the file processes normally. $ racket -l scribblings/guide/let.scrbl GSK-1 GSK-2 GSK-2a GSK-2b GSK-2c GSK-2d GSK-2e GSK-2f GSK-2g GSK-2h C-c C-cuser break context...: /Users/gknauth/test/plt/git/plt/pkgs/sandbox-lib/racket/sandbox.rkt:883:2: user-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:399:0: do-plain-eval /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:261:2 /Users/gknauth/test/plt/git/plt/pkgs/scribble-pkgs/scribble-lib/scribble/eval.rkt:550:0: do-titled-interaction /Users/gknauth/test/plt/git/plt/pkgs/racket-pkgs/racket-doc/scribblings/guide/let.scrbl: [running body] @(printf GSK-2h\n) @interaction[ (letrec ([tarzan-in-tree? (lambda (name path) (or (equal? name tarzan) (and (directory-exists? path) (tarzan-in-directory? path] [tarzan-in-directory? (lambda (dir) (ormap (lambda (elem) (tarzan-in-tree? (path-element-string elem) (build-path dir elem))) (directory-list dir)))]) (tarzan-in-tree? tmp (find-system-path 'temp-dir))) ] @(printf GSK-2h1\n) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] make gets hung up building documentation
Thanks for figuring this out! Robby On Sun, May 4, 2014 at 7:30 PM, Geoffrey S. Knauth ge...@knauth.org wrote: I'm happy to say that with that particular @interaction[...] deleted, the rest of the build completed quickly and I now have a working DrRacket 6.0.1.6. Geoff _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] requested package not available: draw-x86_64-macosx-2
Just a guess but maybe git submodule update? On Saturday, May 3, 2014, David Van Horn dvanh...@cs.umd.edu wrote: I just did a git pull and make and get the following error: racket/bin/racket -U -G build/config racket/src/link-all.rkt ++dir pkgs ++dir native-pkgs --save main-distribution plt-services racket-lib Linking packages: plt-services racket-lib main-distribution Recording packages choice in racket/etc/link-pkgs.rktd Finding packages link-all: requested package not available: draw-x86_64-macosx-2 context...: /Users/dvanhorn/git/racket/racket/src/link-all.rkt:155:6: for-loop /Users/dvanhorn/git/racket/racket/src/link-all.rkt:153:2: loop /Users/dvanhorn/git/racket/racket/src/link-all.rkt: [running body] make[2]: *** [pkg-links] Error 1 make[1]: *** [plain-in-place] Error 2 make: *** [in-place] Error 2 Any ideas how to fix this? David _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.0.1
The ones near my name: - Check Syntax cooperates with Typed Racket to show arrows and other Check Syntax highlighting even when there is a type error - Functions provided via contract-out that have first-order contracts perform better Robby On Thu, May 1, 2014 at 12:49 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: The release announcement sketch that I have so far is below. Please mail me new items and/or edits. -- mflatt: - 2x bitmaps (037a211f, e47a90cc, etc); file/convertible (eda4f357) - retina displays (7dc63162) - dc alignment scale (582e9925) - bignum performance (780d6ae5) - added syntax/wrap-modbeg (bfda0665) - treat FFI primitives like other primitives (eff53cde) - add PLTUSERHOME (e4ce0d03) - fix bignum allocation (efa19918) - add racket/undefined (8abf7825, 74f82bbd) robby: - check syntax info even with syntax errors (09920bd8) - contract system change, more first-order-friendly (c321f6dd) - class/c changes (2989918a, 7bec967c, 4f65d57f, 59f57b1b) vincent: - contract profiler (cc0e6763, 7495243d, etc) - make f[lx]vectors sequences (8e32e6e4) asumu: - TR :-less syntax (e6e3ab4e, 45d36579, 37b09521, etc) - explain/warn about Class types? - TR recursive type aliases (a8cc430d) samth: - web pages? (154b5453, etc) neil: - plot 3D BSP tree (a515e7ce) - PDF/PS scaling changed to 1.0x1.0 (efc46ded) -- _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.0.1
On Thu, May 1, 2014 at 8:44 PM, Eric Dobson eric.n.dob...@gmail.com wrote: 6f56948cff75dd4497b742ae01cd5df18c654e6f - The contract boundary between typed/untyped modules is much less expensive. This one plus the one on the contract system side should probably be combined into a single bullet item: - the boundary between Typed Racket and Racket program is now much less expensive because of improvements in TR's contract generation and improvements in the contract system's support for first-order contracts Robby dd8b646b0b3a0fd7905467f275f0f786eac958dd - Occurrence typing now works better with when/unless. Example: (let ((x (read))) (unless (number? x) (error 'bad-input)) (add1 x)) On Thu, May 1, 2014 at 2:16 PM, Neil Toronto neil.toro...@gmail.com wrote: On 05/01/2014 11:49 AM, Ryan Culpepper wrote: The release announcement sketch that I have so far is below. Please mail me new items and/or edits. -- neil: - plot 3D BSP tree (a515e7ce) - PDF/PS scaling changed to 1.0x1.0 (efc46ded) - Plot correctly renders intersecting 3D graphs and non-grid-aligned 3D rectangles. - Elements in plots output in PDF/PS format have the same relative scale as in other formats. In particular, it is not necessary to adjust `plot-font-size` to make PDF plots look the same as PNG. Neil _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] actionable items, was: comments on comments on learning Racket
On Monday, April 28, 2014, Matthias Felleisen matth...@ccs.neu.edu wrote: So far we have had two threads of reactions to my 'comments on comments.' They have produced requests that I consider actionable items though I have counter-proposal to some of them. The list below does not include other actionable items I had on my list that did not get comments. With credit: * SAM suggests to always start in #lang racket. Tell students to switch to #lang htdp/bsl or use Choose Language. I think this is plain unfriendly to our largest audience. Here is my counter-proposal: when drracket starts w/o a preference file, we pop up a radio menu: o Are you a student learning to program? o Are you an experienced programmer learning to use Racket? Depending on which bullet the person checks, drracket starts in BSL [#lang htdp/bsl, one day soon] or #lang racket. So you are asking to go back to the way it was before we added the not a language language? Robby * LAURENT asks for: ~~ faster re-indentation of last files. Will pre-computations help or is the display on the screen the bottleneck? ~~ the language selection menu should also be available from the general preference dialog ~~ the following MV functions: ~~ what names should they receive? ~~ where should they and their tests go? ;; (X ... - Y ...) X *- [List-of Y] ;; gather the return MVs from (apply f s) in a list (module+ test (check-equal? (gather-return-values (lambda () (values 1 2))) (list 1 2)) (check-equal? (gather-return-values (lambda (x) (values 1 x)) 2) (list 1 2)) (check-equal? (gather-return-values (lambda (x y) (values y x)) 2 1) (list 1 2))) (define (gather-return-values f . s) (call-with-values (lambda () (apply f s)) list)) ;; Nat (X ... - Y ...) X *- Y ;; pick the i-th return value from a bunch of MVs (module+ test (check-equal? (nth-return-value 0 (lambda () (values 1 2))) 1) (check-equal? (nth-return-value 0 (lambda (x) (values 1 x)) 2) 1) (check-equal? (nth-return-value 0 (lambda (x y) (values y x)) 2 1) 1)) (define (nth-return-value i f . s) (call-with-values (lambda () (apply f s)) (lambda l (list-ref l i ~~ macros should come with 'meta information' such as indentation; sub-modules may enable this; probably a research topic (well, I no longer have a macrologist in the group) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Refactoring Idea
I guess this would work best if DrRacket were given a package (and it could infer the current package from the location of the file being edited). So if someone wants to implement a function that, given a package spec and a renaming and then does the work, I'd be happy to try to integrate it into DrRacket proper. Also: does the renaming should mean rewrite the files on the disk and rewrite the files that are open in DrRacket and there is some interesting questions when the file is open and the save file isn't up to date. DrRacket can easily supply a list of text% objects that correspond to open files, however (and they can be queried to find out if they are saved or what their content is, etc). Robby On Mon, Apr 28, 2014 at 9:40 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: From time to time the topic of refactoring pop up on the mailing list. Here is one feature I'd like: After renaming an exported identifier in a module foo, any references to the identifier in external modules need to be renamed too. DrRacket could after renaming in foo is done, ask for a folder in which to search for module that require foo and rename the identifier in those modules. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Refactoring Idea
But giving drracket a list of packages is probably a very useful special case and the rename in the package I'm in is even yet more useful special case, especially when the file is a private module. Robby On Mon, Apr 28, 2014 at 10:20 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: This is one of those places where our desire to not include extra-linguistic mechanisms conflicts with our desire to support our programmers. I have had this idea many times, as I am sure have many others and Jens probably had it tons of times over the years. Even a package isn't enough because one might have client modules somewhere else. On Apr 28, 2014, at 11:03 AM, Robby Findler ro...@eecs.northwestern.edu wrote: I guess this would work best if DrRacket were given a package (and it could infer the current package from the location of the file being edited). So if someone wants to implement a function that, given a package spec and a renaming and then does the work, I'd be happy to try to integrate it into DrRacket proper. Also: does the renaming should mean rewrite the files on the disk and rewrite the files that are open in DrRacket and there is some interesting questions when the file is open and the save file isn't up to date. DrRacket can easily supply a list of text% objects that correspond to open files, however (and they can be queried to find out if they are saved or what their content is, etc). Robby On Mon, Apr 28, 2014 at 9:40 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: From time to time the topic of refactoring pop up on the mailing list. Here is one feature I'd like: After renaming an exported identifier in a module foo, any references to the identifier in external modules need to be renamed too. DrRacket could after renaming in foo is done, ask for a folder in which to search for module that require foo and rename the identifier in those modules. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] we are suspect!
From my mac os x machine's console log. 4/22/14 1:04:44.000 PM kernel[0]: process DrRacket[32404] thread 8646879 caught burning CPU! It used more than 50% CPU (Actual recent usage: 73%) over 180 seconds. thread lifetime cpu usage 346.323259 seconds, (330.726984 user, 15.596275 system) ledger info: balance: 90003311389 credit: 345842286824 debit: 255838975435 limit: 900 (50%) period: 1800 time since last refill (ns): 122884431728 ... that's just online check syntax plus syntax coloring, afaict. :) Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Catching the undefined value
These seem correct to me. What were you expecting (and why?). Robby On Saturday, April 19, 2014, Gustavo Massaccesi gust...@oma.org.ar wrote: I found another problem with the optimizer and the new undefined behavior. (letrec ([x (if #t 8 x)]) x) ;==8 I also consider this correct in a strange sense :). Gustavo Welcome to Racket v6.0.1.4. (letrec ([x x]) x) x: undefined; cannot use before initialization context...: C:\Program Files\Racket-6.0.1.4\collects\racket\private\misc.rkt:87:7 (letrec ([x 5]) x) 5 (letrec ([x (if #t 8 x)]) x) 8 (letrec ([x (if #f 8 x)]) x) x: undefined; cannot use before initialization context...: C:\Program Files\Racket-6.0.1.4\collects\racket\private\misc.rkt:87:7 On Wed, Apr 16, 2014 at 10:09 AM, Matthias Felleisen matth...@ccs.neu.edu javascript:; wrote: Ah, too bad: pkgs/racket-pkgs/racket-test/tests/racket/optimize.rktl ~~~ --- OLD/pkgs/racket-pkgs/racket-test/tests/racket/optimize.rktl +++ NEW/pkgs/racket-pkgs/racket-test/tests/racket/optimize.rktl @@ -3416,5 +3416,16 @@ (read (open-input-bytes (get-output-bytes o)) ;; +;; Check that an unsufe opertion's argument is +;; not optimized away if it's a use of +;; a variable before definition: + +(err/rt-test (let () + (unsafe-fx+ x 1) + (define x 3) + x) + exn:fail:contract:variable?) + +;; :-) On Apr 16, 2014, at 9:02 AM, Matthias Felleisen matth...@ccs.neu.edujavascript:; wrote: On Apr 15, 2014, at 9:29 PM, Asumu Takikawa as...@ccs.neu.edujavascript:; wrote: On 2014-04-15 18:13:31 -0400, claire alvis wrote: The push below includes changes to letrec expressions, internal definitions, units, classes, and certain ill-formed shared expressions so that they no longer leak the `undefined' value. This is great! (especially happy that TR, even with classes, doesn't have to worry about #undefined anymore) BTW, I found this weird behavior: Welcome to Racket v6.0.1.3. - (require racket/unsafe/ops) - (let () (+ x 3) (define x 3) 5) ; x: variable used before its definition [,bt for context] - (let () (unsafe-fx+ x 3) (define x 3) 5) 5 I consider this correct in a strange sense. Interestingly enough, (let () (displayln (unsafe-fx+ x 3)) (define x 3) 5) x: variable used before its definition context...: /Users/matthias/plt/racket/collects/racket/private/misc.rkt:87:7 which is good too. I don't know how Claire and Matthew did this, but it's good :-) _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Catching the undefined value
Ah. There are other approaches to this problem that result in compile-time errors for such programs. Maybe the TR guys will adopt one or figure out a better one! But for regular ole Racket, we're stuck with a runtime error, I'm afraid. Robby On Sat, Apr 19, 2014 at 2:04 PM, Gustavo Massaccesi gust...@oma.org.ar wrote: (letrec ([x (if #t 8 x)]) x) ;==8 It was a mistake. I thought that the “x: undefined; ...” error was an expansion-time error, not a run-time error. (I expected an error, because the x in the else part is “undefined”, even if it’s never accessed.) Gustavo On Sat, Apr 19, 2014 at 1:02 PM, Robby Findler ro...@eecs.northwestern.edu wrote: These seem correct to me. What were you expecting (and why?). Robby On Saturday, April 19, 2014, Gustavo Massaccesi gust...@oma.org.ar wrote: I found another problem with the optimizer and the new undefined behavior. (letrec ([x (if #t 8 x)]) x) ;==8 I also consider this correct in a strange sense :). Gustavo Welcome to Racket v6.0.1.4. (letrec ([x x]) x) x: undefined; cannot use before initialization context...: C:\Program Files\Racket-6.0.1.4\collects\racket\private\misc.rkt:87:7 (letrec ([x 5]) x) 5 (letrec ([x (if #t 8 x)]) x) 8 (letrec ([x (if #f 8 x)]) x) x: undefined; cannot use before initialization context...: C:\Program Files\Racket-6.0.1.4\collects\racket\private\misc.rkt:87:7 On Wed, Apr 16, 2014 at 10:09 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: Ah, too bad: pkgs/racket-pkgs/racket-test/tests/racket/optimize.rktl ~~~ --- OLD/pkgs/racket-pkgs/racket-test/tests/racket/optimize.rktl +++ NEW/pkgs/racket-pkgs/racket-test/tests/racket/optimize.rktl @@ -3416,5 +3416,16 @@ (read (open-input-bytes (get-output-bytes o)) ;; +;; Check that an unsufe opertion's argument is +;; not optimized away if it's a use of +;; a variable before definition: + +(err/rt-test (let () + (unsafe-fx+ x 1) + (define x 3) + x) + exn:fail:contract:variable?) + +;; :-) On Apr 16, 2014, at 9:02 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: On Apr 15, 2014, at 9:29 PM, Asumu Takikawa as...@ccs.neu.edu wrote: On 2014-04-15 18:13:31 -0400, claire alvis wrote: The push below includes changes to letrec expressions, internal definitions, units, classes, and certain ill-formed shared expressions so that they no longer leak the `undefined' value. This is great! (especially happy that TR, even with classes, doesn't have to worry about #undefined anymore) BTW, I found this weird behavior: Welcome to Racket v6.0.1.3. - (require racket/unsafe/ops) - (let () (+ x 3) (define x 3) 5) ; x: variable used before its definition [,bt for context] - (let () (unsafe-fx+ x 3) (define x 3) 5) 5 I consider this correct in a strange sense. Interestingly enough, (let () (displayln (unsafe-fx+ x 3)) (define x 3) 5) x: variable used before its definition context...: /Users/matthias/plt/racket/collects/racket/private/misc.rkt:87:7 which is good too. I don't know how Claire and Matthew did this, but it's good :-) _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Pre-Release Checklist for v6.0.1
That sounds like a good plan to me. Let us know what you find out. Robby On Fri, Apr 18, 2014 at 3:47 PM, Neil Toronto neil.toro...@gmail.com wrote: On 04/17/2014 04:44 PM, Ryan Culpepper wrote: * Neil Toronto neil.toro...@gmail.com - Plot Tests - Images Tests - Inspect icons - Math tests I found an infinite loop in Plot's new 3D engine, but I've only been able to replicate it using a randomized test case for a feature I haven't pushed yet. Even though that feature won't be in the upcoming release, there's definitely an error in the 3D engine that I don't want users stumbling into. If the Powers That Be don't mind, I'll concentrate on finding a repeatable test case, and check the rest of my list at the second call. Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Pre-Release Checklist for v6.0.1
On Thu, Apr 17, 2014 at 5:44 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: * Robby Findler ro...@eecs.northwestern.edu - DrRacket Tests All but populate-compiled.rkt, which uncovered the need for commit fe2c796c41154. Can you please include it in the release branch? - Framework Tests - Contracts Tests - Games Tests - Teachpacks Tests: image tests - PLaneT Tests - Redex Tests Updates: - DrRacket Updates: update HISTORY - Redex Updates: update HISTORY (updates should show v6.0.1 as the most current version) - Ensure that previous version of DrRacket's preference files still starts up with new DrRacket - Update man pages in racket/man/man1: drracket.1 Email me to pick the changes when they're done, or tell me if there are no such changes. One commit marked for the release notes update. With the exception of the populate-compiled.rkt test (as above), done. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] planet bug tracking system spam
I think that the problem Neil is having with it is the ridiculous amount of spam that gets trapped inside it. (But correct me if I'm wrong, Neil!) So maybe we can work around the problem another way if others find it still has value. Robby On Mon, Apr 14, 2014 at 11:46 AM, Doug Williams m.douglas.willi...@gmail.com wrote: I use it and have not migrated to Github. But, it is no biggie for me one way or the other. On Sun, Apr 13, 2014 at 5:17 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Does anyone else find it has value? Robby On Sunday, April 13, 2014, Neil Van Dyke n...@neilvandyke.org wrote: Can the PLaneT bug-tracking system be shut down, please? (I have never wanted my packages to be in the PLaneT bug-tracking system. It has never been anything for me but counterproductive and annoying. It was not there when I first added my packages to PLaneT. I really-really want to opt-out of it. But maybe whoever maintains it will decide that shutting it down is less work than adding an opt-out feature.) Neil V. _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev