Simplifying module* #44

dgrnbrg opened this Issue May 13, 2012 · 1 comment


None yet
1 participant

dgrnbrg commented May 13, 2012

module* currently takes a bunch of thunks that are evaluated in the proper binding which do all the connections.

Connections are the only reason that modules are funky, requiring the dynamic binding context. I am beginning to doubt whether the way it's currently done is the right way, since it seems simpler to have module* take a map from port names to functions which compute their value, and then each function's arguments is a map of all the state of the module, which is easily recovered by destructuring and (I believe) supports all the necessary dynamism (and even makes it better, by moving to simple functions everywhere!)

The module macro can still support connections by doing a simple rewrite of the AST prior to generating the module* invocation, but I'm not even sure that support that kind of mixed imperative/functional style makes sense. Instead, it may be better to have a DSL for doing imperative logic programming (as long as the flow is linear w/ branching), and not worry about the current system (which is sort of a hybrid that does neither job great).


dgrnbrg commented Aug 17, 2012

I think that it's a good idea to make connect a syntactic transform regardless.

@dgrnbrg dgrnbrg closed this Apr 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment