Skip to content

jsx/jiffy compatibility #76

@talentdeficit

Description

@talentdeficit

hey. with maps we can sidestep the object representation problem. interested in aligning jiffy and jsx a little more closely? i've added support for uescape and return_maps and i think jiffy in force_utf8 mode does the same thing as jsx does by default (conversely, i think jsx in dirty_strings mode does what jiffy does by default). jsx is less strict than jiffy by default i think but we can probably work around that

ideally, we'd settle on a common interface such that we could both publish a shim json module that has an interface like:

%% jsx in regular operation, jiffy in `native` mode
json:decode(JSON, []) = json:decode(JSON, [native]).
json:encode(Term, []) = json:encode(Term, [native]).

we can already support uescape and pretty trivially. we can either force jsx into strict mode if we want to be pedantic or add support for various loose encoding to jiffy and then all we have to argue about is whether or not strings should be coerced into valid utf8 or not

also i don't know what you do about escaping forward slashes or u+2028 and u+2029 but those seem easy to work out

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions