Re: [racket-dev] open untagged files in blank language level?

2011-10-06 Thread Stephen Bloch
On Oct 6, 2011, at 4:35 PM, "John Clements" wrote: > If there's any disagreement, it's about what should happen when an existing > file--specifically, one that doesn't begin with #lang--is opened. Unless I'm > missing something, this means that the only time students will have to > "re-selec

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Robby Findler
(And I feel obliged here to suggest that there should be some way to write test cases for this kind of thing -- ones that are not based on timing things but ones that are based on feeding some expressions into a compiler and making sure they get re-ordered in an expected way.) Robby On Thu, Oct 6

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Robby Findler
On Thu, Oct 6, 2011 at 6:03 PM, Sam Tobin-Hochstadt wrote: > On Thu, Oct 6, 2011 at 6:32 PM, Robby Findler > wrote: >> On Thursday, October 6, 2011, Sam Tobin-Hochstadt wrote: >>> In Le Fessant and Maranget, ICFP 2001, they have measurements that >>> show a 30% speedup of whole (toy) programs, w

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Sam Tobin-Hochstadt
That certainly doesn't seem right. It should prefer the pair check, but it's supposed to treat calling embedded expressions as slow. I'll take a look at that. On Oct 6, 2011 7:13 PM, "Jay McCarthy" wrote: > > Given all this talk of optimization, I'm still amazed that my original > example faile

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Jay McCarthy
Given all this talk of optimization, I'm still amazed that my original example failed. Basically, the ordering optimization decided that (and (pair? (cdr e)) (parse (car (cdr e is cheaper than (equal? '+ (car e)) Jay -- Jay McCarthy Assistant Professor / Brigham Young University h

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Sam Tobin-Hochstadt
On Thu, Oct 6, 2011 at 6:32 PM, Robby Findler wrote: > On Thursday, October 6, 2011, Sam Tobin-Hochstadt wrote: >> In Le Fessant and Maranget, ICFP 2001, they have measurements that >> show a 30% speedup of whole (toy) programs, with a similar but smaller >> suite of optimizations. > > Does match

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Robby Findler
On Thursday, October 6, 2011, Sam Tobin-Hochstadt wrote: > In Le Fessant and Maranget, ICFP 2001, they have measurements that > show a 30% speedup of whole (toy) programs, with a similar but smaller > suite of optimizations. Does match reproduce that speedup? > Given the extensibility of `match'

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Sam Tobin-Hochstadt
On Thu, Oct 6, 2011 at 6:23 PM, Jay McCarthy wrote: > On Thu, Oct 6, 2011 at 4:17 PM, Sam Tobin-Hochstadt wrote: >> On Thu, Oct 6, 2011 at 6:10 PM, Jay McCarthy wrote: >>> In Eli's example, only the second pattern could match >>> >>> But if we wrote it this way: >>> >>>  (define (list?? x) (prin

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Jay McCarthy
On Thu, Oct 6, 2011 at 4:17 PM, Sam Tobin-Hochstadt wrote: > On Thu, Oct 6, 2011 at 6:10 PM, Jay McCarthy wrote: >> In Eli's example, only the second pattern could match >> >> But if we wrote it this way: >> >>  (define (list?? x) (printf "list-checking ~s\n" x) (list? x)) >>  (define (one?? x) (

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Sam Tobin-Hochstadt
On Thu, Oct 6, 2011 at 6:10 PM, Jay McCarthy wrote: > In Eli's example, only the second pattern could match > > But if we wrote it this way: > >  (define (list?? x) (printf "list-checking ~s\n" x) (list? x)) >  (define (one?? x) (printf "one-checking ~s\n" x) (eq? 1 x)) >  (match '(1 (2) 3) >     

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Jay McCarthy
In Eli's example, only the second pattern could match But if we wrote it this way:  (define (list?? x) (printf "list-checking ~s\n" x) (list? x)) (define (one?? x) (printf "one-checking ~s\n" x) (eq? 1 x)) (match '(1 (2) 3)        [(list (? one??) (list 2) 3) 1]        [(list _ (? list??) _

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Sam Tobin-Hochstadt
In Le Fessant and Maranget, ICFP 2001, they have measurements that show a 30% speedup of whole (toy) programs, with a similar but smaller suite of optimizations. Given the extensibility of `match', the performance difference can be made arbitrarily large. For example, Eli's example doesn't call t

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Robby Findler
Do we have performance measurements that show the importance of such reorderings? Robby On Thursday, October 6, 2011, Neil Toronto wrote: > On 10/06/2011 01:20 PM, Eli Barzilay wrote: >> >> Just now, Neil Toronto wrote: >>> >>> On 10/06/2011 12:28 PM, Prabhakar Ragde wrote: On 10/6/11

Re: [racket-dev] open untagged files in blank language level?

2011-10-06 Thread Eli Barzilay
10 minutes ago, John Clements wrote: > > >> If anything, just the name of the "use the language defined in > >> the source" language is a very long one, which is unfortunate > >> since it's often the one that gets recommended often. > > > > Easy to agree here. :) > > Yes, I totally agree with th

Re: [racket-dev] open untagged files in blank language level?

2011-10-06 Thread John Clements
On Oct 6, 2011, at 11:30 AM, Robby Findler wrote: > Two hours ago, John Clements wrote: >>> Currently, opening a file that doesn't begin with a #lang line >>> results in a window whose language level is inherited from the >>> buffer that was foremost when the open-file was issued (IIUC). > > No,

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Neil Toronto
On 10/06/2011 01:20 PM, Eli Barzilay wrote: Just now, Neil Toronto wrote: On 10/06/2011 12:28 PM, Prabhakar Ragde wrote: On 10/6/11 2:12 PM, Eli Barzilay wrote: Sam is talking about building the ASTs *while* matching, which is what Jay was trying to do with uses of `app'. I think that a teach

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Eli Barzilay
Just now, Neil Toronto wrote: > On 10/06/2011 12:28 PM, Prabhakar Ragde wrote: > > On 10/6/11 2:12 PM, Eli Barzilay wrote: > > > >> Sam is talking about building the ASTs *while* matching, which is > >> what Jay was trying to do with uses of `app'. I think that a > >> teaching context is in particu

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Neil Toronto
On 10/06/2011 12:28 PM, Prabhakar Ragde wrote: On 10/6/11 2:12 PM, Eli Barzilay wrote: Sam is talking about building the ASTs *while* matching, which is what Jay was trying to do with uses of `app'. I think that a teaching context is in particular one where such a thing doesn't fit -- it obscur

Re: [racket-dev] Distributing C libraries

2011-10-06 Thread Eli Barzilay
Yesterday, Neil Toronto wrote: > On 10/05/2011 03:25 PM, John Clements wrote: > > > > On Oct 5, 2011, at 9:45 AM, Neil Toronto wrote: > > > >> I've just pushed the new 'plot' library. > >> > >> Eli and I both forgot that the new 'plot' still needs the old > >> libfit, and removed it along with libp

Re: [racket-dev] open untagged files in blank language level?

2011-10-06 Thread Robby Findler
Two hours ago, John Clements wrote: >> Currently, opening a file that doesn't begin with a #lang line >> results in a window whose language level is inherited from the >> buffer that was foremost when the open-file was issued (IIUC). No, it defaults to whatever language you last chose in the langu

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Prabhakar Ragde
On 10/6/11 2:12 PM, Eli Barzilay wrote: Sam is talking about building the ASTs *while* matching, which is what Jay was trying to do with uses of `app'. I think that a teaching context is in particular one where such a thing doesn't fit -- it obscures the distinction between the side the sexpr g

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Eli Barzilay
Just now, Robby Findler wrote: > On Thu, Oct 6, 2011 at 1:12 PM, Eli Barzilay wrote: > > A few minutes ago, Prabhakar Ragde wrote: > >> Sam wrote: > >> > >> > Unlike, say, `syntax-parse', `match' isn't designed for the > >> > use-case of building ASTs while matching. > >> > >> Wait, what? That's e

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Robby Findler
On Thu, Oct 6, 2011 at 1:12 PM, Eli Barzilay wrote: > A few minutes ago, Prabhakar Ragde wrote: >> Sam wrote: >> >> > Unlike, say, `syntax-parse', `match' isn't designed for the >> > use-case of building ASTs while matching. >> >> Wait, what? That's exactly what I want to use it for when writing >

Re: [racket-dev] open untagged files in blank language level?

2011-10-06 Thread Eli Barzilay
+1, but for different reasons than editing html files... I'd like to see the "use the language defined in the source" become the default for all purposes -- so at least when you open a file that does have a `#lang' line, or when you type it in, the non-"use the language defined in the source" lang

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Eli Barzilay
A few minutes ago, Prabhakar Ragde wrote: > Sam wrote: > > > Unlike, say, `syntax-parse', `match' isn't designed for the > > use-case of building ASTs while matching. > > Wait, what? That's exactly what I want to use it for when writing > toy interpreters for pedagogical purposes. Or am I misunde

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Prabhakar Ragde
Sam wrote: Unlike, say, `syntax-parse', `match' isn't designed for the use-case of building ASTs while matching. Wait, what? That's exactly what I want to use it for when writing toy interpreters for pedagogical purposes. Or am I misunderstanding what you're saying here? I want to do PLAI-st

[racket-dev] open untagged files in blank language level?

2011-10-06 Thread John Clements
Currently, opening a file that doesn't begin with a #lang line results in a window whose language level is inherited from the buffer that was foremost when the open-file was issued (IIUC). I think this is a mistake. I think that instead, the language level should revert to "Use the language defi

Re: [racket-dev] plea for short planet syntax in student languages?

2011-10-06 Thread Shriram Krishnamurthi
What they import is orthogonal to the syntax for importing. > How about this experiment: everyone teach in plain Racket for a while > and see whether teaching language restrictions are really needed. That would be a good experiment. My own suspicion is that getting rid of implicit begin will pro

Re: [racket-dev] plea for short planet syntax in student languages?

2011-10-06 Thread Matthias Felleisen
We have had students that write (require racket) and happily program away -- actually are very unhappy due to bugs. How about this experiment: everyone teach in plain Racket for a while and see whether teaching language restrictions are really needed. On Oct 5, 2011, at 2:37 PM, Shriram

Re: [racket-dev] racket/match is broken

2011-10-06 Thread Sam Tobin-Hochstadt
On Thu, Oct 6, 2011 at 12:34 AM, Jay McCarthy wrote: > Sure you COULD do that, but app is so cool, I just like the way it looks. Unlike, say, `syntax-parse', `match' isn't designed for the use-case of building ASTs while matching. If you wanted that, you'd need to definitely think harder about a