Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
typed racked questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  17 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bikal Gurung  
View profile  
 More options Apr 30 2012, 12:51 am
From: Bikal Gurung <gbi...@gmail.com>
Date: Mon, 30 Apr 2012 05:51:00 +0100
Subject: [racket] typed racked questions

Hi All,

I am investigating typed racket. I was wondering if someone could help with
answering the questions below.

1) Can we mix/import modules written in untyped racket to a module that is
used typed racket. I have experimented with a few modules using and they
seem to work in general but not really sure about the mechanism that makes
it work. How does racket make the untyped code and typed code work together
if they do? Is this in a case by case basis, ie. module/library by library
basis?

2) What is the canonical racket paradigm? use typed racket or untyped
racket? Or is this more an issue of a preference/style?

3) Are typed racket programs faster than untyped ones? The documentation
says so but I was wondering if there has been any benchmark or study being
done on this topic.

4) Can typed racket module be used in the context of untyped racket module?

5) Is there a Hindlye/Milner style type inferencing algorithm for typed
racket being worked on?

With Thanks
Bikal

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vincent St-Amour  
View profile  
 More options Apr 30 2012, 8:34 am
From: Vincent St-Amour <stamo...@ccs.neu.edu>
Date: Mon, 30 Apr 2012 08:34:55 -0400
Local: Mon, Apr 30 2012 8:34 am
Subject: Re: [racket] typed racked questions
At Mon, 30 Apr 2012 05:51:00 +0100,

Bikal Gurung wrote:
> 1) Can we mix/import modules written in untyped racket to a module that is
> used typed racket. I have experimented with a few modules using and they
> seem to work in general but not really sure about the mechanism that makes
> it work. How does racket make the untyped code and typed code work together
> if they do? Is this in a case by case basis, ie. module/library by library
> basis?

Contracts are applied at the boundaires between types and untyped
code. These contracts check that whathever comes from an untyped module
respects the typed module's invariants. Contracts are generated from
types, so this works for any module.

> 2) What is the canonical racket paradigm? use typed racket or untyped
> racket? Or is this more an issue of a preference/style?

It's a matter of preference, I would say.

Typed Racket was designed to make it easy to port untyped Racket code to
it. It's possible to write your programs in untyped Racket, then as the
code base grows larger, add types one module at a time.

> 3) Are typed racket programs faster than untyped ones? The documentation
> says so but I was wondering if there has been any benchmark or study being
> done on this topic.

Typed Racket does perform optimization. Whether or not they apply
depends on the program. If you want to know if your program benefits
from Typed Racket's optimizations, click the Performance Report button
in DrRacket and green highlights will appear where optimizations were
performed. You can click these highlights for more information.

As for benchmarks, check out:
http://www.ccs.neu.edu/racket/pubs/pldi11-thacff.pdf

> 4) Can typed racket module be used in the context of untyped racket module?

Yes, you can require a Typed Racket module from a Racket module.

> 5) Is there a Hindlye/Milner style type inferencing algorithm for typed
> racket being worked on?

Currently, Typed Racket performs local type inference. It can infer most
types inside function bodies, but it requires type annotations for
functions. Global type inference would be nice, but we don't know how to
do it. Several features of the type system make inference hard.

Vincent
____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Tobin-Hochstadt  
View profile  
 More options Apr 30 2012, 8:48 am
From: Sam Tobin-Hochstadt <sa...@ccs.neu.edu>
Date: Mon, 30 Apr 2012 08:48:38 -0400
Local: Mon, Apr 30 2012 8:48 am
Subject: Re: [racket] typed racked questions

On Mon, Apr 30, 2012 at 12:51 AM, Bikal Gurung <gbi...@gmail.com> wrote:
> Hi All,

> I am investigating typed racket. I was wondering if someone could help with
> answering the questions below.

> 1) Can we mix/import modules written in untyped racket to a module that is
> used typed racket. I have experimented with a few modules using and they
> seem to work in general but not really sure about the mechanism that makes
> it work. How does racket make the untyped code and typed code work together
> if they do? Is this in a case by case basis, ie. module/library by library
> basis?

