-
Notifications
You must be signed in to change notification settings - Fork 8
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
Proposal: Struct Exprs #11
Comments
(Also, if anybody has a discord server or another way of communicating that doesn't have a 1 day round trip, that'd be nice to know) |
It does add code to the kernel. It won't affect performance though. (Maybe increased compile time?)
You can use https://discord.com/invite/ymYEBkUa7F
We have discussed the At the meantime, the |
@shiinamiyuki I can definitely implement the get_mut hijack with |
I'd like to handle that after doing the struct expr thing if doing that, since it'd make managing things significantly simpler. |
Closing as it is already handled in #12 |
(From #7 )
@shiinamiyuki I managed to make a way of using structs for
Expr
andVar
that still allows impls.The primary code for this is in https://github.com/iMplode-nZ/luisa_expr_tests/blob/main/a/src/lib.rs and https://github.com/iMplode-nZ/luisa_expr_tests/blob/main/b/src/main.rs.
TLDR: I made the
Value
type provide customExprProxy
andVarProxy
types, and implementedDeref<Target = T::ExprProxy> for Expr<T>
, with the enforcement that theExprProxy
must be of the same layout, so that this deref can be implemented using atransmute
. Then, the user can implement things on their customExprProxy
type. I also made theVarProxy
be required to implementDeref<Target = Expr<T>>
so that you can treat aVar
as anExpr
.I'd like to ask clarification on a number of issues:
luisa
, does callingvector.x()
cause side effects / add code to the kernel, if the value of it isn't used?vector.x
accessors using the hack inmain.rs
, or would that not be worth it since it'd make people be able to screw up by setting thex
values? (Perhaps that could be avoided with a custom lint?)The text was updated successfully, but these errors were encountered: