You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are other issues rather than verbosity (mentioned separately here: #4210, apparently I can't even declare typed const expressions), but here I'd like to point to using literals for convenience.
Describe the solution you'd like (if any)
Not sure what is the best way to do that.
I can think of at least two methods.
Considering the fact that 25[ti.f32]{1.0, 2.0}[vec3f](1.0, 2.0)[vec3i]25(ti.f32){1.0, 2.0}(vec3f)(1.0, 2.0)(vec3i) are valid python syntax (making set or tuple callable doesn't make sense in the interpreter but it's still valid)
Here we can use some sort of trailing type declaration. A bit isoteric, but who knows
Additional comments
It's probably a very specific issue, but I would be nice to have at least an optional support to be more explicit in the language.
Right now I've tested hash function and it works as expected, but I'd still like explicitly set unsigned here as at some backends signed bit shifting can be undefined.
The text was updated successfully, but these errors were encountered:
Concisely describe the proposed feature
Let's have a look on an implementation of popular pcg hash in taichi. Roughly it looks like this:
In taichi I should do something like this:
There are other issues rather than verbosity (mentioned separately here: #4210, apparently I can't even declare typed const expressions), but here I'd like to point to using literals for convenience.
Describe the solution you'd like (if any)
Not sure what is the best way to do that.
I can think of at least two methods.
Much better and with some additional analysis on arguments can be used as an alternative to
ti.cast
ast.Call
Considering the fact that
25[ti.f32]
{1.0, 2.0}[vec3f]
(1.0, 2.0)[vec3i]
25(ti.f32)
{1.0, 2.0}(vec3f)
(1.0, 2.0)(vec3i)
are valid python syntax (making set or tuple callable doesn't make sense in the interpreter but it's still valid)Here we can use some sort of trailing type declaration. A bit isoteric, but who knows
Additional comments
It's probably a very specific issue, but I would be nice to have at least an optional support to be more explicit in the language.
Right now I've tested hash function and it works as expected, but I'd still like explicitly set unsigned here as at some backends signed bit shifting can be undefined.
The text was updated successfully, but these errors were encountered: