Re: [racket-users] carmack s-expression tweet

2015-04-15 Thread Adriaan Leijnse
On Saturday, March 28, 2015 at 12:15:39 AM UTC+1, Alexis King wrote:
 It might be interesting to create a binary s-expression format for more 
 efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even 
 with some sort of optional compression. Racket’s reader is fairly 
 complicated, though, so it might need to restrict itself to a useful subset?

I think the Clojure community has built exactly what you're thinking of: 
https://github.com/Datomic/fressian/wiki

-- 
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] carmack s-expression tweet

2015-04-15 Thread Jens Axel Søgaard
FWIW the binary-class package by Roman Klochkov looks pretty nice:

http://pkg-build.racket-lang.org/doc/binary-class/index.html

/Jens Axel


2015-04-15 11:08 GMT+02:00 Adriaan Leijnse adriaan.leij...@gmail.com:

 On Saturday, March 28, 2015 at 12:15:39 AM UTC+1, Alexis King wrote:
  It might be interesting to create a binary s-expression format for more
 efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even
 with some sort of optional compression. Racket’s reader is fairly
 complicated, though, so it might need to restrict itself to a useful subset?

 I think the Clojure community has built exactly what you're thinking of:
 https://github.com/Datomic/fressian/wiki

 --
 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.




-- 
-- 
Jens Axel Søgaard

-- 
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] carmack s-expression tweet

2015-03-27 Thread Brian Craft
Was this a reference to a particular racket lib? And if so, which one?

https://twitter.com/ID_AA_Carmack/status/577878167542734848

-- 
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] carmack s-expression tweet

2015-03-27 Thread Neil Van Dyke

Brian Craft wrote on 03/27/2015 03:45 PM:

Was this a reference to a particular racket lib? And if so, which one?

https://twitter.com/ID_AA_Carmack/status/577878167542734848



The `read` and `write` procedures are one way to do this.  (Though you 
want to disable some features when you do that.  Racket adds a bunch of 
stuff not in RnRS Scheme.)


Neil V.

--
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] carmack s-expression tweet

2015-03-27 Thread Alexis King
It might be interesting to create a binary s-expression format for more 
efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even with 
some sort of optional compression. Racket’s reader is fairly complicated, 
though, so it might need to restrict itself to a useful subset?

 On Mar 27, 2015, at 16:12, John Carmack jo...@oculusvr.com wrote:
 
 On Friday, March 27, 2015 at 2:45:00 PM UTC-5, Brian Craft wrote:
 Was this a reference to a particular racket lib? And if so, which one?
 
 https://twitter.com/ID_AA_Carmack/status/577878167542734848
 
 I have a long history of bit packing multiplayer network messages, but for 
 this project I am just sending text s-expressions with read and write, and my 
 life is much better.  Yes, it is bulkier, but I'm sending binary VoIP data 
 after it, so it won't dominate bandwidth, and making software easier to write 
 and more reliable is a fine way to spend some of our wealth of resources 
 today.
 
 -- 
 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] carmack s-expression tweet

2015-03-27 Thread Sean Kanaley
Couldn't this binary s-expression just be a struct?

'(move 3 5)

becomes

