dgrnbrg / piplin

Compile Clojure to FPGAs
piplin.org
93 stars 10 forks source link

ASTNode must support destructuring into new ASTNodes #12

Closed dgrnbrg closed 12 years ago

dgrnbrg commented 12 years ago

To do this, all keyword accesses to ASTNodes must be converted to protocol accesses. Then, delegation will be very similar as in instances.

dgrnbrg commented 12 years ago

ASTNodes perhaps shouldn't implement IPersistentMap for use w/ merge, but instead they should have a map of details. The delegation would then be done to functions configured in the metadata (to simplify equality testing)

dgrnbrg commented 12 years ago

Changes have been made to instances and astnodes to support destructuring, but the map-zipper is now broken. Based on discussions with Scott and Raeez, I think the map-zipper should be replaced with a normal walking function.

dgrnbrg commented 12 years ago

Map zipper has been removed, but now there's an issue where values pulled from a sim bundle aren't pipinsts

dgrnbrg commented 12 years ago

I think that the final blocking problem is that cast uses instance during the sim-fn phase, but really, the cast AST node needs to be able to pick up the nested elements and recursively evaluate them. This will probably require rethinking the internal API of cast, instance, the way that metadata propagates through types. Also, there is a a place where I make pipinst? of bundles check that every value is a pipinst. This code way actually be uneccessary (testing needed).

dgrnbrg commented 12 years ago

cast is based on promote, which uses constrain on the map argument. Probably should have promote not use instance/constrain for maps, and then the simfn metadata flows can get simplified again.