3

I have some questions:

  • A dynamic programming language is always interpreted? I think so, but why?
  • Are there any dynamic languages ​​with static typing system?
  • A programming language with static typing system is always compiled?

In others words, are there really a link between :

  • Static / dynamic typing system and static / dynamic language
  • Static / dynamic typing system and compiler / interpreter
  • Static / dynamic language and compiler / interpreter
3
  • Answers: no, don't understand, no, maybe, no, no. Commented Jan 4, 2014 at 21:15
  • From this wikipedia page : "Most dynamic languages are also dynamically typed, but not all are.". An example ? Commented Jan 4, 2014 at 23:01
  • Scala, Objective-C, ... Commented Jan 4, 2014 at 23:20

2 Answers 2

3

There is no inherent connection between the type system and the method of execution. Dynamic languages can be compiled and static languages can be interpreted. Arguably static type systems make a lot of sense with programs which are compiled before execution, as a method of catching certain kinds of errors before the program is ever executed. However, dynamic type systems solve different problems than static type systems, and interpreted execution solves different problems than compilation.

See What to know before debating type systems.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the link, I'll take time to read it. I found the original release here
2

A dynamic programming language is always interpreted? I think so, but why?

No. Most dynamic languages in wide use internally compile to either bytecode or machine code ("JIT"). There are also a number of ahead-of-time compilers for dynamically-typed languages. There are a number of compilers for Scheme and Lisp, as well as other languages.

Are there any dynamic languages ​​with static typing system?

Yes. The terms your are looking for here are "optional typing" and "gradual typing".

A programming language with static typing system is always compiled?

Most are, but this isn't strictly required. Many statically typed functional languages like ML, F#, and Haskell support an interactive mode where it will interpret (or internally compile and execute) code on the fly. Go also has a command to immediately compile and run code directly from source.

In others words, are there really a link between :

Static / dynamic typing system and static / dynamic language Static / dynamic typing system and compiler / interpreter Static / dynamic language and compiler / interpreter

There's a soft link between the two. Most people using dynamically typed languages are using them in part because they want quick iteration while they develop. Meanwhile, most people using statically typed languages want to catch as many errors as early as they can. That means that dynamically typed languages tend to be run directly from source while statically typed languages tend to compile everything ahead of time.

But there's no technical reason preventing you from mixing it up.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.