is Teal strongly or weakly typed? Static or Dynamic? #505
-
Title says it all |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
"Statically vs dynamically" is a more well-defined distinction, that is agreed upon in academia. Teal is statically typed; Lua is dynamically typed. "Strongly vs weakly" is often used to mean the same as the above, but sometimes it is used to mean that you can map memory to different types. In the latter sense, both are strongly typed, in the sense that you can't really map a memory location to a different type (cast in the C sense); in Teal you have a cast, but attempting to use a value as the wrong type will cause a runtime error. |
Beta Was this translation helpful? Give feedback.
"Statically vs dynamically" is a more well-defined distinction, that is agreed upon in academia. Teal is statically typed; Lua is dynamically typed.
"Strongly vs weakly" is often used to mean the same as the above, but sometimes it is used to mean that you can map memory to different types. In the latter sense, both are strongly typed, in the sense that you can't really map a memory location to a different type (cast in the C sense); in Teal you have a cast, but attempting to use a value as the wrong type will cause a runtime error.