Re: [racket-users] What's the point of make-continuation-mark-key?

2020-01-11 Thread Sam Tobin-Hochstadt
We created the continuation-mark-key data type in ~2011 to support Typed
Racket. At that point, Racket had continuation mark support for more than a
decade using other values as keys.

Sam

On Sat, Jan 11, 2020, 11:37 PM Jack Firth  wrote:

> That makes sense. I think the thing that seems most confusing to me is
> that using the continuation-mark-key data type is *optional*. Why bother
> allowing arbitrary kinds of keys?
>
> On Saturday, January 11, 2020 at 8:02:44 PM UTC-8, Matthew Flatt wrote:
>>
>> It would be reasonable to generalize `chaperone-continuation-mark-key`
>> to apply in cases where `chaperone-struct` could work, with similar
>> sorts of evidence that chaperoning is allowed provided by a caller of
>> `chaperone-continuation-mark-key`. I guess we just didn't think about
>> it that way when `chaperone-continuation-mark-key` was added, so it was
>> added in a way more like `chaperone-vector` and other chaperones that
>> apply to more specialized representations.
>>
>> Other kinds of keys, like symbols, can't be impersonated because their
>> representations don't accommodate chaperones. (In other words, they're
>> like structs declared with `#:authentic`.)
>>
>> At Sat, 11 Jan 2020 19:48:17 -0800 (PST), Jack Firth wrote:
>> > Based on my reading of Continuation Frames and Marks
>> > <
>> https://docs.racket-lang.org/reference/eval-model.html#(part._mark-model)>,
>>
>> > any value at all can be used as a key for a continuation mark. So why
>> does
>> > make-continuation-mark-key
>> > <
>> https://docs.racket-lang.org/reference/contmarks.html#%28def._%28%28quote._~23
>> > ~25kernel%29._make-continuation-mark-key%29%29>
>> > exist, and why is there a special continuation-mark-key
>> > <
>> https://docs.racket-lang.org/reference/contmarks.html#%28def._%28%28quote._~23
>> > ~25kernel%29._continuation-mark-key~3f%29%29>
>> > data type? Couldn't you use any arbitrary gensym, or a singleton
>> struct?
>> > The docs for make-continuation-mark-key mention that the returned key
>> can
>> > be impersonated and other kinds of keys can't, but they don't explain
>> why
>> > that would be the case.
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/racket-users/773a2caa-d6b3-48b8-becf-cc3105a6
>> > 60e0%40googlegroups.com.
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/9ac7e680-f32e-4a79-8cb7-4799ea5e953c%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYaGvX2ohTsK3snkaXR4t%3DJ4pHOD6E_KO33GmJBbJ%3DBqQ%40mail.gmail.com.


Re: [racket-users] What's the point of make-continuation-mark-key?

2020-01-11 Thread Jack Firth
That makes sense. I think the thing that seems most confusing to me is that 
using the continuation-mark-key data type is *optional*. Why bother 
allowing arbitrary kinds of keys?

On Saturday, January 11, 2020 at 8:02:44 PM UTC-8, Matthew Flatt wrote:
>
> It would be reasonable to generalize `chaperone-continuation-mark-key` 
> to apply in cases where `chaperone-struct` could work, with similar 
> sorts of evidence that chaperoning is allowed provided by a caller of 
> `chaperone-continuation-mark-key`. I guess we just didn't think about 
> it that way when `chaperone-continuation-mark-key` was added, so it was 
> added in a way more like `chaperone-vector` and other chaperones that 
> apply to more specialized representations. 
>
> Other kinds of keys, like symbols, can't be impersonated because their 
> representations don't accommodate chaperones. (In other words, they're 
> like structs declared with `#:authentic`.) 
>
> At Sat, 11 Jan 2020 19:48:17 -0800 (PST), Jack Firth wrote: 
> > Based on my reading of Continuation Frames and Marks 
> > <
> https://docs.racket-lang.org/reference/eval-model.html#(part._mark-model)>, 
>
> > any value at all can be used as a key for a continuation mark. So why 
> does 
> > make-continuation-mark-key 
> > <
> https://docs.racket-lang.org/reference/contmarks.html#%28def._%28%28quote._~23
>  
> > ~25kernel%29._make-continuation-mark-key%29%29> 
> > exist, and why is there a special continuation-mark-key 
> > <
> https://docs.racket-lang.org/reference/contmarks.html#%28def._%28%28quote._~23
>  
> > ~25kernel%29._continuation-mark-key~3f%29%29> 
> > data type? Couldn't you use any arbitrary gensym, or a singleton struct? 
> > The docs for make-continuation-mark-key mention that the returned key 
> can 
> > be impersonated and other kinds of keys can't, but they don't explain 
> why 
> > that would be the case. 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/racket-users/773a2caa-d6b3-48b8-becf-cc3105a6
>  
> > 60e0%40googlegroups.com. 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/9ac7e680-f32e-4a79-8cb7-4799ea5e953c%40googlegroups.com.


