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
So I've been looking to add structs to SUS. But I'm not entirely convinced by my current approach.
Basically, I had the idea of integrating struct declarations with the existing SUS generative code system, but instead of
A regular struct looks pretty unassuming:
struct MyVec3 { int x
int y
int z
}
And having the generative code would allow for templated structs like
struct MyVec<T>{inputgenintSIZET[SIZE] arr
}
And even structs with optional fields like
struct BRAMRead<T>{inputgenboolECC_INCLUDEDT read_data
if ECC_INCLUDED{// (compiletime)
bool ecc_did_error
}}
The idea here is that any non-gen (compiletime) declaration is interpreted as a struct field, whereas gen declarations (like the template parameters), are executable compile-time code.
While this is easy to implement, and even gains a little bonus for language consistency, I can't help but fear I might be shooting myself in the foot somehow.
The text was updated successfully, but these errors were encountered:
So I've been looking to add structs to SUS. But I'm not entirely convinced by my current approach.
Basically, I had the idea of integrating struct declarations with the existing SUS generative code system, but instead of
A regular struct looks pretty unassuming:
And having the generative code would allow for templated structs like
And even structs with optional fields like
The idea here is that any non-
gen
(compiletime) declaration is interpreted as a struct field, whereasgen
declarations (like the template parameters), are executable compile-time code.While this is easy to implement, and even gains a little bonus for language consistency, I can't help but fear I might be shooting myself in the foot somehow.
The text was updated successfully, but these errors were encountered: