-
Notifications
You must be signed in to change notification settings - Fork 5
Description
This should be doable now that the interpreter is decently compositional. In the future, something similar can be done for GPU, but CPU should be a bit easier fiddling-wise, so it's a good start.
I have a discussion with @tomsmeding about that saved to may notes. In particular, if we start permitting
escapeHatch :: (a -> b) -> (AST a -> AST b)
then compilation becomes more complex, because we'd need callbacks to Haskell (but it's not clear how to BOT escapeHatch; differentiation would probably be via a derivative provided by the user). But, as it is, we don't have anything like this. The user can have arbitrary Haskell code mixed up with horde-ad operation invocations, but the types ensure the Haskell code is eventually fully unrolled (executed, resulting in an AST trace or a Delta "tape", depending on the pipeline).