Re: [racket] Holzweg-PLAI. Not doable in DrRacket 6.0.1?

2014-06-18 Thread Shriram Krishnamurthi
Hi -- thanks for the report. However, you should be using plai-typed, not plai. You can find plai-typed here: http://cs.brown.edu/courses/cs173/2012/lang/ If you install and run with plai-typed instead of plai, you will find that the colon-endowed syntax works just fine (I just tested the very c

[racket] Holzweg-PLAI. Not doable in DrRacket 6.0.1?

2014-06-18 Thread Lawrence Bottorff
Not sure how to proceed with PLAI per http://cs.brown.edu/courses/cs173/2012/book/Introduction.html The code seems not to run, e.g., #lang plai (define-type MisspelledAnimal [caml (humps : number)] [yacc (height : number)]) actually wants to be (define-type MisspelledAnimal [caml (humps n

Re: [racket] type of make-vector

2014-06-18 Thread Vincent St-Amour
At Wed, 18 Jun 2014 01:45:08 -0400, Alexander D. Knauth wrote: > >> And Is there a reason for the result in the first case being (Vectorof > >> (U Integer a)) instead of (Vectorof Zero)? > > > > Again, convenience. > > > > Because vectors are mutable, a `(Vectorof Zero)' is not very useful. You >

Re: [racket] help me speed up string split?

2014-06-18 Thread Sam Tobin-Hochstadt
On Wed, Jun 18, 2014 at 7:33 PM, Ryan Davis wrote: > > On Jun 18, 2014, at 15:55, Sam Tobin-Hochstadt wrote: > >>> I'll stick to for/list + in-port + read >> >> Note that this combination is nicely packaged up as `(port->list)`, >> and there's a couple optional arguments and also `file->list` for

Re: [racket] help me speed up string split?

2014-06-18 Thread Ryan Davis
On Jun 18, 2014, at 15:55, Sam Tobin-Hochstadt wrote: >> I'll stick to for/list + in-port + read > > Note that this combination is nicely packaged up as `(port->list)`, > and there's a couple optional arguments and also `file->list` for > other versions of this. ooh. I didn't find that last ni

Re: [racket] help me speed up string split?

2014-06-18 Thread Ryan Davis
On Jun 18, 2014, at 16:01, Robby Findler wrote: > Sorry-- I certainly don't dispute any of your comments on the relative > merit of the code. I was just trying to understand which parts of the > function touch bad performance in Racket. It was certainly not taken that way and I'm sorry if my re

Re: [racket] help me speed up string split?

2014-06-18 Thread Robby Findler
Sorry-- I certainly don't dispute any of your comments on the relative merit of the code. I was just trying to understand which parts of the function touch bad performance in Racket. Robby On Wed, Jun 18, 2014 at 4:44 PM, Ryan Davis wrote: > > On Jun 18, 2014, at 1:26, Robby Findler wrote: > >

Re: [racket] help me speed up string split?

2014-06-18 Thread Sam Tobin-Hochstadt
> I'll stick to for/list + in-port + read Note that this combination is nicely packaged up as `(port->list)`, and there's a couple optional arguments and also `file->list` for other versions of this. Sam Racket Users list: http://lists.racket-lang.org/users

Re: [racket] help me speed up string split?

2014-06-18 Thread Neil Van Dyke
This might still be optimizable in pure Racket; otherwise, mixing Racket with R might not be a bad idea for this and other reasons. Details... I played with this briefly late last night after emails with Ryan, without finding a substantially faster way that still looked elegant as Racket code

Re: [racket] help me speed up string split?

2014-06-18 Thread Ryan Davis
On Jun 18, 2014, at 1:26, Robby Findler wrote: > I think the ruby version is smarter than your Racket version. > Specifically, if you remove the .size (but don't print the output), > things slow down by a factor of about 2 for me. > > $ time ruby -e 'p File.read("X_train.txt").split(/\s+/).map

Re: [racket] help me speed up string split?

2014-06-18 Thread Robby Findler
I think the ruby version is smarter than your Racket version. Specifically, if you remove the .size (but don't print the output), things slow down by a factor of about 2 for me. $ time ruby -e 'p File.read("X_train.txt").split(/\s+/).map(&:to_f)' > /dev/null real 0m1.127s user 0m1.071s sys 0m0.05