Hi, everyone.

I'm the author of the JS OpenMath module referred to below.  I was definitely 
not trying to create a standard encoding when writing that module, but rather 
just creating a library useful for my own purposes.  If a standard encoding 
were created, I would be glad to be a part of the efforts, and to update that 
module to read/write the standard encoding.

My experience lies more in building software than it does in building 
standards, but I'm still glad to contribute to the degree that I can.

Nathan

On May 2, 2018, at 3:52 AM, Alberto González Palomo 
<[email protected]<mailto:[email protected]>> wrote:

Michael Kohlhase wrote on 02/05/18 at 08:57:
we have come across the need to communicate OpenMath Objects to JavaScript.
We could go traditional and send over XML and have JS parse that into JS
Objects, or we could use a JSON binding for OpenMath.
It actually seems that Nathan Carter has already done something very
much like that.  [1]
Would it make sense to standardize a JSON binding of OpenMath? After
all, JSON is one of the practical competitors for XML and used A LOT on
the web.
[1] https://lurchmath.github.io/openmath-js/site/

 For anyone else interested, here is a direct link to the docs: (please note 
that I'm not the author)
https://github.com/lurchmath/openmath-js/blob/master/openmath.litcoffee#openmath-module

 Some concrete examples:
https://github.com/lurchmath/openmath-js/blob/master/openmath-spec.litcoffee#should-decode-valid-simple-forms

 For instance, let's compare the encoding of $x+5$:

 - OpenMath:
   <OMOBJ xmlns="http://www.openmath.org/OpenMath";><OMA><OMS cd="arith1" 
name="plus"/><OMV name="x"/><OMI>5</OMI></OMA></OMOBJ>

 - openmath-js:
   {"t":"a", c:[ {"t":"sy", "cd":"arith1", "n":"plus"}, {"t":"v", "n":"x"}, 
{"t":"i", "v":"5"} ] }

 There is another way to encode XML as JSON, called JSONML, which is pretty 
much LISP with square brackets:
http://jsonml.org/

 - JSONML:
   ["OMOBJ", {"xmlns":"http://www.openmath.org/OpenMath"}, ["OMA", ["OMS", 
{"cd":"arith1", "name":"plus"}], ["OMV", {"name":"x"}], ["OMI", "5"] ]]

 As a standard encoding, I'd rather recommend JSONML because it is a straight 
mapping of the XML syntax and there are implementations of it for several 
programming languages. I've used it extensively for web applications, 
generating HTML and XML for both personal projects and work for customers, and 
it works well in practice.

 Cheers,
--
   Alberto González Palomo
   Toledo, España / Saarbrücken, Deutschland
   https://matracas.org

_______________________________________________
Om mailing list
[email protected]
http://mailman.openmath.org/cgi-bin/mailman/listinfo/om

Reply via email to