Open
http://5gl.epizy.com/zh/glv.html
Enter the following commands in the text area (text box) and press Execute:
gl_camera.rotation.x 0.1 +=: >: cube:
This will rotate the camera slightly on x axis and display a cube.
I think Turtle Logo is all above motion and rotation. Three.js has a comprehensive set of functions for this. The next step is how to map 5gl to three.js commands, so that it can be as easy as the good old Logo.
I believe I have done a bit of ground work for this. What is required next is more programmers extend my code.
5GL commands are suffixed by colon ( : )
+= adds arg2 to arg1 and assign the new value to arg1.
>: is a directive to set subsequent commands to back end processing.
cube: is a macro stored in file s_cube, which draws a cube with JavaScript functions specified in it.
You can view the contents by s_cube using:
>: fi:
fi: maps to PHP file().
You can view all aliases (functions) using:
>: t_alias fi:
The w: command is very dangerous as it can overwrite any file or subdirectory in the PHP directory.
>: ls u: lists all files using PHP system() function.
u: is dangerous as it executed PHP system().
There are some json and array manipulation commands.
The code structure for PHP 5gl interface is more polished than JavaScript. Someone or myself need to port this structure over to JavaScript.
Further, they can be easily ported to other programming language. I call this the "abstract syntax tree decomposition": to decompose abstract syntax tree (height>1) of composite tree programming languages to primitive or unity syntax tree (height <= 1).
Charles Moore called it the FoUrth generation programming language.
I thought primitive tree programming language, or unity tree programming language, would be a better academic term for future discussions.
Your opinions?