Re: [racket-users] Proxying websockets via web-server

2020-01-11 Thread Eli Barzilay
On Fri, Jan 10, 2020 at 9:18 PM Jay McCarthy  wrote:
>
> I don't completely understand what you want to do. Is there a reason
> you can't use the WebSocket implementation ---
> https://docs.racket-lang.org/rfc6455/index.html --- and then use
> normal inter-Racket communication like channels and stuff to work with
> the rest of your Web application?

It would be nice if the documentation for that would have some
examples, but after playing with it for a bit it looks like it's
broken, possibly because I don't use it properly.  I keep getting
errors that look like "read-request: malformed request ..." with
binary goo in the error message, which usually displayed like random
unicode, sometimes it breaks the terminal due to weird escape
sequences.  Even if I'm not using it properly, such errors shouldn't
happen.

And as a side note, one of the errors I saw was:

 exception raised by error display handler: format: ill-formed pattern string
   explanation: tag `~l' not allowed
   pattern string: "read-request: malformed request
...junk...~l...more..."; original exception raised: read-request: ...

which looks like a bad error re-raising in the web server code.  A
quick grep finds at least one suspicious line which erroneously uses a
random string as a format string:

(with-handlers ([exn:fail? (lambda (exn) (network-error
'output-file (exn-message exn)))]) ...

-- 
   ((x=>x(x))(x=>x(x)))  Eli Barzilay:
   http://barzilay.org/  Maze is Life!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CALO-gutiuJiDFnP1md14Y9%2B1gjBLiCDtmsRSDQo%2BrztpYbRNfA%40mail.gmail.com.


Re: [racket-users] What's the point of make-continuation-mark-key?

2020-01-11 Thread Matthew Flatt
It would be reasonable to generalize `chaperone-continuation-mark-key`
to apply in cases where `chaperone-struct` could work, with similar
sorts of evidence that chaperoning is allowed provided by a caller of
`chaperone-continuation-mark-key`. I guess we just didn't think about
it that way when `chaperone-continuation-mark-key` was added, so it was
added in a way more like `chaperone-vector` and other chaperones that
apply to more specialized representations.

Other kinds of keys, like symbols, can't be impersonated because their
representations don't accommodate chaperones. (In other words, they're
like structs declared with `#:authentic`.)

At Sat, 11 Jan 2020 19:48:17 -0800 (PST), Jack Firth wrote:
> Based on my reading of Continuation Frames and Marks 
> , 
> any value at all can be used as a key for a continuation mark. So why does 
> make-continuation-mark-key 
>  ~25kernel%29._make-continuation-mark-key%29%29> 
> exist, and why is there a special continuation-mark-key 
>  ~25kernel%29._continuation-mark-key~3f%29%29> 
> data type? Couldn't you use any arbitrary gensym, or a singleton struct? 
> The docs for make-continuation-mark-key mention that the returned key can 
> be impersonated and other kinds of keys can't, but they don't explain why 
> that would be the case.
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/773a2caa-d6b3-48b8-becf-cc3105a6
> 60e0%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5e1a9a61.1c69fb81.ad6d0.58bcSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


[racket-users] What's the point of make-continuation-mark-key?

2020-01-11 Thread Jack Firth
Based on my reading of Continuation Frames and Marks 
, 
any value at all can be used as a key for a continuation mark. So why does 
make-continuation-mark-key 

 
exist, and why is there a special continuation-mark-key 

 
data type? Couldn't you use any arbitrary gensym, or a singleton struct? 
The docs for make-continuation-mark-key mention that the returned key can 
be impersonated and other kinds of keys can't, but they don't explain why 
that would be the case.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/773a2caa-d6b3-48b8-becf-cc3105a660e0%40googlegroups.com.