[racket-users] Re: prepared queries

2017-03-14 Thread George Neuner

Hi Ryan,

Hope you enjoyed the snow day.  Lost power here for a while, but 
fortunately no damage.



On 3/13/2017 11:09 PM, Ryan Culpepper wrote:

On 03/13/2017 06:30 PM, George Neuner wrote:


Then there is the issue that deliberately prepared queries are not
optimized as heavily as normal queries - which is the case in pretty
much every DBMS that exists.  Heavyweight queries that require maximum
performance are harmed by preparation.


In general, performing a query consists of three steps: Prepare, Bind, 
and Execute. When there's a "one-step" approach, it's just a 
convenience wrapper around those three steps. So I'd be very surprised 
if Prepare intrinsically slowed down a query.


Maybe you mean that *parameterization* inhibits the query planner, 
because query planning doesn't take the values of query parameters 
into account. That seems to depend on the backend. PostgreSQL did 
planning at Prepare time before version 9.2 and does it at Bind time 
since 9.2 ("typically", the docs say). I don't know about other 
systems. But in any case, parameterization is under the control of the 
user.


If that's not what you meant, can you elaborate?


When I read this, it occurred to me that you and I have been talking at 
cross purposes because there are 2 distinct notions of "prepare":  
client side /prepare /and server side /PREPARE/ are unrelated and 
(mostly) not even associated.


So to put us both on the same page  [and educate anyone interested] ...

---
Unless a query is submitted using a SQL PREPARE command, then most DBMS 
will compile and plan AS IF the query were static text with inline 
arguments.^[1][2]   The server typically then will cache the code and 
plan for some time in case an identical query (both text and arguments) 
is submitted later.


The SQL PREPARE command - which includes query text - compiles the query 
using indirection hooks for any parameters, in lieu of having the actual 
arguments available.  [The compiled query is executed using the SQL 
EXECUTE command which supplies any needed arguments].   In most cases, a 
generic execution plan is generated based only on the code because 
specific argument values are unknown.


Some DBMS will simply continue to use a generic execution plan, others 
replan each time based on the specific arguments, and some change 
behavior depending on how often different arguments are supplied.  The 
savings (if any) come mainly from avoiding recompilation of the query 
for each different set of arguments.


/PREPARE/d queries are not cached in the same way as are static queries. 
/PREPARE/d queries are never dropped automatically - they persist until 
explicitly dropped by the user/application, or until their owning 
session^[3] is terminated.



On the client side, the /prepare/  protocol step creates local data 
structures for associating arguments with query parameters - structures 
which can be kept and reused (perhaps binding different arguments).  
Client /prepare/d queries persist on the client until dropped, but this 
is separate from - and has no effect on - server side query caching^[4] 
.  And except in the case of a SQL EXECUTE command, it has nothing to do 
with server /PREPARE/d queries.



[1] The compiler knows that arguments to be substituted for query 
parameters are not to be considered SQL code, and so the "expanded" 
query is guaranteed to be safe (for some definition) from SQL injection 
faults.


[2] The compiler does _not_ rewrite the query text ... "substitution" of 
arguments is in the compiled code.


[3] "Session" is not necessarily synonymous with "connection".  In some 
DBMS, a "session" can consist of multiple simultaneous connections which 
can share any temporary objects - temp tables, prepared queries, etc. - 
that have been created.


[4] Exceptions are local "library" DBMS such as SQLite, in which the 
"client" and "server" are together in the same process and query data 
structures are (or can be) shared.

  ---


So when you [Ryan] say:

If you are using `prepare` just for speed, it might help to know that 
most base connections have an internal statement cache that maps SQL 
strings to prepared statement objects. The cache is only used inside 
of transactions, though, to avoid issues with concurrent schema changes. 

and

Racket's db library always prepares a statement before executing it,
even if there are no query parameters. When allowed, instead of
closing the prepared statement immediately after executing it, the
connection stores it in a (Racket-side, per-connection) cache. The
cache key is just the SQL string. If you use the same query string
with different parameters, you'll still get the cached prepared
statement. 


