Open
Conversation
added 30 commits
September 12, 2014 03:14
updated readme, added gython.py build script.
allow subclasses to call parent class methods (extend).
self types now passed to Go backend.
… `int self.x = 1`, new pointer syntax `*myclass self.y = a`. updated richards benchmark with typed syntax.
…int):` ,and ord('a') builtin.
…ointer to arrays in arguments that take arrays. changed `.append` method to operate on an array pointer. updated `len` builtin to operate on a pointer. fixed passing an array to another function that appends to it.
…to functions (so they can modify its contents inplace).
… the same generic function that can call methods on the instances and return a value. only the first variable in a generic function may be a subclass instance. in the function def the shared base class is given by name: `def g( a:MyBaseClass ):`
…runtime into output.
…to output fast and clean javascript (breaks some python rules, like using objects as dict keys)
…is likely needed for programs that do not depend much on too many pythonic features.
…multiple files based on classes.
…r loops act like python loops, this is safe to use if you only loop over arrays.
… avoid using the pythonjs runtime.
…ted by ChrisBarker.
…s known to the translator.
using hack `_tmp := make([]A,n); TARGET=&_tmp` because go compiler complains about taking the address of make.
…eneric in __init__ will become `interface{}` which can then be used by methods that use the attribute as an argument and retype it as a Generic.
added 28 commits
October 5, 2014 05:34
… cast to subclass type. TODO: do not include super class in generic type switch, and gather all classes and subclasses before doing main translation (to generate the generic switch properly)
…subclass can define its "own" attributes and these will be inserted into the struct of the other subclasses (but not used).
…`object` that contains `__class__` the name of the class, and in a generic function switch on the name instead of `G.(type)` because that can be wrong because methods in a base class that return self cast any subclass it returns to the type of the class instance the method is called from. added debug printing to catch nil pointer in unsafe switch using __class__ name.
…rns `self` - only works in an assignment to a variable, a type switch is generated in the caller, and the function body is branched from that point.
…ace or pointer to a struct, fails with hack using reflect and type switch because the Go compiler will not allow the case the invalid case (even if it never happens at runtime). TODO: internally track the type of `A`, or run the output code two times through the Go compiler to see which variables are structs or interfaces from errors printed to stdout.
…itch in the caller to convert the item back to the correct subclass.
…actually returns something.
…ss, and infact its another subclass type, when passed to a generic function, if the first switch case that switches on the struct name fails, then fallback to using a `switch X.(type)` to convert to the struct type that the Go compiler thinks it is, and then force it to be of the subclass type that was known by the first switch (the embedded struct name)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
File "rusthon.py", line 541
print 'making new rusthon cache folder: ' + GITCACHE
File "rusthon.py", line 558
print 'rebuilding git repo: ' + tag
File "rusthon.py", line 566
print '>>'+line
...
and 982, 991,1023,1526,1884,1943