Question about the new JSON ⌶ beam

General APL language issues

Re: Question about the new JSON ⌶ beam

Postby Phil Last on Wed May 06, 2015 5:21 pm

Richard wrote:is not ambiguous to a parser which understands the convention but it will cause one that does not[,] to do something different to that intended
Which is true not only of all possible parsers, including all those mentioned or imagined above, but is implied by the very notion of a convention or language, schema, protocol, code of law or any other mode of communication, exchange, what have you.
It is important that we get this right, especially if it gets past the "experimental" I-Beam stage - it is very difficult to back-track on past design errors because of the need to retain backward compatibility.
Yes.

My personal recommendation would be to debug the i-beam for circular references and any other actual problems but leave it as basic as possible, including its inability to distinguish between a scalar character and a singleton string (my assumption only, I haven't tried) and its refusal to attempt to encode any array with rank greater than one. This will be useable unenhanced for a large minority if not the majority of APL arrays without change.

Then take Brian's protocol, incorporating any improvements from Gil and Dan, add a keyword version, and maybe others, give them names, publish their specifications and build a namespace (class?, system function?) that does the following four things:
  • Uses a designated schema to transform any APL data into a vector, the first item of which is the schema name, suitable to be passed to the i-beam;
  • uses the i-beam to encode the vector;
  • uses the i-beam to decode an incoming JSON string into a space or vector; and
  • uses the first item, if it's a string, to recognise which if any of its list of known schemas was used to transform the data; and to transform the one-drop of the vector back into its original form.
User avatar
Phil Last
 
Posts: 576
Joined: Thu Jun 18, 2009 6:29 pm

Re: Question about the new JSON ⌶ beam

Postby PGilbert on Mon Oct 26, 2015 3:20 pm

Question to Dyalog: Is the new JSON ⌶ beam is schedule to stay the same or there is some changes coming up with next version of APL (v15) ?

Thanks in advance,

Pierre Gilbert
User avatar
PGilbert
 
Posts: 419
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Question about the new JSON ⌶ beam

Postby Richard|Dyalog on Tue Oct 27, 2015 9:41 am

We have some internal proposals for changes and extensions to the JSON support:

* We may drop support for conversion to a three column matrix (the "deeply nested" format - left arg value 2).

* We have no plans to support non-standard data types as discussed in this thread although we may build utilities on top of 7159⌶ to help achieve this.

* We may add support for non-standard syntax extensions which other JSON parsers support, for example non-quoted names for object members and inline comments.

* Ultimately, when we are satisfied that the design is stable, we may introduce a system function (perhaps ⎕JSON) to replace the I-Beam.

However, none are currently planned to be implemented in 15.0 unless user demand moves them up the priority list.
User avatar
Richard|Dyalog
 
Posts: 42
Joined: Thu Oct 02, 2008 11:11 am

Re: Question about the new JSON ⌶ beam

Postby Phil Last on Tue Oct 27, 2015 10:05 am

I can't answer Pierre's question but would point to this from Gil in May:
gil wrote:I discussed an issue with Phil some months ago regarding circular references. I now tested it with the new ⌶ beam and can see that no precautions have been taken to catch this condition.
      parent←⎕NS''
child←⎕NS''
child.parent←parent
(7160⌶)parent

I get a WS FULL after some time, but would prefer an immediate error reporting a circular reference.

Unfortunately Gil missed out a step in his code while translating it to the forum because the above doesn't display the problem. This does:
      parent←⎕ns''
child←⎕ns''
parent.child←child
child.parent←parent
7160⌶parent
WS FULL
7160⌶parent

The fact of its not displaying the problem might have led to its being overlooked by the team. Definitely needs solving 'though not hard to do in APL at least - see my reply to Gil's mail back in May.
User avatar
Phil Last
 
Posts: 576
Joined: Thu Jun 18, 2009 6:29 pm

Re: Question about the new JSON ⌶ beam

Postby Richard|Dyalog on Tue Oct 27, 2015 1:05 pm

Thanks for the reminder, Phil. Yes, that is reported as a bug (ref 12838); the fix will replace the WS FULL with a meaningful and trappable error.
User avatar
Richard|Dyalog
 
Posts: 42
Joined: Thu Oct 02, 2008 11:11 am

Previous

Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest