To add operator overloading only required changing the first stage of the compiler, see my commits: , . The AST NodeVistor has been changed to keep track of: class names, special methods, and instances of the classes. The logic that inspects the AST and tracks class instances is too simple at the moment, and only understands: "a = SomeClass()". Then, as the rest of the AST is traversed, any references to "a" that use attribute access "." or subscript "" will be replaced with a PythonJS style function. In the example below, assume that class A has defined a special __getattr__ method.
a = A() b = a.x + a.y
a = get_attribute(A, "__call__")(); b = __A___getattr__([a, "x"]) + __A___getattr__([a, "y"]);