compiler-constructionprogramming-languagesdynamic-languagesstatic-language

Dynamic languages Vs Static languages (can this two be together in the same place)


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 ?


Solution

  • 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:

    Interpretation/Compilation

    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/Dynamic typing

    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.

    Meta constructs (e.g. Reflection, Runtime type generation)

    Are available in Java and .NET too.

    Functional techniques(eg. Higher-order functions, continuations)

    Can be replicated in statically-typed languages as well. See Haskell or Scala.