Your comment is not evidence that Typed Racket libraries are useful to
Racket programmers, but in fact the opposite.

Jay

On Tue, Jan 5, 2016 at 3:28 PM, Benjamin Greenman
<[email protected]> wrote:
> I'm afraid it's just O(n) contracts. For example:
>
> #lang racket/base
>
> (module stack typed/racket/base
>   (define-type Stack (Listof Integer))
>   (provide:
>     [create (-> Stack)]
>     [push (-> Integer Stack Stack)]
>     [pop  (-> Stack Stack)])
>
>   (define (create) '())
>   (define push cons)
>   (define pop cdr))
>
> (require 'stack contract-profile)
>
> (define (test)
>   (for/fold ([st (create)])
>             ([i (in-range 5000)])
>     (push i st))
>   (void))
>
> (contract-profile (time (test)))
> ;; Running time is 80.46% contracts
> ;; 70/87 ms
>
>
>
>
> On Tue, Jan 5, 2016 at 3:19 PM, Vincent St-Amour
> <[email protected]> wrote:
>>
>> (add1 Jay)
>>
>> That kind of overhead has to be a bug somewhere, or a bad way to write
>> something. I hope.
>>
>> Vincent
>>
>>
>>
>> On Tue, 05 Jan 2016 13:40:33 -0600,
>> Jay McCarthy wrote:
>> >
>> > I would prefer taking this useful library and making it actually
>> > useful to all Racket users.
>> >
>> > Jay
>> >
>> > On Tue, Jan 5, 2016 at 2:39 PM, 'John Clements' via Racket Users
>> > <[email protected]> wrote:
>> > > Asumu, does this make sense to you? Note that in particular, I think
>> > > that a warning at the top of the pfds package wouldn’t have helped me; I
>> > > think a warning at the top of each pfds page would make a lot more sense.
>> > >
>> > > John
>> > >
>> > >> On Jan 5, 2016, at 11:00 AM, Sam Tobin-Hochstadt
>> > >> <[email protected]> wrote:
>> > >>
>> > >> Yes, I think a warning at the top of the documentation for the `pfds`
>> > >> package would make sense, and probably Asumu would accept such a pull
>> > >> request. You might follow the phrasing in the math/array library.
>> > >>
>> > >> Sam
>> > >>
>> > >> On Tue, Jan 5, 2016 at 1:49 PM 'John Clements' via Racket Users
>> > >> <[email protected]> wrote:
>> > >> This program constructs a trie containing exactly two keys; each is a
>> > >> list of 256 integers. On my machine, it takes *twelve seconds*. The time
>> > >> taken appears to be n^2 in the length of the key, so doubling it to 256
>> > >> means it’ll take about a minute to add a key.
>> > >>
>> > >> #lang racket
>> > >>
>> > >> (require pfds/trie)
>> > >>
>> > >> (define (rand-list)
>> > >>   (for/list ([i (in-range 128)])
>> > >>     (random 256)))
>> > >>
>> > >> (define t (trie (list (rand-list))))
>> > >> (define u (time (bind (rand-list) 0 t)))
>> > >>
>> > >> When I translate this to typed racket, the time taken is 0 ms.
>> > >>
>> > >> I feel like I got a bit burned here, and an ordinary user might
>> > >> simply conclude that Racket libraries are teh suck.
>> > >>
>> > >> Can we add a warning to the beginning of the documentation page for
>> > >> Tries (and perhaps for the other data structures as well) indicating 
>> > >> that
>> > >> these functions are likely to be unusably slow in #lang racket?
>> > >>
>> > >> I propose the following, at the top of the documentation. Possibly in
>> > >> boldface.
>> > >>
>> > >> “NB: these data structures are written in Typed Racket. While they
>> > >> may be nominally usable in the (untyped) Racket language, the resulting
>> > >> dynamic checks will probably cause them to be unacceptably slow”
>> > >>
>> > >> Suggestions? May I make a pull request here?
>> > >>
>> > >> John
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> You received this message because you are subscribed to the Google
>> > >> Groups "Racket Users" group.
>> > >> To unsubscribe from this group and stop receiving emails from it,
>> > >> send an email to [email protected].
>> > >> For more options, visit https://groups.google.com/d/optout.
>> > >
>> > >
>> > >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > Groups "Racket Users" group.
>> > > To unsubscribe from this group and stop receiving emails from it, send
>> > > an email to [email protected].
>> > > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> >
>> > --
>> > Jay McCarthy
>> > Associate Professor
>> > PLT @ CS @ UMass Lowell
>> > 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."
>> >                           - D&C 64:33
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Racket Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to [email protected].
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>
>



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
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."
                          - D&C 64:33

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to