Posted by
jfabry on
Jun 03, 2014; 4:40pm
URL: https://forum.world.st/Xcode-s-Swift-Playground-tp4761425p4761532.html
On Jun 3, 2014, at 12:32 PM, Camille Teruel <
[hidden email]> wrote:
>
> On 3 juin 2014, at 17:34, Johan Fabry <
[hidden email]> wrote:
>
>>
>> On Jun 3, 2014, at 4:21 AM, Camille Teruel <
[hidden email]> wrote:
>>
>>>> To what I understand, types are inferred, it is not statically typed. Am I wrong ?
>>>
>>> If there is type inference then it is statically typed (at least partially if not every variable type can be inferred)
>>
>> To repeat myself: this is not the case. Example is the RoelTyper.
>
> Yes, there are many type inferencers for dynamically-typed languages.
> But that's not because one builds a type inferencer for say Smalltalk that I can say "Smalltalk has type inference": the inferencer is not integrated within the language, it's just an analysis tool on top.
> If someone says that his language has type inference, he means that the type inferencer is built into the language, and normally there is some type checking and/or the compiler is designed to leverage type information which means that the language is at least partially statically-typed (if not entirely).
I tend to disagree: in the case of Smalltalk the border between the language and the toolchain is quite blurry. Is the browser part of the language? Refactoring support? Type inferencer? Where do you draw the line? I can have my Smalltalk dialect with type inferencing while the language is dynamically typed.
And that does not take into account all the fancy type stuff such as gradual typing, like in Gradualtalk, optional typing like Pegon (if I’m not mistaken).
> Because if a language does no type checking nor type-based optimisations, for what purpose would it have type inference built into it?
Documentation. Static types are a good form of documentation, when done right. :-)
---> Save our in-boxes!
http://emailcharter.org <---
Johan Fabry -
http://pleiad.cl/~jfabryPLEIAD lab - Computer Science Department (DCC) - University of Chile