programming languages are grouped it 2 main classes "Dynamic" & "Static". - Is this always the case a programming language is in one of them and not in both, I mean can a language be dynamic and static at the same time ?
The distinction static and dynamic language is quite ambiguous since it can refer to many different (more or less suitable) criteria. I'll try to answer for each case:
This doesn't depend on the language itself but just on the implementation used. Therefore languages can be executed through both an interpreter and a compiler. Examples
Some compiled languages also have the possibility to compile their code at runtime (.NET).
Static and dynamic typing (duck typing) can be combined in one language. See C#'s dynamic, VB with Option Explicit/Strict off or Boo. Structural typing can be used to formulate strict typing without explicit type hierarchies. Polymorphic base types (System.Object) support some kind of dynamic behaviour as well, though the type is given statically.
Are available in Java and .NET too.
Can be replicated in statically-typed languages as well. See Haskell or Scala.
C# 4.0 is a statically typed language that supports dynamic resolution as well. The dynamic keyword basically tells the compiler: don't worry about this for now. If it can't resolved the type at runtime an exception is thrown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With