std.data.json formal review

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 11 14:27:46 PDT 2015


Am 04.08.2015 um 19:14 schrieb deadalnix:
> On Tuesday, 4 August 2015 at 13:10:11 UTC, Sönke Ludwig wrote:
>> This is how it used to be in the vibe.data.json module. I consider
>> that to be a mistake now for multiple reasons, at least on this
>> abstraction level. My proposal would be to have a clean, "strongly
>> typed" JSONValue and a generic jsvar like struct on top of that, which
>> is defined independently, and could for example work on a BSONValue,
>> too. The usage would simply be "var value = parseJSONValue(...);".
>
> That is not going to cut it. I've been working with these for ages. This
> is the very kind of scenarios where dynamically typed languages are way
> more convenient.
>
> I've used both quite extensively and this is clear cut: you don't want
> what you call the strongly typed version of things. I've done it in many
> languages, including in java for instance.
>
> jsvar interface remove the problematic parts of JS (use ~ instead of +
> for concat strings and do not implement the opDispatch part of the API).
>

I just said that jsvar should be supported (even in its full glory), so 
why is that not going to cut it? Also, in theory, Algebraic already does 
more or less exactly what you propose (forwards operators, but skips 
opDispatch and JS-like string operators).


More information about the Digitalmars-d mailing list