[x3d-public] Moving away two language solutions for X3DJSAIL.

John Carlson yottzumm at gmail.com
Mon Apr 19 21:51:02 PDT 2021


Don,

It seems to be easier to reread things with blank lines.  I need to see 
the eye doctor.

I am presently enhancing ECMAScriptSerializer.js (but kind of stuck on 
MFNodes) for outputting HelloWorld.mjs for creating X3D ES6 SAI example 
code from X3D JSON (kind of strange?  I think so too.). I don't know if 
I sent the HelloWorld.mjs yet.  If anyone wants to take the lead on 
es6x3d SAI (aka es6x3d or x3d.js), it would be most welcome.  I do not 
do well implementing code which generates code, which generates code, 
... Probably someone who has 5 PhD's could do it.  I try to do a simple 
change, like adding an attribute name and equals sign, and I get 
attributes nested within attribute nodeValues.  Eek! I think I can do a 
ECMAScriptSerializer.js and create a new Python Serializer based on the 
packaged x3d.py  developed by you et al.  Writing my Serializers has 
been one of my main tasks since completing X3DJSONLD.js.  Writing a 
serializer which writes a serializer is a bit strange, and probably more 
suitable for XSLT. I can ask for XMLSpy for my birthday.  Does it run on 
Kubuntu Linux 20.10? Apparently one has to pay for Windows 10 on virtual 
machines?

Here's "Hello, World" for ES6 (this needs help with brace closing of 
MFNodes)--needs someone to validate XML output.  x3d.mjs is in same folder.

https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/net/ecma/data/HelloWorld.mjs

The serializer used to create this is in the node folder (above). Run 
HelloWorld.mjs with node.js, but should work with most ES6 versions.

I feel comfortable creating prototypes and test tools.  Let's just say I 
came from a math visualization/computer graphics mindset.  I kind of 
stumbled on code generation as something intellectual; like program 
generation or synthesis interests me primarily as a way to take a domain 
specific language and produce running code (and the DRY principle has a 
lot of weight on me too, even in IRL).  Things like EGGG by Jon Orwant, 
and Ludi and Ludii from Cameron Browne interest me.  I tried to make a 
home computer create rules (learn) for solitaire by presenting example 
games.  I got as far as writing the GUI, and a probabilistic automated 
player and a start on version space algebra, but I ran out of compute power.

X3dToES5.xslt is being deprecated.  I suggest we move to a 
X3dToES6.xslt, as we agree on the HelloWorld.mjs we want to output.

All,

If anyone is interested in creating rules from examples, we share an 
interest, get in contact with me! I would love to hear from you!  This 
is one reason why I asked about inverseCSG and CSGNet. This is similar 
to creating higher level shapes from a scan.

Good news on my lung...no more dr's visits.  But other health concerns 
remains.  I heard good (or bad) news tomorrow.


But frankly, I probably won't be up for anything in near term. I'm 
guessing 2 weeks until my next volunteer spurt. I will likely respond to 
emails.

Test early, and often!

BTW mjs stands for module JavaScript

John

