[x3d-public] X3D JSON Loader now includes sample Python imperative encoding as output; Challenge for Don.
Don Brutzman
brutzman at nps.edu
Thu Nov 10 08:06:57 PST 2016
John this is really wonderful. Congratulations and thanks.
Really interesting how the code patterns for HelloWorld.py are so similar to the Java example.
It will be further interesting when we continue in these further planned directions: JavaScript, D3.js, C++.
Peeking over the peek beyond that, if we get consistent working codebases running (known to be correct thanks to common basis in autoderivation from X3D Object Model) then smart programmers will build further applications and even utility libraries on top!
Am currently working on toStringClassicVRML() and toStringVRML97() in the X3D Java SAI Library. Talk about a mix of imperative and declarative - whew, tricky sledding! (btw my serializer CreateX3dSceneAccessInterfaceJava.xslt is 14755 lines and growing - very jealous of your 32 lines!)
Your challenge is much appreciated. Will think about it - examples from other libraries/languages that illustrate your thinking will be welcome. Perhaps the X3D Java SAI Library will help us experiment further in that direction too, either in code generation or library usage.
Again thanks for exposing X3D via python - wow, a major step towards a new milestone. Onward we go together. 8)
p.s. umm, have fun with X3D Python! 8)
On 11/8/2016 1:17 PM, yottzumm at gmail.com wrote:
> Following along with Don B.’s imperative HelloWorld.java, I have created an imperative encoding for python. See repository at: https://github.com/coderextreme/X3DJSONLD and webserver: http://coderextreme.net/X3DJSONLD/ for examples of this encoding. An example HelloWorld.py is included here, but shouldn’t run—I’m still working on that code.
>
>
>
> I hope more imperative encodings will be accepted in the future, including JavaScript and D3.js.
>
>
>
> The approach I took when generating the python was to generate from DOM. This worked well. The serializer is 32 lines and is found in X3DJSONLD.js in the repository. I have not tested comments or scripts yet. So far, the new encoding is only an output encoding.
>
>
>
> Don, I challenge you to create a declarative Java encoding using nested object arrays. Yes, you can translate XML into Java object arrays.
>
>
>
> I see a wonderful mixture of declarative and imperative styles coming.
>
>
>
> John
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list