Re: [racket] Tutorial: writing a language (brainf*ck) in Racket

2011-06-13 Thread Mark Engelberg
Excellent tutorial. This really helped me understand how to write a language with a non-lispy syntax within Racket. Thanks. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Strange contracts in the tutorial

2011-06-13 Thread Rodolfo Carvalho
Ok, now I get what it means. Still, it feels confusing in the way that it's written. []'s Rodolfo Carvalho On Mon, Jun 13, 2011 at 20:55, Matthias Felleisen wrote: > > The author tried to say it doesn't return. > > In a Racket-like context, the author could have specified > > ;; render-blog-

Re: [racket] Strange contracts in the tutorial

2011-06-13 Thread Matthias Felleisen
The author tried to say it doesn't return. In a Racket-like context, the author could have specified ;; render-blog-page : request -> ∅ Since there are no elements in the emptyset, this specification says the same thing mathematically, using Racket's `types as sets' standard form of loose

Re: [racket] Strange contracts in the tutorial

2011-06-13 Thread Nadeem Abdul Hamid
It means it "doesn't return". Note that the last thing the function does is call send/suspend/dispatch, which calls response-generator, and never "returns" back out of the original call to render-blog-page. --- nadeem On Mon, Jun 13, 2011 at 5:13 PM, Rodolfo Carvalho wrote: > > Hi, > I'm reading

Re: [racket] Server side continuations

2011-06-13 Thread Eli Barzilay
15 minutes ago, Sam Tobin-Hochstadt wrote: > On Mon, Jun 13, 2011 at 6:46 PM, Eli Barzilay wrote: > > Three minutes ago, Sam Tobin-Hochstadt wrote: > >> On Mon, Jun 13, 2011 at 5:37 PM, Eli Barzilay wrote: > >> > On Friday, Shriram Krishnamurthi wrote: > >> >> > >> >> I wonder if he's read the st

Re: [racket] Server side continuations

2011-06-13 Thread Raoul Duke
On Mon, Jun 13, 2011 at 3:50 PM, Sam Tobin-Hochstadt wrote: > That is not true. The event-driven structure of all JavaScript code is > an important part of why node is fast.  That's what JS engines are > good at, among other things. imho everything is a trade-off. event-driven has major suck abou

Re: [racket] Server side continuations

2011-06-13 Thread Sam Tobin-Hochstadt
On Mon, Jun 13, 2011 at 6:46 PM, Eli Barzilay wrote: > Three minutes ago, Sam Tobin-Hochstadt wrote: >> On Mon, Jun 13, 2011 at 5:37 PM, Eli Barzilay wrote: >> > On Friday, Shriram Krishnamurthi wrote: >> >> >> >> I wonder if he's read the structure of JavaScript programs, which -- >> >> because

Re: [racket] Server side continuations

2011-06-13 Thread Eli Barzilay
Three minutes ago, Sam Tobin-Hochstadt wrote: > On Mon, Jun 13, 2011 at 5:37 PM, Eli Barzilay wrote: > > On Friday, Shriram Krishnamurthi wrote: > >> > >> I wonder if he's read the structure of JavaScript programs, which -- > >> because of the cooperative multi-tasking structure of JavaScript -- >

Re: [racket] Server side continuations

2011-06-13 Thread Sam Tobin-Hochstadt
On Mon, Jun 13, 2011 at 5:37 PM, Eli Barzilay wrote: > On Friday, Shriram Krishnamurthi wrote: >> >> I wonder if he's read the structure of JavaScript programs, which -- >> because of the cooperative multi-tasking structure of JavaScript -- >> have to return control to the event loop (ie, "termina

Re: [racket] Tutorial: writing a language (brainf*ck) in Racket

2011-06-13 Thread Danny Yoo
On Mon, Jun 13, 2011 at 5:34 PM, Johnny Morrice wrote: > >> The dilemma was to choose a language that was simple, and looked >> nothing like Racket.  The choice was clear: it had to be brainf*ck. >> Here's the tutorial: >> >>     >> http://planet.racket-lang.org/package-source/dyoo/bf.plt/1/2/pla

Re: [racket] Limit command-line Racket's memory

2011-06-13 Thread Tony Garnock-Jones
Hi Matthew, On 2011-06-10 4:10 PM, Matthew Flatt wrote: Ok. I think it will be easier to work on base memory use using 3m. I've changed the build script, and now 3M Racket seems to be working on the MIPS machine! The latest patches and build script are visible at https://github.com/tonyg/rac

Re: [racket] Server side continuations

2011-06-13 Thread Eli Barzilay
On Friday, Shriram Krishnamurthi wrote: > > I wonder if he's read the structure of JavaScript programs, which -- > because of the cooperative multi-tasking structure of JavaScript -- > have to return control to the event loop (ie, "terminate") whenever > they make an Ajax request, leaving *another

Re: [racket] Tutorial: writing a language (brainf*ck) in Racket

2011-06-13 Thread Johnny Morrice
> The dilemma was to choose a language that was simple, and looked > nothing like Racket. The choice was clear: it had to be brainf*ck. > Here's the tutorial: > > > http://planet.racket-lang.org/package-source/dyoo/bf.plt/1/2/planet-docs/manual/index.html > > Comments and suggestions would

[racket] Strange contracts in the tutorial

2011-06-13 Thread Rodolfo Carvalho
Hi, I'm reading the User Guide: Continue and I'm puzzled with some contracts that reads: ; render-blog-page: request -> doesn't ; Produces an doesn't page of the > content of the ; BLOG. Is it correct? What does it mean that it "produces an doesn't"? [

Re: [racket] dispatch on type

2011-06-13 Thread Eli Barzilay
8 hours ago, Stephan Houben wrote: > I have code like this which dispatches on the type of a homogenous > vector: > > (define (gl-vector->type vec) >(cond > ((bytes? vec) GL_UNSIGNED_BYTE) > ((s8vector? vec) GL_BYTE) > ((u16vector? vec) GL_UNSIGNED_SHORT) > ((s16vector? vec

Re: [racket] what this compile time error mean?

2011-06-13 Thread Danny Yoo
On Mon, Jun 13, 2011 at 10:26 AM, Veer wrote: > When I run the code(shown below) in DrRacket , I get the error : > > compile: access from an uncertified context to unexported variable > from module: "/home/vvv/racket/collects/racket/contract/private/base.rkt" > in: apply-contract Odd; I can't re

[racket] Tutorial: writing a language (brainf*ck) in Racket

2011-06-13 Thread Danny Yoo
I've written a tutorial about how to extend Racket so it supports different languages. Material on this topic already exists in the Guide, but I wanted to write an extended example that covers the gauntlet, from setting up the PLaneT development links, to writing the semantics and parser, to final

Re: [racket] dispatch on type

2011-06-13 Thread Jos Koot
What one would want is object -> fixnum, where the fixnum identifies the type of the object. If the fixnums are not too big, one could dispatch by means of a vector reference. Jos > -Original Message- > From: users-boun...@racket-lang.org > [mailto:users-boun...@racket-lang.org] On Beha

Re: [racket] dispatch on type

2011-06-13 Thread Thomas Chust
2011/6/13 Stephan Houben : > [...] > I have code like this which dispatches on > the type of a homogenous vector: > [...] > I was wondering if there is a more efficient way to > do this, one which doesn't involve a linear scan > over all possible types. I presume that at the C level > there is a "t

[racket] what this compile time error mean?

2011-06-13 Thread Veer
When I run the code(shown below) in DrRacket , I get the error : compile: access from an uncertified context to unexported variable from module: "/home/vvv/racket/collects/racket/contract/private/base.rkt" in: apply-contract #lang web-server/insta (require web-server/templates) (require "web-util

[racket] dispatch on type

2011-06-13 Thread Stephan Houben
Dear list, I have code like this which dispatches on the type of a homogenous vector: (define (gl-vector->type vec) (cond ((bytes? vec) GL_UNSIGNED_BYTE) ((s8vector? vec) GL_BYTE) ((u16vector? vec) GL_UNSIGNED_SHORT) ((s16vector? vec) GL_SHORT) ((u32vector? vec) GL_UNSIGNED