Hi Nota, The short answer is that Typed Racket generates contracts, and those contracts sometimes have significant overhead at run time.
In specific cases, sometimes Typed Racket can generate smarter contracts, because it knows that the typed code won't break the contract. But other times, it does a less good job of generating contracts than you can by hand, because it doesn't know everything about your program. Sam On Mon, Feb 29, 2016 at 2:01 PM, Nota Poin <notap...@gmail.com> wrote: > I'm not sure what the qualitative distinction is between contracts and Typed > Racket. They seem like two syntaxes for what mostly amount to the same thing. > Is it just a matter of implementation, or perhaps what their developers focus > on? You could in theory read through a list of contracts, and of the > contracts that guarantee the operation you want on the data you have, pick > the most efficient one. And that's what Typed Racket does for the most part, > I thought. > > Is it just that the algorithm for doing that with contracts hasn't been > written, so Typed Racket can't take advantage of it? Is it that contracts are > more general, not always necessarily contracts of functions that operate on > types? /Does/ Typed Racket actually have significant overhead, when compiling > perhaps? If not, would that overhead they mentioned about contracts be > eliminated if those contracts were only utilized to decide what function to > use, and not checked every time that function is called? > > Just something that was puzzling me in the documentation. > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more 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 racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.