In the README at
https://github.com/kovidgoyal/rapydscript-ng are described various non-standard capabilities of the RapydScript-NG Python-to-JavaScript transpiler. The most interesting difference is that one can execute jquery code in a Python program.
There is a specific section on "Gotchas", and the most serious one is that 1+'1', which is an error in Python, yields '11' due to the nature of the underlying JavaScrpt.
The next statement in the Gotchas says that [1]+[1] returns a string, but in fact it does correctly yield [1,1]. I think this is a documention error, which I'll report.
The statement after that says, "RapydScript does not implement operator overloading, as method calls in JavaScript are very slow compared to raw operators." GlowScript does implement operator overloading, albeit in just some special cases, most notably vectors, and my own measurements indicate that the overhead is surprisingly small, about 30%. But maybe for RapydScript to implement operator overloading in general would be expensive in execution time.
Because I have to do a lot of preprocessing and postprocessing of VPython code, I believe I could give an error for "!a"; just look for "!" not followed by "=". Also, I currently have to track the names of and calls of functions in order to setup the Streamline machine that permits infinite loops and pauses, so I think I could catch a call to a function that has not yet been defined. I don't think I can do anything about the curious JavaScript scheme of x = [ ]; x[5] = 42, as that would require expensive run-time checks, though I should make measurements. Also, it might be prohibitively costly to catch 1+'1'.
I do see some value in doing this. For example, a colleague prefers to check student GlowScript programs by running them in Jupyter 7, but then there are errors that didn't show up in GlowScript (and didn't affect the correct execution at
glowscript.org). So keep those gotchas coming, and I'll continue to look into ways to treat them as errors. If it does turn out to be feasible, it will require increasing the version number, since otherwise existing program might fail under the stricter regime.
A general comment about RapydScript-NG: There are many many projects aimed at transpiling Python to JavaScript, however with the exception of RapydScript, they are VERY slow. For example, in December 2016 a widely mentioned transpiler named Brython was (at that time) 15 times slower than Python, whereas GlowScript VPython was 5 times faster than Python, a factor of 75 in speed! The key is that Brython attempts to emulate true Python exactly, whereas RapydScript aspires to do as good a job as possible but without sacrificing speed. One of the consequences of this approach is that RapydScript is a rather thin wrapper around JavaScript.
Bruce