1
$\begingroup$

What are the differences between an implicitly typed programming language and a untyped programming language?

Let me explain the above question and what I have thought about it.

  1. My question comes from reading https://stackoverflow.com/a/9159863/156458, where the huge slide says "untyped = no type declaration". I don't quite agree with the definition of untyped, but the author can define a term in his own way which doesn't need to agree with PLT. Note that I don't know what definitions mostly make sense with respect to what they are named as in PLT.

    In fact, after reading https://en.wikipedia.org/wiki/Programming_language#Type_system, I think implicitly typed means no type declaration when declaring a name, and is a concept as opposed to manifest i.e. explicitly typed. Untyped is a concept as opposed to typed. So my questions are based on the definitions from the wikipedia article.

  2. If I am correct, the programs in both implicitly typed programming languages and untyped programming languages don't have explicit declaration of the type of each object, so the programs written in them look the same. Then how can you tell if a language is an implicit typed or a untyped programming language?

  3. Is "implicitly typed" a concept at the level of implementations of programming languages, but not at the level of languages themselves?

    I guess it is because for an implicitly typed language, any compiler or interpreter of the language will have to do type inference. If a compiler or interpreter of the language doesn't do type inference, then the language is untyped for this compiler or interpreter. So is untyped also a concept at the level of implementations of programming languages?

    So to answer the question in part 2, we need to specify a particular implementation of the programming language under consideration?

Thanks.

$\endgroup$
  • $\begingroup$ 2. Is simple: In one case you have an implicit type declaration, so any following assignment must match. In the other case, you don't have an implicit type declaration, so a following assignment need not match. $\endgroup$ – gnasher729 Sep 16 '16 at 15:08
  • $\begingroup$ In other words: After x = 5 you don't know. After x = 5; x = "Hello" you know - typeless will run the code, implicitly typed won't. $\endgroup$ – gnasher729 Sep 16 '16 at 15:09
  • $\begingroup$ In Python, you can run x=5 and then x='Hello'. But I think Python is implicitly typed and dynamically typed. $\endgroup$ – Tim Sep 16 '16 at 15:10
  • 1
    $\begingroup$ As you probably already know by now (1, 2, 3), we generally expect you to limit yourself to one question per question. 4 questions is too many; you can edit this to ask your most important question and when you get an answer to that ask the next one separately. $\endgroup$ – D.W. Sep 16 '16 at 18:36
  • $\begingroup$ would you like me or is it acceptable to create a question, and then provide explanations about the question in terms of subquestions in one post? @D.W. The questions I asked in a post are closely interrelated to such a degree that they are explanations of one single question, and show my understanding and uncertainty about the single question, so seperating them into multiple posts will not easily make others understand my intention of asking the single question and providing explanations for it from slightly different perspectives. $\endgroup$ – Tim Sep 16 '16 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.