What are DrRacket and other racket libs written in ? typed/untyped racket ? <br><br><div class="gmail_quote">On Mon, Apr 30, 2012 at 1:48 PM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Apr 30, 2012 at 12:51 AM, Bikal Gurung <<a href="mailto:gbikal@gmail.com">gbikal@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> I am investigating typed racket. I was wondering if someone could help with<br>
> answering the questions below.<br>
><br>
> 1) Can we mix/import modules written in untyped racket to a module that is<br>
> used typed racket. I have experimented with a few modules using and they<br>
> seem to work in general but not really sure about the mechanism that makes<br>
> it work. How does racket make the untyped code and typed code work together<br>
> if they do? Is this in a case by case basis, ie. module/library by library<br>
> basis?<br>
<br>
</div>Yes, you can mix typed modules and untyped modules in the same<br>
program. This is one of the most fundamental features of Typed<br>
Racket. To use a typed module from an untyped module, just require it<br>
-- contracts are inserted automatically to check the operation. To<br>
use an untyped module from a typed module, use `require/typed' to<br>
specify the type.<br>
<div class="im"><br>
> 2) What is the canonical racket paradigm? use typed racket or untyped<br>
> racket? Or is this more an issue of a preference/style?<br>
<br>
</div>This is very much an issue of style. I think there are a number of<br>
advantages of type systems for maintenance, optimization,<br>
documentation, and organization, so I encourage you to use Typed<br>
Racket. However, if you use plain Racket, Typed Racket is designed to<br>
make it easy to switch, a module at a time, when you decide you want<br>
types.<br>
<div class="im"><br>
> 3) Are typed racket programs faster than untyped ones? The documentation<br>
> says so but I was wondering if there has been any benchmark or study being<br>
> done on this topic.<br>
<br>
</div>Yes, Typed Racket has an optimizing compiler (by Vincent St-Amour)<br>
which uses the type information to make your program go faster. You<br>
can see some benchmark results in our papers<br>
<a href="http://www.ccs.neu.edu/racket/pubs/padl12-stff.pdf" target="_blank">http://www.ccs.neu.edu/racket/pubs/padl12-stff.pdf</a> and<br>
<a href="http://www.ccs.neu.edu/racket/pubs/pldi11-thacff.pdf" target="_blank">http://www.ccs.neu.edu/racket/pubs/pldi11-thacff.pdf</a> .<br>
<div class="im"><br>
> 4) Can typed racket module be used in the context of untyped racket module?<br>
<br>
</div>Yes, you can just `require` the typed module, and it should work.<br>
<div class="im"><br>
> 5) Is there a Hindlye/Milner style type inferencing algorithm for typed<br>
> racket being worked on?<br>
<br>
</div>The Typed Racket type system contains a number of features that go<br>
beyond what's supported in Hindley/Milner style type systems, and so<br>
we can't use that inference system. Currently, Typed Racket uses<br>
local type inference to infer many of the types in your program, but<br>
we'd like to infer more of them -- this is an ongoing area of<br>
research. However, inferring all the types in the program, the way<br>
that ML and Haskell do, is not a goal of Typed Racket -- having type<br>
annotations there makes the program self-documenting and easier to<br>
understand, improves type error messages, and supports advanced type<br>
system features.<br>
<br>
Thanks for your interest in Typed Racket, and if you have any more<br>
questions, please ask.<br>
<span class="HOEnZb"><font color="#888888">--<br>
sam th<br>
<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>
</font></span></blockquote></div><br>