Actually, this works for me. Could be however because I just updated GlowScript 2.7 to handle this correctly.
The best guide to what is or is not possible is the README at the GitHub repository for rapydscript-ng:
However, in this particular case the fault was mine, not that of RapydScript-NG, which isn't solely responsible for how Python is handled. The problem is that RapydScript, like JavaScript, does not handle "operator overloading", meaning the ability for the "+" sign in vec+vec to be interpreted to mean "add the x components together, the y components together, and the z components together". There is a great deal of preprocessing of your code before it is handed to RapydScript, and a great deal of postprocessing after getting the JavaScript code from RapydScript. The two big components of the postprocessing are 1) Streamline, which permits you to write infinite loops, which are not legal in JavaScript, and 2) PaperScript, which converts X+Y into X['+'](Y), that is, a function X['+'] that is called with the argument Y, which then carries out the operation based on what type of entities X and Y are. This is a lot less expensive in time than one would expect, because one can add methods even to primitive JavaScript objects such as Number and String which at execution time are called very efficiently. I made measurements of execution speeds before and after adding multiplication operations to Number and String, and there is no difference (I do check first for the common cases).
If you're curious as to what this looks like, view the following file, and search for String.prototype and the code that follows: