Re: [vwrap] ECMA-262 and the Real LLSD type

Meadhbh Hamrick <ohmeadhbh@gmail.com> Thu, 06 May 2010 18:49 UTC

Return-Path: <ohmeadhbh@gmail.com>
X-Original-To: vwrap@core3.amsl.com
Delivered-To: vwrap@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 575DE28C102 for <vwrap@core3.amsl.com>; Thu, 6 May 2010 11:49:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.409
X-Spam-Level:
X-Spam-Status: No, score=-1.409 tagged_above=-999 required=5 tests=[AWL=-0.669, BAYES_20=-0.74]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qX98mYvzJeNq for <vwrap@core3.amsl.com>; Thu, 6 May 2010 11:49:29 -0700 (PDT)
Received: from mail-vw0-f44.google.com (mail-vw0-f44.google.com [209.85.212.44]) by core3.amsl.com (Postfix) with ESMTP id 13A7928C0FD for <vwrap@ietf.org>; Thu, 6 May 2010 11:49:28 -0700 (PDT)
Received: by vws9 with SMTP id 9so288329vws.31 for <vwrap@ietf.org>; Thu, 06 May 2010 11:49:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=6NZxegmXOVKxieuvaeOyth+IaIx9orspkUsu0gnGzsw=; b=wohXrQgDEZjv5bDF24kBWT1aODpCIL+sRjPeQdFa5R5Q0F3LWUJtOlgoNWoT88Df8o ksSnxt8nX/eO2L6PJZEqovmzPVDESUyQ96BrehYfek7AsZr20PRpmrcUQcSsmTjZ/aDh MmwuKzje8NDW7s/d2Cs7ymYShTlDKlOEGTDto=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=q8CW70JZYvwY+gAUiO5XBayjnH6t77D8YthEm00tGKB+CjqkTG6U8bedUr6e6Bx43L aichbhti4NaXRrCUVgSEGM3oCtKGnMKRrMsTpPAKJhiuudfuKPfmo6qE4B9pw9tXX83N A/8yrXCK8hKaVZwpAZv9Cgd1X3xQOH9KykUHc=
Received: by 10.229.190.209 with SMTP id dj17mr5672385qcb.52.1273171746735; Thu, 06 May 2010 11:49:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.24.142 with HTTP; Thu, 6 May 2010 11:48:46 -0700 (PDT)
In-Reply-To: <62BFE5680C037E4DA0B0A08946C0933DCE425A2C@rrsmsx506.amr.corp.intel.com>
References: <62BFE5680C037E4DA0B0A08946C0933DCE425A2C@rrsmsx506.amr.corp.intel.com>
From: Meadhbh Hamrick <ohmeadhbh@gmail.com>
Date: Thu, 6 May 2010 11:48:46 -0700
Message-ID: <r2nb325928b1005061148ke3d86895g6c4fbf1bb1860a8c@mail.gmail.com>
To: "Hurliman, John" <john.hurliman@intel.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: "vwrap@ietf.org" <vwrap@ietf.org>
Subject: Re: [vwrap] ECMA-262 and the Real LLSD type
X-BeenThere: vwrap@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Virtual World Region Agent Protocol - IETF working group <vwrap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/vwrap>, <mailto:vwrap-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/vwrap>
List-Post: <mailto:vwrap@ietf.org>
List-Help: <mailto:vwrap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/vwrap>, <mailto:vwrap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 06 May 2010 18:49:30 -0000

blergh. i wrote that to aggressively support IEEE 754 which includes
several "exceptional" values like plus/minus infinity, signed zero,
NaN, etc. there ARE binary encodings for these numbers, so binary
serialization shouldn't be a problem.

i wonder if it makes sense to say that if you have to transmit an
exceptional IEEE 754 value, you send it as a string instead of a
JSON-number. that way when you do the equivalent of:

llsd_value.asReal();

it would "do the right thing" and convert the string to a real value.
this would require us to have a wrapper class to hang the asReal()
method off, which i know some on this list wanted to try to avoid.

also.. what do current JSON implementations do if you give it
something like a -Infinity? instead of a real?

-cheers
-meadhbh
--
meadhbh hamrick * it's pronounced "maeve"
@OhMeadhbh * http://meadhbh.org/ * OhMeadhbh@gmail.com



On Thu, May 6, 2010 at 10:36 AM, Hurliman, John <john.hurliman@intel.com> wrote:
> In draft-hamrick-llsd-00 "3.2. JSON Serialization" it states:
>
>   Real  LLSD 'Real' values are represented by the JSON non-terminal 'number'.
>
> Then later in "Appendix A. ABNF of Real Values" it lists a series of strings that can be converted into real values:
>
>   negative-infinity =  %x2D.49.6E.66.69,6E.69.74.79   ; "-Infinity"
>   negative-zero     =  %x2D.5A.65.72.6F               ; "-Zero"
>   zero              =  %x30.2E.30                     ; "0.0"
>   positive-zero     =  %x2B.5A.65.72.6F               ; "+Zero"
>   positive-infinity =  %x2B.49.6E.66.69,6E.69.74.79   ; "+Infinity"
>   signaling-nan       =  %4E.61.4E.53                   ; "NaNS"
>   quiet-nan         =  %4E.61.4E.51                   ; "NaNQ"
>
> Does this mean that an LLSD real type with a value of -Infinity needs to be converted to a JSON string, and would be decoded on the receiving side as an LLSD string with value "-Infinity" (that happens to have a valid conversion to an LLSD real)? ECMA-262 does not support Infinity, NaN, etc. for the JSON 'number' type so it looks like we need to transmit those values as strings.
>
> John
> _______________________________________________
> vwrap mailing list
> vwrap@ietf.org
> https://www.ietf.org/mailman/listinfo/vwrap
>