Yes, you can mix typed modules and untyped modules in the same
program.  This is one of the most fundamental features of Typed
Racket.  To use a typed module from an untyped module, just require it
-- contracts are inserted automatically to check the operation.  To
use an untyped module from a typed module, use `require/typed' to
specify the type.

> 2) What is the canonical racket paradigm? use typed racket or untyped
> racket? Or is this more an issue of a preference/style?

This is very much an issue of style.  I think there are a number of
advantages of type systems for maintenance, optimization,
documentation, and organization, so I encourage you to use Typed
Racket.  However, if you use plain Racket, Typed Racket is designed to
make it easy to switch, a module at a time, when you decide you want
types.

> 3) Are typed racket programs faster than untyped ones? The documentation
> says so but I was wondering if there has been any benchmark or study being
> done on this topic.

Yes, Typed Racket has an optimizing compiler (by Vincent St-Amour)
which uses the type information to make your program go faster.  You
can see some benchmark results in our papers
http://www.ccs.neu.edu/racket/pubs/padl12-stff.pdf and
http://www.ccs.neu.edu/racket/pubs/pldi11-thacff.pdf .

> 4) Can typed racket module be used in the context of untyped racket module?

Yes, you can just `require` the typed module, and it should work.

> 5) Is there a Hindlye/Milner style type inferencing algorithm for typed
> racket being worked on?

The Typed Racket type system contains a number of features that go
beyond what's supported in Hindley/Milner style type systems, and so
we can't use that inference system.  Currently, Typed Racket uses
local type inference to infer many of the types in your program, but
we'd like to infer more of them -- this is an ongoing area of
research.  However, inferring all the types in the program, the way
that ML and Haskell do, is not a goal of Typed Racket -- having type
annotations there makes the program self-documenting and easier to
understand, improves type error messages, and supports advanced type
system features.

Thanks for your interest in Typed Racket, and if you have any more
questions, please ask.
--
sam th
sa...@ccs.neu.edu
____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ray Racine  
View profile  
 More options Apr 30 2012, 9:50 am
From: Ray Racine <ray.rac...@gmail.com>
Date: Mon, 30 Apr 2012 09:50:55 -0400
Local: Mon, Apr 30 2012 9:50 am
Subject: Re: [racket] typed racked questions

User Testimonial.  I migrated exclusively to TR awhile back and prefer it
immensely.

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikal Gurung  
View profile  
 More options Apr 30 2012, 10:57 am
From: Bikal Gurung <gbi...@gmail.com>
Date: Mon, 30 Apr 2012 15:57:24 +0100
Local: Mon, Apr 30 2012 10:57 am
Subject: Re: [racket] typed racked questions

Hi Ray,

Are you using this in your day to day programming? What sort of projects do
you use this for ? Do you use untyped racket in the beginning, i.e when you
are experimenting with ideas/algorithms and then migrate to typed racket ?
Have you used typed racket when developing web applications with the racket
web libs?

Much Thanks
Bikal

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay McCarthy  
View profile  
 More options Apr 30 2012, 1:10 pm
From: Jay McCarthy <jay.mccar...@gmail.com>
Date: Mon, 30 Apr 2012 11:10:18 -0600
Local: Mon, Apr 30 2012 1:10 pm
Subject: Re: [racket] typed racked questions

On Mon, Apr 30, 2012 at 8:57 AM, Bikal Gurung <gbi...@gmail.com> wrote:
> Hi Ray,

> Are you using this in your day to day programming? What sort of projects do
> you use this for ? Do you use untyped racket in the beginning, i.e when you
> are experimenting with ideas/algorithms and then migrate to typed racket ?
> Have you used typed racket when developing web applications with the racket
> web libs?

FWIW, We are currently in the process of natively typing the Web libraries.

Jay

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikal Gurung  
View profile  
 More options Apr 30 2012, 1:30 pm
From: Bikal Gurung <gbi...@gmail.com>
Date: Mon, 30 Apr 2012 18:30:17 +0100
Local: Mon, Apr 30 2012 1:30 pm
Subject: Re: [racket] typed racked questions

Interesting. What is the status of this project? Is this going to be in the
next release.

Bikal

On Mon, Apr 30, 2012 at 6:10 PM, Jay McCarthy <jay.mccar...@gmail.com>wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikal Gurung  
View profile  
 More options Apr 30 2012, 5:23 pm
From: Bikal Gurung <gbi...@gmail.com>
Date: Mon, 30 Apr 2012 22:23:01 +0100
Local: Mon, Apr 30 2012 5:23 pm
Subject: Re: [racket] typed racked questions

Sam,

Is there a function in racket which will - given a name - display the
function/variable signature in the REPL?

I am thinking about haskell prelude(REPL) that gives me the type signature
when I enter :t <func name> in the repl?

With Thanks
Bikal

On Mon, Apr 30, 2012 at 1:48 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu>wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vincent St-Amour  
View profile  
 More options Apr 30 2012, 5:54 pm
From: Vincent St-Amour <stamo...@ccs.neu.edu>
Date: Mon, 30 Apr 2012 17:54:40 -0400
Local: Mon, Apr 30 2012 5:54 pm
Subject: Re: [racket] typed racked questions
The REPL prints types automatically:

Welcome to Racket v5.3.0.4.
-> vector-ref
- : (All (a) ((Vectorof a) Integer -> a))
#<procedure:vector-ref>
-> (define: x : String "Hello")
-> x
- : String
"Hello"
->

Is this what you had in mind?

Vincent

At Mon, 30 Apr 2012 22:23:01 +0100,

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikal Gurung  
View profile  
 More options Apr 30 2012, 6:07 pm
From: Bikal Gurung <gbi...@gmail.com>
Date: Mon, 30 Apr 2012 23:07:38 +0100
Local: Mon, Apr 30 2012 6:07 pm
Subject: Re: [racket] typed racked questions

hmmm ... I am getting some error. My repl session below. I am using 'db'
module.

> bind-prepared-statement

. Type Checker: untyped top-level identifier lifted.474 in:
bind-prepared-statement


Not sure what to make of it. My impression was the typed/untyped code mix
well. Am i missing something ??

Bikal

On Mon, Apr 30, 2012 at 10:54 PM, Vincent St-Amour <stamo...@ccs.neu.edu>wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bikal Gurung  
View profile  
 More options Apr 30 2012, 6:12 pm
From: Bikal Gurung <gbi...@gmail.com>
Date: Mon, 30 Apr 2012 23:12:35 +0100
Local: Mon, Apr 30 2012 6:12 pm
Subject: Re: [racket] typed racked questions

What are DrRacket and other racket libs written in ? typed/untyped racket ?

On Mon, Apr 30, 2012 at 1:48 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu>wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ray Racine  
View profile  
 More options Apr 30 2012, 8:47 pm
From: Ray Racine <ray.rac...@gmail.com>
Date: Mon, 30 Apr 2012 20:47:30 -0400
Local: Mon, Apr 30 2012 8:47 pm
Subject: Re: [racket] typed racked questions

See below.

On Mon, Apr 30, 2012 at 10:57 AM, Bikal Gurung <gbi...@gmail.com> wrote:
> Hi Ray,

> Are you using this in your day to day programming?

Most of my home programming is in Racket.
Work is split 75%-10%-15% Scala, R and Racket respectively.

> What sort of projects do you use this for ?

At work I use Racket for large scripts and data massaging and
manipulations.  Most of to get things collected and shaped up in a form to
load it into R. :)

At home, I tend to average one multi-million dollar idea a quarter, which
are explored and abandoned on a regular basis without making a dime.  I
find this exercise in futility endlessly fun and Racket is great for this
sort hamster wheel spinning.   The quicker you can explore, the sooner the
realization of just how brain dead that brilliant idea really was is
achieved.

Do you use untyped racket in the beginning, i.e when you are experimenting

> with ideas/algorithms and then migrate to typed racket ?

When I sit to do something there are only two possibilities Scala or
(typed) Racket.  For any sort of quick exploration I use TRacket.  Typed
Racket is so light weight to use, what code I write is typed.  #lang
typed/racket/base first thing, every time, in every new module without
hesitation.   In other words I do not code in Racket and then later go back
on type the code.  Too easy to just use TR from keystroke one.

Awhile back I wrote some code to generate a Formal Concept Analysis lattice
for around 100K Amazon genre ebooks with various attribution.  This was the
only time I've written a modest, yet nontrivial program twice, once in TR
and once in Scala.

The first effort was from the algo's paper/publication to TR.  The second
effort was in Scala.  I distinctly remember expecting the Scala effort to
go pretty fast, as after all I'd already written it once.

Unexpectedly, the Scala effort took more time than I thought it should.  It
was not a Scala issue per se, but an OO-centric language with support for
functional idioms versus a Functional-centric languge with support for OO
idioms.  I much prefer the later.

Data in structures.  Apply functions, transform data, repeat until expected
output is reached.  Sometimes its just hard to keep mapping and jamming
things relentlessly into classes and it is entirely too easy to paint
yourself into a corner with your OO structure.

Also with TypedRacket I find I get more meta-level in my programming in a
Haskell kind of way than when I did regular Racket programming, i.e.,  pass
more functions, compose more functions etc.  Typed Racket allows one to
just keep layering the abstractions without losing the plot.

Things like ...
(: map/try-or-else (All (T U) (Try T) (T -> U) (exn -> U) -> (Try U)))

Now Scala is hands down a BRILLIANT work in language design.  My admiration
is unbounded.  And I use it willing and often, especially at work, on all
kinds of stuff.

Have you used typed racket when developing web applications with the racket

> web libs?

Never really had a need to.  But when I need it, it is good to know that
Jay, as posted in this thread, is migrating the web code to TR.

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hendrik Boom  
View profile  
 More options May 1 2012, 11:58 am
From: Hendrik Boom <hend...@topoi.pooq.com>
Date: Tue, 1 May 2012 11:58:10 -0400
Local: Tues, May 1 2012 11:58 am
Subject: Re: [racket] typed racked questions

On Mon, Apr 30, 2012 at 08:48:38AM -0400, Sam Tobin-Hochstadt wrote:

> > 5) Is there a Hindlye/Milner style type inferencing algorithm for typed
> > racket being worked on?

> The Typed Racket type system contains a number of features that go
> beyond what's supported in Hindley/Milner style type systems, and so
> we can't use that inference system.  Currently, Typed Racket uses
> local type inference to infer many of the types in your program, but
> we'd like to infer more of them -- this is an ongoing area of
> research.  However, inferring all the types in the program, the way
> that ML and Haskell do, is not a goal of Typed Racket -- having type
> annotations there makes the program self-documenting and easier to
> understand, improves type error messages, and supports advanced type
> system features.

ML and such go too far.  Don't go there.  I really like having  
tatically checked type annotations.  They make life a lot easier.
It's types I want, not typability,

-- hendrik
____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Tobin-Hochstadt  
View profile  
 More options May 1 2012, 12:03 pm
From: Sam Tobin-Hochstadt <sa...@ccs.neu.edu>
Date: Tue, 1 May 2012 12:03:49 -0400
Local: Tues, May 1 2012 12:03 pm
Subject: Re: [racket] typed racked questions

I agree with this.  The reason that we are looking at more inference
for Typed Racket is two-fold:

1. Currently, Typed Racket requires annoying type annotations that
don't add any useful information, such as:
   (map (lambda: ([x : Integer]) (+ x 4)) (list 1 2 3))
Fortunately, there are systems that solve this, while preserving the
other nice properties Typed Racket has.

2. Macro-generated code from macros that aren't typed (like `for')
often needs more inference than we currently provide, leading TR users
to have to avoid those macros, or us to have to provide alternative
implementations that don't work in all cases.  I hope that improving
inference will alleviate some of this problem.