I now am assuming that you are talking about client side protocol data 
structures and NOT about any use of SQL PREPARE / EXECUTE commands.


The reason I want to be clear about it is because /PREPARE/d queries 
persist and consume server resources until the session ends.  Long 

Re: [racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-14 Thread Marc Kaufmann
Thanks for the detailed answer Philip! Some of it is definitely over my
head. The reason I don't pass around the id is that I use the html field
exactly to track the id and wanted to avoid having to pass around the
argument left and right - and the only ways to pass it on are via forms or
by sticking it into the requested URL or by using continuations. I will
give the continuation-style solution a shot though, it's probably cleaner
to pass the id around as an argument.

Cheers,
Marc

On Tue, Mar 14, 2017 at 1:34 PM, Philip McGrath 
wrote:

> In this case it will work despite being a hack, because you know that your
> id argument affects only the display stage, not the processing stage:
> however, you can't know in general that this will work for dynamically
> generated formlets, and personally I would therefore be reluctant to rely
> on this, both because it is fragile in terms of changes to your
> implementation of matrix-formlet that you might make later.
>
> If you are using native continuations (i.e. not the stateless #lang
> web-server), you can use send/formlet or embed-formlet to deal with this
> correctly and easily. (At a lower level, you could also do something like
>
>> (define-values (xexpr-forest bindings->result i)
>>   ((matrix-formlet "3") 0))
>
> to access the low-level rendering, processing function, and next allowable
> input integer directly.)
>
> It is a little more tricky in #lang web-server, because your formlet and
> it's generated processing function are plain functions, and thus not
> serializable (see this old thread for discussion: https://groups.
> google.com/d/topic/racket-users/lMYWjodgpmo/discussion). The easy
> work-around is to keep the arguments you need to reproduce your formlet
> around as part of the closure, e.g. by rewriting your matrix-submission
> like this:
>
>> (define (matrix-submission req id)
>>   (define-values (number-of-ones user-id)
>>   (formlet-process (matrix-formlet id) req))
>>   ...)
>
> The alternative is to either recompile the formlet library using #lang
> web-server/base or to implement your formlet at a low level using
> serial-lambda and not use any of the library tools.
>
> In this specific case, though, if you are using this hidden input field
> just to remember the user id from one request to the next (i.e. you
> wouldn't ever change it on the client side with JavaScript or something),
> the best solution is not to put it in the form at all, but have it be part
> of the continuation. This could also have security advantages, if you
> cryptographically sign your continuations or store them on the server. If
> that works for your use case, you could simply write:
> (define matrix-formlet
>   input-string)
> display it with
>
>> (matrix-submission
>>  (send/suspend
>>   (λ (k-url)
>> (response/xexpr
>>  `(html (body (form
>>((action "/the-matrix-submitted")
>> (method "post"))
>>,@(formlet-display matrix-formlet)
>>(input ([type "submit"]
>>  user-id)
>
> and then define matrix-submission as
>
>> (define (matrix-submission req user-id)
>>   (define number-of-ones
>>   (formlet-process matrix-formlet req))
>>   ...)
>
>
> -Philip
>
> On Tue, Mar 14, 2017 at 12:01 PM, Marc Kaufmann  > wrote:
>
>> Hi,
>>
>> I have created a formlet like so:
>>
>> (define (matrix-formlet id)
>>   (formlet
>> (#%# ,{input-string . => . ones}
>>  ,{(to-string (required (hidden id))) . => . user-id}
>>  )
>> (values ones user-id)))
>>
>> I display this as follows:
>>
>> `(form
>>   ((action "/the-matrix-submitted")
>>(method "post"))
>>  ,@(formlet-display (matrix-formlet user-id))
>>  (input ([type "submit"]
>>
>> and process it like this:
>>
>> (define (matrix-submission req)
>>   (define-values (number-of-ones user-id)
>>  (formlet-process (matrix-formlet "3") req))
>>   ...)
>>
>> While this works, the formlet I use to display and process are not really
>> the same, since they are created on the spot, and created with different
>> parameters. So far it seems to work, but I am worried that this will break
>> down, and clearly this isn't the right way to go about creating
>> parametrizable formlets.
>>
>> The questions are (i) is the above going to work despite being a hack,
>> and (ii) is there a correct and easy way to do the same thing?
>>
>> Cheers,
>> Marc
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an 

Re: [racket-users] help with splicing syntax class error report

2017-03-14 Thread Stephen Chang
You get the dreaded "bad syntax" because syntax-parse doesnt know
which pattern failed. There a couple of things you can do:

1) Use a commit pattern, which tells syntax-parse not to backtrack
past the commit point. You have to change the order of patterns for
this to work.

  (define-splicing-syntax-class maybe
#:datum-literals (:thing)
(pattern (~seq) #:attr n #'0)
(pattern (~seq ~! :thing n:id)))

2) Use the ~post pattern, which essentially tells syntax-parse to give
priority to a particular pattern.

  (define-splicing-syntax-class maybe
#:datum-literals (:thing)
(pattern (~post (~seq :thing n:id)))
(pattern (~seq) #:attr n #'0))

On Tue, Mar 14, 2017 at 1:13 PM, Dan Liebgold
 wrote:
> Hi -
>
> I have some legacy code syntax I'm retrofitting with syntax-parse. Is there a 
> simple way to have this type of syntax error report a better error message:
>
> http://pasterack.org/pastes/59739
>
> I'd like it to point directly to ":thung" and say it expected ":thing" or 
> nothing there if possible.
>
> Thanks,
> Dan
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-14 Thread Philip McGrath
In this case it will work despite being a hack, because you know that your
id argument affects only the display stage, not the processing stage:
however, you can't know in general that this will work for dynamically
generated formlets, and personally I would therefore be reluctant to rely
on this, both because it is fragile in terms of changes to your
implementation of matrix-formlet that you might make later.

If you are using native continuations (i.e. not the stateless #lang
web-server), you can use send/formlet or embed-formlet to deal with this
correctly and easily. (At a lower level, you could also do something like

> (define-values (xexpr-forest bindings->result i)
>   ((matrix-formlet "3") 0))

to access the low-level rendering, processing function, and next allowable
input integer directly.)

It is a little more tricky in #lang web-server, because your formlet and
it's generated processing function are plain functions, and thus not
serializable (see this old thread for discussion:
https://groups.google.com/d/topic/racket-users/lMYWjodgpmo/discussion). The
easy work-around is to keep the arguments you need to reproduce your
formlet around as part of the closure, e.g. by rewriting your
matrix-submission like this:

> (define (matrix-submission req id)
>   (define-values (number-of-ones user-id)
>   (formlet-process (matrix-formlet id) req))
>   ...)

The alternative is to either recompile the formlet library using #lang
web-server/base or to implement your formlet at a low level using
serial-lambda and not use any of the library tools.

In this specific case, though, if you are using this hidden input field
just to remember the user id from one request to the next (i.e. you
wouldn't ever change it on the client side with JavaScript or something),
the best solution is not to put it in the form at all, but have it be part
of the continuation. This could also have security advantages, if you
cryptographically sign your continuations or store them on the server. If
that works for your use case, you could simply write:
(define matrix-formlet
  input-string)
display it with

> (matrix-submission
>  (send/suspend
>   (λ (k-url)
> (response/xexpr
>  `(html (body (form
>((action "/the-matrix-submitted")
> (method "post"))
>,@(formlet-display matrix-formlet)
>(input ([type "submit"]
>  user-id)

and then define matrix-submission as

> (define (matrix-submission req user-id)
>   (define number-of-ones
>   (formlet-process matrix-formlet req))
>   ...)


-Philip

On Tue, Mar 14, 2017 at 12:01 PM, Marc Kaufmann 
wrote:

> Hi,
>
> I have created a formlet like so:
>
> (define (matrix-formlet id)
>   (formlet
> (#%# ,{input-string . => . ones}
>  ,{(to-string (required (hidden id))) . => . user-id}
>  )
> (values ones user-id)))
>
> I display this as follows:
>
> `(form
>   ((action "/the-matrix-submitted")
>(method "post"))
>  ,@(formlet-display (matrix-formlet user-id))
>  (input ([type "submit"]
>
> and process it like this:
>
> (define (matrix-submission req)
>   (define-values (number-of-ones user-id)
>  (formlet-process (matrix-formlet "3") req))
>   ...)
>
> While this works, the formlet I use to display and process are not really
> the same, since they are created on the spot, and created with different
> parameters. So far it seems to work, but I am worried that this will break
> down, and clearly this isn't the right way to go about creating
> parametrizable formlets.
>
> The questions are (i) is the above going to work despite being a hack, and
> (ii) is there a correct and easy way to do the same thing?
>
> Cheers,
> Marc
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] help with splicing syntax class error report

2017-03-14 Thread Dan Liebgold
Hi -

I have some legacy code syntax I'm retrofitting with syntax-parse. Is there a 
simple way to have this type of syntax error report a better error message:

http://pasterack.org/pastes/59739

I'd like it to point directly to ":thung" and say it expected ":thing" or 
nothing there if possible.

Thanks,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-14 Thread Marc Kaufmann
Fair enough if that's the specification, even if it is unexpected (to me at 
least). Thanks,

Marc

On Tuesday, March 14, 2017 at 10:41:02 AM UTC-4, Jay McCarthy wrote:
> Hi Marc,
> 
> libxml2 only allows numeric entity references in this range:
> 
> * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
> * | [#x1-#x10]
> 
> Racket doesn't fully respect that, but both disallow 0. I think we
> should match libxml2 and tighten the contract.
> 
> Jay
> 
> -- 
> -=[ Jay McCarthy   http://jeapostrophe.github.io]=-
> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
> -=[ Moses 1:33: And worlds without number have I created; ]=-

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-14 Thread Marc Kaufmann
Hi,

I have created a formlet like so:

(define (matrix-formlet id)
  (formlet
(#%# ,{input-string . => . ones}
 ,{(to-string (required (hidden id))) . => . user-id}
 )
(values ones user-id)))

I display this as follows:

`(form
  ((action "/the-matrix-submitted")
   (method "post"))
 ,@(formlet-display (matrix-formlet user-id))
 (input ([type "submit"]

and process it like this:

(define (matrix-submission req)
  (define-values (number-of-ones user-id)
 (formlet-process (matrix-formlet "3") req))
  ...)

While this works, the formlet I use to display and process are not really the 
same, since they are created on the spot, and created with different 
parameters. So far it seems to work, but I am worried that this will break 
down, and clearly this isn't the right way to go about creating parametrizable 
formlets. 

The questions are (i) is the above going to work despite being a hack, and (ii) 
is there a correct and easy way to do the same thing?

Cheers,
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: linking with raco ctool : unable to find libracket3mxxxxxxx.lib

2017-03-14 Thread Alexander McLin
You need to compile Racket from source to generate the .lib file, it is not 
distributed with the installation.

You need to make sure the source is the same version as your installed Racket 
and it is compiled targeting the same bit architecture as the installed Racket 
version. Then copy the generated .lib file to the Racket installation's lib 
directory. The directory's location depends on your operating system.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-14 Thread Jay McCarthy
Hi Marc,

libxml2 only allows numeric entity references in this range:

* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
* | [#x1-#x10]

Racket doesn't fully respect that, but both disallow 0. I think we
should match libxml2 and tighten the contract.

Jay

-- 
-=[ Jay McCarthy   http://jeapostrophe.github.io]=-
-=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
-=[ Moses 1:33: And worlds without number have I created; ]=-

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-14 Thread Marc Kaufmann
I understand that the number 1 is different from the string (although I would 
probably have expected it to be turned into a string before being passed to the 
browser or something, but it doesn't matter for my purposes). What does 
surprise me is that (xexpr->string 1) gives , yet (xexpr->string 0) does not 
give  but throws an error. Is this due to the XML specification, or due to 
the Racket implementation of X-expressions?

Cheers,
Marc



On Monday, March 13, 2017 at 10:32:50 PM UTC-4, Philip McGrath wrote:
> Numbers in x-expressions are interpreted as XML entities, not as the string 
> representation of the number. The value of (xexpr->string '(html 1)), to use 
> your example, is "". The 1 represents the character that 
> Racket would represent as #\u0001, i.e. the value of (integer->char 1). In 
> contrast, (char->integer #\1) produces 49.
> 
> 
> 
> -Philip
> 
> 
> 
> On Mon, Mar 13, 2017 at 8:38 PM, Marc Kaufmann  wrote:
> Hi,
> 
> 
> 
> I am creating matrices of 0s and 1s that I display in HTML-tables and 
> somewhat surprisingly I found out that 0s are not permissible in 
> X-expressions, while 1s are:
> 
> 
> 
> (require web-server/http)
> 
> 
> 
> (response/xexpr '(html 1)) ; Fine, no trouble.
> 
> (response/xexpr '(html 0)) ; Blow-up.
> 
> 
> 
> The specific violation is the following:
> 
> 
> 
> "response/xexpr: contract violation;
> 
>  Not an Xexpr. Expected a string, symbol, valid numeric entity, comment, 
> processing instruction, or list, given 0"
> 
> 
> 
> After some digging around, it turns out that only numbers that satisfy 
> valid-char? are acceptable, which means "exact-nonnegative-integer whose 
> character interpretation under UTF-8 is from the set ([#x1-#xD7FF] | 
> [#xE000-#xFFFD] | [#x1-#x10]), in accordance with section 2.2 of the 
> XML 1.1 spec."
> 
> 
> 
> First, should 0 really not be accepted? (I am not going to try and figure out 
> the UTF-8 interpretation...) And second, is the reason that negative numbers 
> are not acceptable that they are not under the XML spec above? This took me 
> by surprise and means I have to put number->string in a bunch of places.
> 
> 
> 
> Cheers,
> 
> Marc
> 
> 
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users...@googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] macro definitions with #lang racket/base vs #lang racket

2017-03-14 Thread NeverTooOldToCode
Thank you! 
I see now that the very same question was already asked on this list in 2015, 
by a compatriot of mine no less. It didn't show up in my online searches 
beforehand, the keyword missing was "transformer environment".

On Tuesday, March 14, 2017 at 1:05:31 PM UTC+1, Philip McGrath wrote:
> #lang racket also provides racket/base in the transformer environment.
> 
> 
> 
> -Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] macro definitions with #lang racket/base vs #lang racket

2017-03-14 Thread Philip McGrath
#lang racket also provides racket/base in the transformer environment.

-Philip

On Tue, Mar 14, 2017 at 5:45 AM, NeverTooOldToCode 
wrote:

> From Fear of Macros again, all input in the DrRacket definition window.
>
> This works:
>
> #lang racket/base
>
> (require (for-syntax racket/base))
>
> (define-syntax (show-me stx)
>   (display stx)
>   #'(void))
>
> If you mouse-hover over the keywords, define-syntax is imported from #lang
> racket/base, and display and #' are imported (require (for-syntax
> racket/base)).
> Because display and #' are needed at compile time, not run time.
>
> Therefore, logically, this doesn't work:
>
> #lang racket/base
>
> (define-syntax (show-me stx)
>   (display stx)
>   #'(void))
>
> Gives the error:
> display: unbound identifier in the transformer environment; also, no #%app
> syntax transformer is bound in: display
> And if we remove the display statement, the same error for #'
>
> So far so good.
>
> BUT
>
> Why does this work?
>
> #lang racket
>
> (define-syntax (show-me stx)
>   (display stx)
>   #'(void))
>
> Now define-syntax *and* display *and* #' are directly imported from #lang
> racket. What about compile time vs run time? What does #lang racket do
> apart from including many libraries on top of racket/base?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] PLDI ACM Student Research Competition (SRC)

2017-03-14 Thread Tobias Grosser
The ACM Student Research Competition (SRC), sponsored by Microsoft 
Research, offers a unique forum for undergraduate and graduate students 
to present their original research on programming language design, 
implementation, theory, applications, and performance at PLDI 2017.  The 
goal is to give students a place to discuss their research with experts 
in their field and to help them sharpen their research and communication 
skills.

Please find more information at 
http://pldi17.sigplan.org/track/pldi-2017-student-research-competition

Deadline for submission of the extended abstracts: Friday April 7th,
2017.

## Rounds

Three rounds of competition will take place before and during PLDI 
2017.  All rounds are held in two categories: Undergraduate Students and 
Graduate Students (Masters and PhD level).  Winners of the third round 
will be invited to participate in the SRC Grand Finals competition 
hosted by the ACM.  The PLDI rounds are:
* Extended abstract round. All students are encouraged to submit an 
extended abstract outlining their research.
* Poster session. Based on the abstracts, a panel of judges will select 
the most promising authors to participate in the poster session which 
will take place at PLDI. In the poster session, students will have the 
opportunity to present their work to the judges, who will select a group 
of semi-finalists in each category to advance to the next round.
* PLDI presentation. The last PLDI round will consist of an oral 
presentation at the conference to compete for the three top places.

## Prizes

Winners of the three top places in each category receive prizes of $500 
for the first place winner, $300 for the second place winner and $200 
for the third place winner, respectively.

The top three undergraduate and graduate winners receive an award medal 
and a one-year complimentary ACM student membership with a subscription 
to ACM’s Digital Library.

## ACM SRC Grand Finals

First place winners in each category will be invited to participate in 
the ACM SRC Grand Finals, an on-line round of competition between 
first-place SRC winners from different ACM conferences held in 2017.  
Grand Finals will be judged by a different, ACM-appointed panel of
judges.

Winners of the three top Grand Finals places in each category will 
receive additional prizes of $500 for the first place winner, $300 for 
the second place winner and $200 for the third place winner, 
respectively.  They will be also invited to the annual ACM Award Banquet 
along with prestigious ACM award winners, including the winner of the 
Turing Award.

## Eligibility criteria

Current student status, either graduate or undergraduate, at the time of 
submission deadline.

In order to advance to the poster session round, participants of the SRC 
must be current ACM (student) members.

## Extended Abstract Submission Details

Each submission should include the student author’s name, institutional
affiliation, e-mail address, and postal address; research advisor’s
name; ACM student member number; category (undergraduate or graduate);
research title; and an extended abstract addressing the following: 

The extended abstract must not exceed 1000 words and must not be longer
than 2 pages. Reference lists do not count towards these limits. 

## SRC Panel

Xavier Martorell, BSC and UPC (chair).
Tobias Grosser, ETH Zurich
Sandrine Blazy, IRISA
Martin Kong, RICE University
Timothy Bourke, INRIA
Cole Schlesinger, Barefoot Networks, Inc.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] macro definitions with #lang racket/base vs #lang racket

2017-03-14 Thread NeverTooOldToCode
>From Fear of Macros again, all input in the DrRacket definition window.

This works:

#lang racket/base

(require (for-syntax racket/base))

(define-syntax (show-me stx)
  (display stx)
  #'(void))

If you mouse-hover over the keywords, define-syntax is imported from #lang 
racket/base, and display and #' are imported (require (for-syntax racket/base)).
Because display and #' are needed at compile time, not run time.

Therefore, logically, this doesn't work:

#lang racket/base

(define-syntax (show-me stx)
  (display stx)
  #'(void))

Gives the error: 
display: unbound identifier in the transformer environment; also, no #%app 
syntax transformer is bound in: display
And if we remove the display statement, the same error for #'

So far so good.

BUT

Why does this work?

#lang racket

(define-syntax (show-me stx)
  (display stx)
  #'(void))

Now define-syntax *and* display *and* #' are directly imported from #lang 
racket. What about compile time vs run time? What does #lang racket do apart 
from including many libraries on top of racket/base?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.