Re: [racket] Typed Racket vs. Haskell

2012-09-21 Thread Sam Tobin-Hochstadt
On Fri, Sep 21, 2012 at 2:29 PM, wrote: > One more question. > > I've been told that there are no typeclasses in TR. > How would you handle this? > > foo :: (Ord a) => a -> a -> a Racket doesn't have a general notion of ordering, so we'd probably write this function like this: (: foo : (All (A)

Re: [racket] Typed Racket vs. Haskell

2012-09-21 Thread thorsopia
One more question. I've been told that there are no typeclasses in TR. How would you handle this? foo :: (Ord a) => a -> a -> a (I haven't checked the docs yet. Maybe this is not needed in TR.) Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Typed Racket vs. Haskell

2012-09-21 Thread Eli Barzilay
Yesterday, thorso...@lavabit.com wrote: > > Developing statically typed code in TR and making it work later on > > other Scheme implementations should be easy, since the TR type > > system is intended to allow the same style of code that is used in > > Racket, which is also similar to the style in

Re: [racket] Typed Racket vs. Haskell

2012-09-20 Thread Matthias Felleisen
Technically this should be possible and conceptually preferable. However, it does come with redundancies that conventional type annotations avoid and I am not sure how much of this redundancy we should push on programmers. On Sep 20, 2012, at 4:51 PM, Patrick Mahoney wrote: > Hey all, >

Re: [racket] Typed Racket vs. Haskell

2012-09-20 Thread Patrick Mahoney
Hey all, One feature of typed racket that makes translation between untyped and typed code somewhat less simple than adding or removing type signatures is that certain forms require rewriting/alteration of the untyped form itself. Others allow stand-alone declaration of the types prior to the for

Re: [racket] Typed Racket vs. Haskell

2012-09-20 Thread thorsopia
Thank you all for the replies. I'll give it a try. Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Typed Racket vs. Haskell

2012-09-20 Thread Vincent St-Amour
At Thu, 20 Sep 2012 02:41:02 -0400 (EDT), thorso...@lavabit.com wrote: > > The required "translation" step will be mostly > > removing the type declarations. Doing the same with Haskell etc would > > most likely be much harder. > > Is it possible not to remove types? Yes. A Typed Racket is a Rac

Re: [racket] Typed Racket vs. Haskell

2012-09-20 Thread Matthias Felleisen
On Sep 20, 2012, at 2:41 AM, thorso...@lavabit.com wrote: > Is it possible not to remove types? > Vincent told me that one can "mix typed and untyped code" in Racket. > How it's done in Racket (the implementation details)? How these modules > interact? Could you give me some pointers? 1. Typed

Re: [racket] Typed Racket vs. Haskell

2012-09-19 Thread thorsopia
> Developing statically typed code in TR and making it work later > on other Scheme implementations should be easy, since the TR type > system is intended to allow the same style of code that is used in > Racket, which is also similar to the style in other scheme > implementations. Actually, this

Re: [racket] Typed Racket vs. Haskell

2012-09-19 Thread Eli Barzilay
Yesterday, thorso...@lavabit.com wrote: > > I'm going to write a library. I want it to be available for the > largest number of people. Can other Lisp-like languages > (e.g. Guile) use libraries written in Typed Racket? And Matthias Felleisen replied: > > Typed Racket is designed for Racket. On

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread Raoul Duke
> Yes, but you can't infer the _definitions_ of types. So what I meant was, > you must define your types before writing programs. In Racket, you can just > think about a class of data (e.g. "all the numbers and strings") and write a not sure this is a black and white situation; seems like haskel

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread David Van Horn
On 9/18/12 4:59 PM, Raoul Duke wrote: No, by "types first" I think John and Vincent are talking about a conceptual order. I would phrase it a little more subtly: an ML (or Haskell) programmer writes their types, then their programs (as you must); a TR programmer thinks about their data, writes d

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread Raoul Duke
> No, by "types first" I think John and Vincent are talking about a conceptual > order. I would phrase it a little more subtly: an ML (or Haskell) > programmer writes their types, then their programs (as you must); a TR > programmer thinks about their data, writes down a program, then writes down

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread David Van Horn
On 9/18/12 4:08 PM, thorso...@lavabit.com wrote: It's also possible to write Typed Racket programs "types first", like one would in Haskell, and I sometimes do. The "sums-of-products" programming style of Haskell and ML can be expressed easily with Typed Racket's structs and union types. You can

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread Vincent St-Amour
At Tue, 18 Sep 2012 16:08:29 -0400 (EDT), thorso...@lavabit.com wrote: > > > It's also possible to write Typed Racket programs "types first", like > > one would in Haskell, and I sometimes do. The "sums-of-products" > > programming style of Haskell and ML can be expressed easily with Typed > > Rac

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread Matthias Felleisen
Haskell is a mature, 20-year old compiler. Typed Racket is an evolving, 3-year old language for which we have only recently turned to performance issues. Also it runs atop a jit compiler that does not know anything about types. We need to develop new and different ways to perform optimization

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread Raoul Duke
http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=racket&lang2=ghc ? Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread thorsopia
I forgot to ask about performance. I know that all benchmarks lie, but which one is faster: Haskell or Typed Racket? Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread thorsopia
> It's also possible to write Typed Racket programs "types first", like > one would in Haskell, and I sometimes do. The "sums-of-products" > programming style of Haskell and ML can be expressed easily with Typed > Racket's structs and union types. You can also mix and match between > "Haskell" and

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread Vincent St-Amour
At Tue, 18 Sep 2012 09:55:36 -0700, John Clements wrote: > On Sep 18, 2012, at 8:30 AM, thorso...@lavabit.com wrote: > > > Hi, > > > > I'm a beginner, but I have some experience with Scheme and Haskell. > > > > Haskell is famous for its strict type system. Is it possible to achieve > > this in a

Re: [racket] Typed Racket vs. Haskell

2012-09-18 Thread John Clements
On Sep 18, 2012, at 8:30 AM, thorso...@lavabit.com wrote: > Hi, > > I'm a beginner, but I have some experience with Scheme and Haskell. > > Haskell is famous for its strict type system. Is it possible to achieve > this in a Lisp-like language? Is Typed Racket as strict as Haskell? > > I'd like

[racket] Typed Racket vs. Haskell

2012-09-18 Thread thorsopia
Hi, I'm a beginner, but I have some experience with Scheme and Haskell. Haskell is famous for its strict type system. Is it possible to achieve this in a Lisp-like language? Is Typed Racket as strict as Haskell? I'd like to see a comparison between the two. (Please don't refer me to the docs. B