--
sam th
sa...@ccs.neu.edu

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vincent St-Amour  
View profile  
 More options May 1 2012, 12:38 pm
From: Vincent St-Amour <stamo...@ccs.neu.edu>
Date: Tue, 01 May 2012 12:38:47 -0400
Local: Tues, May 1 2012 12:38 pm
Subject: Re: [racket] typed racked questions
At Mon, 30 Apr 2012 23:07:38 +0100,

Bikal Gurung wrote:
> hmmm ... I am getting some error. My repl session below. I am using 'db'
> module.

> > bind-prepared-statement
> . Type Checker: untyped top-level identifier lifted.474 in:
> bind-prepared-statement

> Not sure what to make of it. My impression was the typed/untyped code mix
> well. Am i missing something ??

Did you use `require' or `require/typed'?

Vincent
____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vincent St-Amour  
View profile  
 More options May 1 2012, 12:47 pm
From: Vincent St-Amour <stamo...@ccs.neu.edu>
Date: Tue, 01 May 2012 12:47:40 -0400
Local: Tues, May 1 2012 12:47 pm
Subject: Re: [racket] typed racked questions
At Mon, 30 Apr 2012 23:12:35 +0100,

Bikal Gurung wrote:
> What are DrRacket and other racket libs written in ? typed/untyped racket ?

DrRacket is written in untyped Racket, with a bit of Typed Racket.

Most libraries are untyped, but some are typed (quickly skimming the
PLaneT listing: purely functional data structures, json template, ...)
Some have typed internals and untyped interfaces (e.g. the images
collection). I'm probably forgetting some.

Vincent
____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay McCarthy  
View profile  
 More options May 1 2012, 1:49 pm
From: Jay McCarthy <jay.mccar...@gmail.com>
Date: Tue, 1 May 2012 11:49:53 -0600
Local: Tues, May 1 2012 1:49 pm
Subject: Re: [racket] typed racked questions
It will not be in the release. It is an undergrad's summer project.
It's in the early stages now, so nothing more to say really. A big
problem will that Typed Racket is very primitive w.r.t to Racket
features like keyword arguments and structure properties that are used
in the server.

Jay

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

____________________
  Racket Users list:
  http://lists.racket-lang.org/users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »