hmmm ... I am getting some error. My repl session below. I am using 'db' module. <br><br><div>> bind-prepared-statement</div><div>. Type Checker: untyped top-level identifier lifted.474 in: bind-prepared-statement</div>
<div>> </div><div><br></div>Not sure what to make of it. My impression was the typed/untyped code mix well. Am i missing something ??<div><br></div><div>Bikal </div><div><br><div class="gmail_quote">On Mon, Apr 30, 2012 at 10:54 PM, Vincent St-Amour <span dir="ltr"><<a href="mailto:stamourv@ccs.neu.edu" target="_blank">stamourv@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">The REPL prints types automatically:<br>
<br>
Welcome to Racket v5.3.0.4.<br>
-> vector-ref<br>
- : (All (a) ((Vectorof a) Integer -> a))<br>
#<procedure:vector-ref><br>
-> (define: x : String "Hello")<br>
-> x<br>
- : String<br>
"Hello"<br>
-><br>
<br>
<br>
Is this what you had in mind?<br>
<br>
Vincent<br>
<br>
<br>
<br>
At Mon, 30 Apr 2012 22:23:01 +0100,<br>
Bikal Gurung wrote:<br>
><br>
> [1 <multipart/alternative (7bit)>]<br>
> [1.1 <text/plain; ISO-8859-1 (7bit)>]<br>
<div><div class="h5">> Sam,<br>
><br>
> Is there a function in racket which will - given a name - display the<br>
> function/variable signature in the REPL?<br>
><br>
> I am thinking about haskell prelude(REPL) that gives me the type signature<br>
> when I enter :t <func name> in the repl?<br>
><br>
> With Thanks<br>
> Bikal<br>
><br>
> On Mon, Apr 30, 2012 at 1:48 PM, Sam Tobin-Hochstadt <<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a>>wrote:<br>
><br>
> > 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<br>
> > with<br>
> > > answering the questions below.<br>
> > ><br>
> > > 1) Can we mix/import modules written in untyped racket to a module that<br>
> > 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<br>
> > makes<br>
> > > it work. How does racket make the untyped code and typed code work<br>
> > together<br>
> > > if they do? Is this in a case by case basis, ie. module/library by<br>
> > library<br>
> > > basis?<br>
> ><br>
> > 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>
> ><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>
> > 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>
> ><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<br>
> > being<br>
> > > done on this topic.<br>
> ><br>
> > 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>
> ><br>
> > > 4) Can typed racket module be used in the context of untyped racket<br>
> > module?<br>
> ><br>
> > Yes, you can just `require` the typed module, and it should work.<br>
> ><br>
> > > 5) Is there a Hindlye/Milner style type inferencing algorithm for typed<br>
> > > racket being worked on?<br>
> ><br>
> > 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>
> > --<br>
> > sam th<br>
> > <a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>
> ><br>
</div></div>> [1.2 <text/html; ISO-8859-1 (quoted-printable)>]<br>
><br>
> [2 <text/plain; us-ascii (7bit)>]<br>
<div class="HOEnZb"><div class="h5">> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>