json type tag ?

View: New views
6 Messages — Rating Filter:   Alert me  

json type tag ?

by Gaspard Bucher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there !

I have implemented a json parser in liboscit and I think it can be
useful to send json data through osc since this enables sending
complex structures such as dictionaries. Sending json through osc will
not be the norm since it takes cpu and bandwidth. But it has it's
place especially during initialization.

Anyway, what do you think of using "j" as tag for this format ?

Thanks for your opinions.

Gaspard
_______________________________________________
OSC_dev mailing list
OSC_dev@...
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev

Re: json type tag ?

by Gaspard Bucher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As a followup, I noticed that there is no type tag for hashes
(dictionaries). What about 'h' ?

Gaspard

On Mon, Mar 30, 2009 at 9:23 PM, Gaspard Bucher <gaspard@...> wrote:

> Hi there !
>
> I have implemented a json parser in liboscit and I think it can be
> useful to send json data through osc since this enables sending
> complex structures such as dictionaries. Sending json through osc will
> not be the norm since it takes cpu and bandwidth. But it has it's
> place especially during initialization.
>
> Anyway, what do you think of using "j" as tag for this format ?
>
> Thanks for your opinions.
>
> Gaspard
>
_______________________________________________
OSC_dev mailing list
OSC_dev@...
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev

Parent Message unknown Re: json type tag ?

by salsaman-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, March 30, 2009 21:23, Gaspard Bucher wrote:

> Hi there !
>
> I have implemented a json parser in liboscit and I think it can be
> useful to send json data through osc since this enables sending
> complex structures such as dictionaries. Sending json through osc will
> not be the norm since it takes cpu and bandwidth. But it has it's
> place especially during initialization.
>
> Anyway, what do you think of using "j" as tag for this format ?
>
> Thanks for your opinions.
>
> Gaspard
> _______________________________________________
> OSC_dev mailing list
> OSC_dev@...
> http://lists.create.ucsb.edu/mailman/listinfo/osc_dev
>

I think it is a nice idea - I have been considering creating a standalone
openGL front end for LiVES/videojack, and sending mapping data using json
via OSC.

If/when I get round to implementing it I will let you know, but its likely
to be several months (if not years...) down the line.


Still, the idea makes sense.


I am not sure about using a new type tag though...what I like about OSC is
its simplicity, and we should avoid "type tag creep". Is it not possible
to use part of the namespace to indicate json, and just send it as a
string ?



Cheers,
Salsaman.
http://lives.sourceforge.net


_______________________________________________
OSC_dev mailing list
OSC_dev@...
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev

Parent Message unknown Re: json type tag ?

by salsaman-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, March 30, 2009 21:30, Gaspard Bucher wrote:
> As a followup, I noticed that there is no type tag for hashes
> (dictionaries). What about 'h' ?
>
> Gaspard

How does a hash differ from a string ?

Salsaman.


_______________________________________________
OSC_dev mailing list
OSC_dev@...
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev

Re: json type tag ?

by Gaspard Bucher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Of course, the json representation of anything can be stored in a
string, even a hash like:
{"name":"Joe", "age":32} or a midi message or whatever.

But when you receive such a thing, it's nice to know it's not the same as
"This is my friend Joe. He is 32 years old." because you need very
different parsers to get Joe's age :-).

G.

On Mon, Mar 30, 2009 at 10:06 PM,  <salsaman@...> wrote:

> On Mon, March 30, 2009 21:30, Gaspard Bucher wrote:
>> As a followup, I noticed that there is no type tag for hashes
>> (dictionaries). What about 'h' ?
>>
>> Gaspard
>
> How does a hash differ from a string ?
>
> Salsaman.
>
>
> _______________________________________________
> OSC_dev mailing list
> OSC_dev@...
> http://lists.create.ucsb.edu/mailman/listinfo/osc_dev
>
_______________________________________________
OSC_dev mailing list
OSC_dev@...
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev

Parent Message unknown Re: json type tag ?

by salsaman-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, March 30, 2009 22:16, Gaspard Bucher wrote:

> Of course, the json representation of anything can be stored in a
> string, even a hash like:
> {"name":"Joe", "age":32} or a midi message or whatever.
>
> But when you receive such a thing, it's nice to know it's not the same as
> "This is my friend Joe. He is 32 years old." because you need very
> different parsers to get Joe's age :-).
>
> G.
>

Sure. But this can be indicated in the name (address) space of the message.

IMO we should differentiate strongly between the fundamental (final if you
like), type of the parameter (a string is a sequence of bytes terminated
with a NULL), and the meaning of that string (this is a hash entry, this
is json, this is a database tuple, this is the name of an effect, this is
a comment field, etc), otherwise why not have a million different tag
types, and every OSC parser will have to know how to handle all of those
million types.



Salsaman.


_______________________________________________
OSC_dev mailing list
OSC_dev@...
http://lists.create.ucsb.edu/mailman/listinfo/osc_dev