(struct move (x y) #:prefab)
(move 3 5)

client/server will likely have some kind of matching either way, and prefab
structs can be matched

(match command
  [(list 'move x y) ...

becomes

(match command
  [(move x y) ...

On Fri, Mar 27, 2015 at 7:15 PM, Alexis King lexi.lam...@gmail.com wrote:

 It might be interesting to create a binary s-expression format for more
 efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even
 with some sort of optional compression. Racket’s reader is fairly
 complicated, though, so it might need to restrict itself to a useful subset?

  On Mar 27, 2015, at 16:12, John Carmack jo...@oculusvr.com wrote:
 
  On Friday, March 27, 2015 at 2:45:00 PM UTC-5, Brian Craft wrote:
  Was this a reference to a particular racket lib? And if so, which one?
 
  https://twitter.com/ID_AA_Carmack/status/577878167542734848
 
  I have a long history of bit packing multiplayer network messages, but
 for this project I am just sending text s-expressions with read and write,
 and my life is much better.  Yes, it is bulkier, but I'm sending binary
 VoIP data after it, so it won't dominate bandwidth, and making software
 easier to write and more reliable is a fine way to spend some of our wealth
 of resources today.
 
  --
  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.


-- 
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] carmack s-expression tweet

2015-03-27 Thread Jay McCarthy
Look at my original response to John's post about this... The binary format
you are thinking of is racket/fasl.

Jay

On Friday, March 27, 2015, Sean Kanaley skana...@gmail.com wrote:

 Couldn't this binary s-expression just be a struct?

 '(move 3 5)

 becomes

 (struct move (x y) #:prefab)
 (move 3 5)

 client/server will likely have some kind of matching either way, and
 prefab structs can be matched

 (match command
   [(list 'move x y) ...

 becomes

 (match command
   [(move x y) ...

 On Fri, Mar 27, 2015 at 7:15 PM, Alexis King lexi.lam...@gmail.com
 javascript:_e(%7B%7D,'cvml','lexi.lam...@gmail.com'); wrote:

 It might be interesting to create a binary s-expression format for more
 efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even
 with some sort of optional compression. Racket’s reader is fairly
 complicated, though, so it might need to restrict itself to a useful subset?

  On Mar 27, 2015, at 16:12, John Carmack jo...@oculusvr.com
 javascript:_e(%7B%7D,'cvml','jo...@oculusvr.com'); wrote:
 
  On Friday, March 27, 2015 at 2:45:00 PM UTC-5, Brian Craft wrote:
  Was this a reference to a particular racket lib? And if so, which one?
 
  https://twitter.com/ID_AA_Carmack/status/577878167542734848
 
  I have a long history of bit packing multiplayer network messages, but
 for this project I am just sending text s-expressions with read and write,
 and my life is much better.  Yes, it is bulkier, but I'm sending binary
 VoIP data after it, so it won't dominate bandwidth, and making software
 easier to write and more reliable is a fine way to spend some of our wealth
 of resources today.
 
  --
  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
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@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
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@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
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
Jay McCarthy
http://jeapostrophe.github.io

   Wherefore, be not weary in well-doing,
  for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great.
  - DC 64:33

-- 
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] carmack s-expression tweet

2015-03-27 Thread Alexis King
Oh, very neat... racket/fasl was precisely the sort of thing I was thinking of.

 On Mar 27, 2015, at 17:26, Jay McCarthy jay.mccar...@gmail.com wrote:
 
 Look at my original response to John's post about this... The binary format 
 you are thinking of is racket/fasl.
 
 Jay
 
 On Friday, March 27, 2015, Sean Kanaley skana...@gmail.com 
 mailto:skana...@gmail.com wrote:
 Couldn't this binary s-expression just be a struct?
 
 '(move 3 5)
 
 becomes
 
 (struct move (x y) #:prefab)
 (move 3 5)
 
 client/server will likely have some kind of matching either way, and prefab 
 structs can be matched
 
 (match command
   [(list 'move x y) ...
 
 becomes
 
 (match command
   [(move x y) ...
 
 On Fri, Mar 27, 2015 at 7:15 PM, Alexis King lexi.lam...@gmail.com 
 javascript:_e(%7B%7D,'cvml','lexi.lam...@gmail.com'); wrote:
 It might be interesting to create a binary s-expression format for more 
 efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even 
 with some sort of optional compression. Racket’s reader is fairly 
 complicated, though, so it might need to restrict itself to a useful subset?
 
  On Mar 27, 2015, at 16:12, John Carmack jo...@oculusvr.com 
  javascript:_e(%7B%7D,'cvml','jo...@oculusvr.com'); wrote:
 
  On Friday, March 27, 2015 at 2:45:00 PM UTC-5, Brian Craft wrote:
  Was this a reference to a particular racket lib? And if so, which one?
 
  https://twitter.com/ID_AA_Carmack/status/577878167542734848 
  https://twitter.com/ID_AA_Carmack/status/577878167542734848
 
  I have a long history of bit packing multiplayer network messages, but for 
  this project I am just sending text s-expressions with read and write, and 
  my life is much better.  Yes, it is bulkier, but I'm sending binary VoIP 
  data after it, so it won't dominate bandwidth, and making software easier 
  to write and more reliable is a fine way to spend some of our wealth of 
  resources today.
 
  --
  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 
  javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');.
  For more options, visit https://groups.google.com/d/optout 
  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 
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout 
 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 
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 
 -- 
 Jay McCarthy
 http://jeapostrophe.github.io http://jeapostrophe.github.io/
 
Wherefore, be not weary in well-doing,
   for ye are laying the foundation of a great work.
 And out of small things proceedeth that which is great.
   - DC 64:33

-- 
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] carmack s-expression tweet

2015-03-27 Thread Neil Van Dyke
Just comenting only on Alexis's suggestion here, since sounds like John 
is happy with sexps for now.


I don't see how `racket/fasl` is suitable for heterogeneous interop, 
which is a very common case needing this, perhaps the most common. 
Spec-wise, `racket/fasl` is not defined, beyond that it can be shared 
between instances of the same Racket version.  This FASL is fine for 
writing out compiled code files that are already specific to Racket 
version, or perhaps IPC or stored serialization when you're certain that 
the same Racket version will be used to write and read.  Everything else 
I can think of, you want an open spec.


You could make simple *specified* sexp serialization that is stable 
between Racket versions and can also be implemented independent of 
Racket (e.g., write type tag byte according to spec, write byte(s) 
prefixes for length of variable-length objects, possibly references to 
pre-shared strings/symbols, and possibly do some kind of string table 
compression as you go, etc.).  There's also always off-the-shelf specs, 
like Google protobufs.  Protobufs are overkill for most purposes, and 
can be unnecessarily cumbersome/bureaucratic to work with, but are 
available, with lots of implementations.


Neil V.

--
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] carmack s-expression tweet

2015-03-27 Thread Alexis King
Hmm, yes, on closer inspection, I see that you’re right. It’s not worthless, 
but it’s definitely not ideal for actually using as a communication protocol. 
So I guess my original point still stands: having a consistent binary encoding 
for s-expressions could be nice.

 On Mar 27, 2015, at 18:10, Neil Van Dyke n...@neilvandyke.org wrote:
 
 Just comenting only on Alexis's suggestion here, since sounds like John is 
 happy with sexps for now.
 
 I don't see how `racket/fasl` is suitable for heterogeneous interop, which is 
 a very common case needing this, perhaps the most common. Spec-wise, 
 `racket/fasl` is not defined, beyond that it can be shared between instances 
 of the same Racket version.  This FASL is fine for writing out compiled code 
 files that are already specific to Racket version, or perhaps IPC or stored 
 serialization when you're certain that the same Racket version will be used 
 to write and read.  Everything else I can think of, you want an open spec.
 
 You could make simple *specified* sexp serialization that is stable between 
 Racket versions and can also be implemented independent of Racket (e.g., 
 write type tag byte according to spec, write byte(s) prefixes for length of 
 variable-length objects, possibly references to pre-shared strings/symbols, 
 and possibly do some kind of string table compression as you go, etc.).  
 There's also always off-the-shelf specs, like Google protobufs.  Protobufs 
 are overkill for most purposes, and can be unnecessarily 
 cumbersome/bureaucratic to work with, but are available, with lots of 
 implementations.
 
 Neil V.
 
 -- 
 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] carmack s-expression tweet

2015-03-27 Thread Alexis King
Oh, very neat... racket/fasl was precisely the sort of thing I was thinking of.

 On Mar 27, 2015, at 17:26, Jay McCarthy jay.mccar...@gmail.com wrote:
 
 Look at my original response to John's post about this... The binary format 
 you are thinking of is racket/fasl.
 
 Jay
 
 On Friday, March 27, 2015, Sean Kanaley skana...@gmail.com 
 mailto:skana...@gmail.com wrote:
 Couldn't this binary s-expression just be a struct?
 
 '(move 3 5)
 
 becomes
 
 (struct move (x y) #:prefab)
 (move 3 5)
 
 client/server will likely have some kind of matching either way, and prefab 
 structs can be matched
 
 (match command
   [(list 'move x y) ...
 
 becomes
 
 (match command
   [(move x y) ...
 
 On Fri, Mar 27, 2015 at 7:15 PM, Alexis King lexi.lam...@gmail.com 
 javascript:_e(%7B%7D,'cvml','lexi.lam...@gmail.com'); wrote:
 It might be interesting to create a binary s-expression format for more 
 efficient reading/writing, a la BSON’s relationship to JSON. Perhaps even 
 with some sort of optional compression. Racket’s reader is fairly 
 complicated, though, so it might need to restrict itself to a useful subset?
 
  On Mar 27, 2015, at 16:12, John Carmack jo...@oculusvr.com 
  javascript:_e(%7B%7D,'cvml','jo...@oculusvr.com'); wrote:
 
  On Friday, March 27, 2015 at 2:45:00 PM UTC-5, Brian Craft wrote:
  Was this a reference to a particular racket lib? And if so, which one?
 
  https://twitter.com/ID_AA_Carmack/status/577878167542734848 
  https://twitter.com/ID_AA_Carmack/status/577878167542734848
 
  I have a long history of bit packing multiplayer network messages, but for 
  this project I am just sending text s-expressions with read and write, and 
  my life is much better.  Yes, it is bulkier, but I'm sending binary VoIP 
  data after it, so it won't dominate bandwidth, and making software easier 
  to write and more reliable is a fine way to spend some of our wealth of 
  resources today.
 
  --
  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 
  javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');.
  For more options, visit https://groups.google.com/d/optout 
  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 
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout 
 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 
 javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 
 -- 
 Jay McCarthy
 http://jeapostrophe.github.io http://jeapostrophe.github.io/
 
Wherefore, be not weary in well-doing,
   for ye are laying the foundation of a great work.
 And out of small things proceedeth that which is great.
   - DC 64:33

-- 
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.