How are you enabling dynamic typing in c? #108
Answered
by
edubart
SaptakBhoumik
asked this question in
Q&A
-
Nelua is transcompiled to c so how are you enabling dynamic typing of lua in c? I was just curious to know |
Beta Was this translation helpful? Give feedback.
Answered by
edubart
Aug 27, 2021
Replies: 1 comment 1 reply
-
With type deduction, you can deduce variable types based on assignments or from a few type notations, this is currently how it works and this has no runtime costs, all is done at compile-time. If assignments have different types for the same variable, then you can use a tagged union for the types or an |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
SaptakBhoumik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With type deduction, you can deduce variable types based on assignments or from a few type notations, this is currently how it works and this has no runtime costs, all is done at compile-time. If assignments have different types for the same variable, then you can use a tagged union for the types or an
any
type that can hold any value, but this time both have runtime costs, however this was not implemented yet.