A question on types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

A question on types

C K Kashyap
Hi,
To clarify my understanding, I created this table

|         | weak | strong  |
|---------+------+---------|
| dynamic | perl | Ruby    |
| static  | C    | Haskell |
|---------+------+---------|

Could someone please ratify this?
Regards,
Kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110801/54c59243/attachment-0001.htm>

Reply | Threaded
Open this post in threaded view
|

A question on types

Arlen Cuss-2
01.08.2011 17:52, C K Kashyap kirjutas:
> Hi,
> To clarify my understanding, I created this table
>
> |         | weak | strong  |
> |---------+------+---------|
> | dynamic | perl | Ruby    |
> | static  | C    | Haskell |
> |---------+------+---------|

Yes, though I'm not sure you could call Ruby's types "strong" either; it
doesn't really have types in a such a defined sense (objects have
classes, but that's not a "type" as such).

I'm not qualified to comment on perl either.


Reply | Threaded
Open this post in threaded view
|

A question on types

Thomas Davie

On 1 Aug 2011, at 09:53, Arlen Cuss wrote:

> 01.08.2011 17:52, C K Kashyap kirjutas:
>> Hi,
>> To clarify my understanding, I created this table
>>
>> |         | weak | strong  |
>> |---------+------+---------|
>> | dynamic | perl | Ruby    |
>> | static  | C    | Haskell |
>> |---------+------+---------|
>
> Yes, though I'm not sure you could call Ruby's types "strong" either; it
> doesn't really have types in a such a defined sense (objects have
> classes, but that's not a "type" as such).
>
> I'm not qualified to comment on perl either.

Which really highlights that strong/weak is not a binary thing.  There's not even a sliding scale, but instead, simply different properties.  For example, Javascript will happily let you compare "0" with 0.  C won't let you do that, but it will let you treat an integer as a pointer and vice versa.

Bob



Reply | Threaded
Open this post in threaded view
|

A question on types

Thomas Davie
In reply to this post by Arlen Cuss-2

On 1 Aug 2011, at 09:53, Arlen Cuss wrote:

> 01.08.2011 17:52, C K Kashyap kirjutas:
>> Hi,
>> To clarify my understanding, I created this table
>>
>> |         | weak | strong  |
>> |---------+------+---------|
>> | dynamic | perl | Ruby    |
>> | static  | C    | Haskell |
>> |---------+------+---------|
>
> Yes, though I'm not sure you could call Ruby's types "strong" either; it
> doesn't really have types in a such a defined sense (objects have
> classes, but that's not a "type" as such).
>
> I'm not qualified to comment on perl either.

Which really highlights that strong/weak is not a binary thing.  There's not even a sliding scale, but instead, simply different properties.  For example, Javascript will happily let you compare "0" with 0.  C won't let you do that, but it will let you treat an integer as a pointer and vice versa.

Bob



Reply | Threaded
Open this post in threaded view
|

A question on types

Mike Meyer
In reply to this post by C K Kashyap
On Mon, Aug 1, 2011 at 12:52 AM, C K Kashyap <ckkashyap at gmail.com> wrote:

> Hi,
> To clarify my understanding, I created this table
>
> |         | weak | strong  |
> |---------+------+---------|
> | dynamic | perl | Ruby    |
> | static  | C    | Haskell |
> |---------+------+---------|
>
> Could someone please ratify this?
>

Static vs. dynamic typing is pretty well always understood to mean compile
time vs. run time  type checking, so you've got that one.

On the other hand, there's no widely accepted definition of strong vs. weak
typing. So I'm pretty sure there's at least one definition for which you're
right. Both C and Ruby fit definitions for both strong and weak typing, and
there are probably definitions that have them swap places. Perl and Haskell
may always be considered weakly and strongly typed (respectively), but I
wouldn't bet on it.

    <mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110801/d64e7169/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

A question on types

C K Kashyap
Thank you folks...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110801/c87a386d/attachment.htm>