On 4/19/21 8:49 AM, Don Brutzman wrote:
> Thanks for clarification John... looks like primary point still remains.
>
> I think that further pursuit of jjs and pyjnius is unfruitful.  If 
> prior work with those tools still happens to be uncovering some errors 
> in model content now, then those reports are useful but temporary.  
> Let's learn our lessons and keep moving forward
>
> We can do everything needed, and do everything better in a repeatable 
> way for the long term, when we stick to the latest open-source tools 
> and languages.
>
> On 4/15/2021 2:55 PM, John Carlson wrote:
>>
>> Agreed that the Subject line seems incorrect.  I mean the X3DJSAIL
>> solutions that use python+java and javascript+java.  This is for
>> ~/pythonSAI and ~/X3DJSONLD.  I didn't see a version of jjs in OpenJDK
>> 15, but jjs seems fine in OpenJDK 14, OpenJDK 14 is more up-to-date than
>> GraalVM, I think, which is derived from Java 8/11.
>>
>> It looks like one has to do a build for pyjnius on Linux.   So I've been
>> looking for ways to deploy pyjnius to my local python 3 installation.
>> I know I can set PYTHONPATH.
>>
>> John
>>
>> On 4/15/21 10:49 AM, Don Brutzman wrote:
>>> (Subject line seems incorrect, Java X3DJSAIL and Python x3d.py
>>> X3DPSAIL are maintained and active)
>>>
>>> On 4/9/2021 3:51 AM, John Carlson wrote:
>>>>
>>>> I've been planning to deprecate pythonSAI.  This is the python API 
>>>> that
>>>> uses pyjnius to access X3DJSAIL.  This is because the web3d consortium
>>>> has come out with their own SAI candidate x3d.py, which is much better
>>>> documented and uses more features from X3DUOM.  Not only that, I don't
>>>> think that pyjnius works on Linux very well!  What I plan on doing is
>>>> moving my PythonSerializer.js towards using x3d.py.
>>>
>>> Yes, x3d.py (aka X3DPSAIL) is actively maintained and is autogenerated
>>> from X3D Unified Object Model (X3DUOM).
>>>
>>> When there are utility methods of interest in Java X3DJSAIL that might
>>> be suitable for python as well, we can translate and add them.
>>>
>>>> In general, there's some dissatisfaction with using non-Java languages
>>>> with X3DJSAIL.  Nashorn got tossed by Oracle, and the npm java package
>>>> likely requires an old version of python for node-gyp.
>>>
>>> Nashorn and jjs were deprecated for removal in JDK 15, and are gone in
>>> the latest Java JDK 16.  Link from JDK15 release notes:
>>>
>>> * OpenJDK15 release notes
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fopenjdk.java.net%2Fprojects%2Fjdk%2F15%2F&data=04%7C01%7Cbrutzman%40nps.edu%7C11927da7e0534ea6f87408d90059432b%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637541206265385829%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=K3M%2B8v1OFxKT7oNQ4djqMOQUtw6OD%2FSHJBPuPpuKc%2F0%3D&reserved=0
>>>
>>> * JEP 372: Remove the Nashorn JavaScript Engine
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fopenjdk.java.net%2Fjeps%2F372&data=04%7C01%7Cbrutzman%40nps.edu%7C11927da7e0534ea6f87408d90059432b%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637541206265385829%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=74%2F7ZA5rXA9k%2BTAJsrs6V1q5BSZ2WqYG4fNJqXxM2b8%3D&reserved=0
>>>
>>>> The good news is, we're coming out with new, one-language solutions.
>>>> Not only x3d.py, but there's X3DOM and X_ITE for JavaScript. Also, the
>>>> es6x3d project was started by me.  Es6x3d offers classes and new 
>>>> get/set
>>>> methods compatible with es6. Meanwhile GraalVM is still around in the
>>>> short term for Nashorn folks trying to migrate.  If you need a
>>>> conversion from X3D JSON or X3D XML to a particular programming 
>>>> language
>>>> or encoding and can't stomach XSLT, let me know!  I don't mind
>>>> volunteering on non-X3D projects, but I prefer ASCII or UTF-8 
>>>> encodings!
>>>
>>> It will be good to finish our upgrade of X3D JSON Schema using X3DUOM
>>> to match JSON draft-07 with testing by multiple tools. Let's persevere
>>> please.
>>>
>>> X3DJSAIL has -toJSON output.  JSON output still needs to be written
>>> for x3d.py, this is a recursive serializer for each node and so the
>>> pattern for autogeneration isn't particularly difficult.
>>>
>>> Having an ECMAScript SAI usable with Node.js that is autogenerated
>>> (i.e. always correct) similar to X3DJSAIL and X3DPSAIL would be good.
>>>
>>> Perhaps this could be a distillation of your work as a concise package
>>> while innovative extensions continue.
>>>
>>>> I already have X3D JSON <-> STL and PLY -> X3D JSON in mini 
>>>> prototypes.
>>>
>>> Adding STL and PLY support to Java X3DJSAIL and x3d.py X3DPSAIL is
>>> definitely a goal.  Hoping we can integrate in Java first, that is
>>> where testing best occurs.
>>>
>>>> Is anyone doing AMF yet?  Looks like there's a lot more interest in 
>>>> STL
>>>> than AMF!
>>>
>>> There are some AMF conversion classes in Xj3D, written by Alan Hudson
>>> I believe.  Some refreshes to the following codebase are underway and
>>> we will soon test under OpenJDK 16.
>>>
>>> * Xj3D viewer: NPS source
>>>   https://savage.nps.edu/Savage/developers.html#Xj3D
>>>
>>>> For my STL -> JSON project, does anyone have experience with 
>>>> inverseCSG
>>>> or CSGNet?  Thanks! 
>>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Farxiv.org%2Fpdf%2F1912.11393.pdf&data=04%7C01%7Cbrutzman%40nps.edu%7C11927da7e0534ea6f87408d90059432b%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637541206265385829%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=BKFy1gFrG4e6tcCbRTJUp56cDwiWWG1P55UCdHFbiKg%3D&reserved=0
>>>>
>>>> John
>>>
>>> the last update there appears to be 3 years ago.
>>>
>>> * 
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FHippogriff%2FCSGNet&data=04%7C01%7Cbrutzman%40nps.edu%7C11927da7e0534ea6f87408d90059432b%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637541206265385829%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DDZzq2F7QS36UBNRMbYp9rRCp%2Ft0pl2BzO%2BLdhgSptQ%3D&reserved=0
>>>
>>> all the best, Don
>
> all the best, Don



More information about the x3d-public mailing list