Subject: [ogpx] (Not) serializing LLSD default values

From: "Hurliman, John" <[email-masked]>
Date: Wed, 2 Dec 2009 13:19:13 -0700

I'm considering a change in the C# LLSD implementation (OpenMetaverse.StructuredData) to skip serialization of default values inside maps. For example, the following structure:

{
    "zero":0,
    "one":1,
    "empty_string":"",
    "hello_string":"hello world"
}

Would become:

{
    "one":1,
    "hello_string","hello world"
}

>From my reading of the draft (and our current implementation), those two serializations should be equivalent. Do the current Linden Lab implementations handle that correctly? The only problem I see with the C# implementation is that it would make some incompatible typecasts work when they shouldn't. For example, the receiving end could then read key "zero" as an LLSD array and it would work, where the value "0" usually shouldn't be convertible to an array. So it assumes some level of coherence between the sender and receiver, which I think is acceptable.

I would look at the source of the other implementations myself, but the last time I checked the PHP implementation was sorely out of date and the C++ implementation was not under a liberal license.

John

---

From: "Infinity Linden (Meadhbh Hamrick)" <[email-masked]>
Date: Wed, 2 Dec 2009 13:03:17 -0800

i'm not absolutely sure all our legacy SL interfaces do this right now, but
i do know that we want them too. future VWRAP work will definitely have
those semantics.

it may be advantageous to have that behavior be a configurable parameter,
then fire it up, and see what breaks. we could then use the failure logs to
track down interfaces that don't follow the "you get the default if it's not
there" semantics.

-cheers
-meadhbh
--
  infinity linden (aka meadhbh hamrick)  *  it's pronounced "maeve"
        http://wiki.secondlife.com/wiki/User:Infinity_Linden

On Wed, Dec 2, 2009 at 12:19, Hurliman, John <[email-masked]>wrote:

>  I’m considering a change in the C# LLSD implementation
> (OpenMetaverse.StructuredData) to skip serialization of default values
> inside maps. For example, the following structure:
>
>
>
> {
>
>     “zero”:0,
>
>     “one”:1,
>
>     “empty_string”:””,
>
>     “hello_string”:”hello world”
>
> }
>
>
>
> Would become:
>
>
>
> {
>
>     “one”:1,
>
>     “hello_string”,”hello world”
>
> }
>
>
>
> From my reading of the draft (and our current implementation), those two
> serializations should be equivalent. Do the current Linden Lab
> implementations handle that correctly? The only problem I see with the C#
> implementation is that it would make some incompatible typecasts work when
> they shouldn’t. For example, the receiving end could then read key “zero” as
> an LLSD array and it would work, where the value “0” usually shouldn’t be
> convertible to an array. So it assumes some level of coherence between the
> sender and receiver, which I think is acceptable.
>
>
>
> I would look at the source of the other implementations myself, but the
> last time I checked the PHP implementation was sorely out of date and the
> C++ implementation was not under a liberal license.
>
>
>
> John
>
> _______________________________________________
> ogpx mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/ogpx
>
>

---

From: Lawson English <[email-masked]>
Date: Wed, 02 Dec 2009 22:37:17 -0700

Infinity Linden (Meadhbh Hamrick) wrote:
> i'm not absolutely sure all our legacy SL interfaces do this right 
> now, but i do know that we want them too. future VWRAP work will 
> definitely have those semantics.
>
> it may be advantageous to have that behavior be a configurable 
> parameter, then fire it up, and see what breaks. we could then use the 
> failure logs to track down interfaces that don't follow the "you get 
> the default if it's not there" semantics.
>
>

this might over-complicate things, but could it be possible to have 
contextual defaults?

Lawson

>
> On Wed, Dec 2, 2009 at 12:19, Hurliman, John <[email-masked] 
> <mailto:[email-masked]>> wrote:
>
>     (OpenMetaverse.StructuredData) to skip serialization of default
>     values inside maps. For example, the following structure:
>
>      
>
>     {
>
>         “zero”:0,
>
>         “one”:1,
>
>         “empty_string”:””,
>
>     From my reading of the draft (and our current implementation),
>     those two serializations should be equivalent. Do the current
>     Linden Lab implementations handle that correctly? The only problem
>     I see with the C# implementation is that it would make some
>     incompatible typecasts work when they shouldn’t. For example, the
>     receiving end could then read key “zero” as an LLSD array and it
>     would work, where the value “0” usually shouldn’t be convertible
>     to an array. So it assumes some level of coherence between the
>     I would look at the source of the other implementations myself,
>     but the last time I checked the PHP implementation was sorely out
>     of date and the C++ implementation was not under a liberal license.
>
>      
>
>     John
>
>
>     [email-masked] <mailto:[email-masked]>
> ------------------------------------------------------------------------
>

---

From: "Hurliman, John" <[email-masked]>
Date: Thu, 3 Dec 2009 19:31:53 -0700

I don't think so, because the sending side and receiving side don't necessarily share any context.

John

-----Original Message-----
From: Lawson English [mailto:[email-masked]] 
Sent: Wednesday, December 02, 2009 9:37 PM
To: Infinity Linden (Meadhbh Hamrick)
Cc: Hurliman, John; [email-masked]
Subject: Re: [ogpx] (Not) serializing LLSD default values

Lawson

>     I'm considering a change in the C# LLSD implementation
>     incompatible typecasts work when they shouldn't. For example, the
>     receiving end could then read key "zero" as an LLSD array and it
>     would work, where the value "0" usually shouldn't be convertible