New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it possible to have defn compile to zig? #7
Comments
this may be a requirement to implement certain things, like reduce. |
I have never worked inside the Zig compiler so I don't know how viable this idea is, but you might be able to map Most of the binary ops and unary ops that I looked at are already represented in Zig AST Tags: https://github.com/ziglang/zig/blob/68e7726478f89ca27127e68b79112c12ac7415f7/lib/std/zig/ast.zig#L410-L550 |
I think... We wouldn't want to convert to zig AST. I think we would want to create a secondary module and defdelegate the functions to the secondary module that implement zig code in ~Z blocks that can be textually generated from the defn contents. What I know less about is if There are a few open questions: Currently, in Ez, the tensor data are bound to a BEAM "resource". Zigler expects all functions dealing with a single resource to be contained by module boundary. I don't know yet how (or if) you can use resources between modules, so there might need to be some metadata exploration by Zigler to set this up correctly. I just created this issue: E-xyza/zigler#251 |
gut feeling says yes. Even if we can't have a jitting zig compiler until E-xyza/zigler#245, I think fusing operations should be reasonable to do, and at least it will cut out the (potentially expensive) process of marshalling and unmarshalling your tensors from erlang resources.
The text was updated successfully, but these errors were encountered: