[racket-users] Re: Apropos contracts: simple predicates and switching on and off

2017-05-02 Thread Daniel Prager
Thinking more about the functional context, a macro — say (define/pre-post ...) that cleanly defined the following functions would be pretty sweet (continuing with the real-sqrt example): - real-sqrt-unsafe - real-sqrt-with-pre-conditions - real-sqrt-with-pre-and-post-conditions -

Re: [racket-users] Speeding up graphics / moving away from 2htdp/image

2017-05-02 Thread WarGrey Gyoudmon Ju
Hello, I found an interesting thing. My conclusion was totally wrong since your example are written in Untyped Racket, the generated contracts eat all the seconds unconsciously. Timing your example in Typed Racket with my functional bitmap combiners: no optimizing, generating all 2500 bitmaps

Re: [racket-users] Re: Racket 6.9

2017-05-02 Thread James
I've been systematically looking at different Linux GUI environments, on and off, for a while now. I currently use macOS on both my desktop and laptop but have Linux and Windows virtual machines. I might switch to Linux for the host OS at some point. The thing I am finding to be lacking in

Re: [racket-users] Speeding up graphics / moving away from 2htdp/image

2017-05-02 Thread Daniel Prager
Hi Ju Interesting results. Did you run the Contract Profiler tool? [ http://docs.racket-lang.org/contract-profile/] I think it's fairly well understood that the contract-induced performance costs across the typed / untyped boundary can be severe. BTW: At the back of my mind is the thought that

[racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-02 Thread Daniel Prager
My concept of how (simple) contracts should work was influenced by the Bertrand Meyer / Eiffel approach and spent many years of rolling my own contracts in lesser languages to mimic this. The main things I found pragmatically useful were: 1. Being able to specify pre-conditions and

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-02 Thread Matthew Butterick
> On May 2, 2017, at 4:33 PM, Daniel Prager wrote: > > (define/pre-post (real-sqrt x) > #:pre ([(real? x) "real argument expected"] > [(>= x 0) "non-negative argument expected"]) > > #:implementation (sqrt x) > > #:post ([(implies (= x 0) (= result

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-02 Thread Philip McGrath
Here's the "quick" way I'd write the real-sqrt in Racket, combined with an illustration of one of the advantages of using the established contract combinators: here they gracefully report a kind of error that in the original would have caused an error in the error-checking code. (define/contract

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-02 Thread Ben Greenman
On Tue, May 2, 2017 at 11:43 PM, Daniel Prager wrote: > I kind of expected that it would be possible to do what I wanted with > "indy" contracts, but struggled with the heavy use of combinators in the > examples. Two offhand thoughts: 1. To practice with dependent

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-02 Thread Daniel Prager
Thanks Matthew That's very helpful. I definitely want to hook into the existing contract system if possible, and you've given some good pointers to how this might be done. I kind of expected that it would be possible to do what I wanted with "indy" contracts, but struggled with the heavy use of

[racket-users] Error reporting with (flat?) contracts

2017-05-02 Thread Philip McGrath
While trying to express in the contract system Daniel Prager's check that a possibly-buggy square root function actually returns the square root of its argument (and in particular the nice error messages, I ran into a few things that weren't quite as I expected. My first attempt, using

Re: [racket-users] Speeding up graphics / moving away from 2htdp/image

2017-05-02 Thread WarGrey Gyoudmon Ju
On Tue, May 2, 2017 at 8:02 PM, Daniel Prager wrote: > Hi Ju > > Interesting results. Did you run the Contract Profiler tool? [ > http://docs.racket-lang.org/contract-profile/] > > I think it's fairly well understood that the contract-induced performance > costs across

Re: [racket-users] Readtable extensions and syntax coloring in DrRacket

2017-05-02 Thread brendan
Hi Andrew. Thanks, I do know about the here string syntax, and it's part of why I'm not willing to put much effort into fixing the lexer. :) William, udelim is neat and may be useful for me, so thanks for mentioning it. On Monday, May 1, 2017 at 6:48:12 PM UTC-4, Andrew Gwozdziewycz wrote: > Hi

Re: [racket-users] Self evaluating Racket Interpreter

2017-05-02 Thread Matthias Felleisen
> On May 2, 2017, at 12:01 AM, circularba...@gmail.com wrote: > > I am somewhat reluctant to use structures as I want to keep the interpreter > as minimal as possible. Also, I'm not familiar enough with the semantics of > frames to implement it in interpreter.rkt. > > With regards to mcons

[racket-users] Re: Racket 6.9

2017-05-02 Thread George Neuner
On Mon, 1 May 2017 15:37:49 -0400, James wrote: >I've been systematically looking at different Linux GUI environments, >on and off, for a while now. I currently use macOS on both my >desktop and laptop but have Linux and Windows virtual machines. >I might switch to Linux