Const generics, a runtime or compile time construct?
https://docs.modular.com/mojo/changelog.html#v0.4.0-2023-10-05
Really happy to see this development in Mojo, where
However, I am curious if the 'instantiation' or 'specialization' of the template parameter is actually resolved during runtime or compile time.
I am asking because I am waiting to be able to check the length of an input
https://github.com/jymchng/funjo/blob/master/src/array/array.mojo#L27
#mojo
Really happy to see this development in Mojo, where
StringLiteral is a const generic of type 'string', which is something not even C++ or Rust manages to do.However, I am curious if the 'instantiation' or 'specialization' of the template parameter is actually resolved during runtime or compile time.
I am asking because I am waiting to be able to check the length of an input
ListLiteral at compile time and do comparison with it.https://github.com/jymchng/funjo/blob/master/src/array/array.mojo#L27
#mojo
GitHub
Having fun with
Mojo, the latest low-level, system programming language developed by Modular. - jymchng/funjo
