Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: The most useful form of typing is...

by nothingmuch (Priest)
on Dec 16, 2004 at 22:34 UTC ( #415498=note: print w/replies, xml ) Need Help??


in reply to The most useful form of typing is...

Is everyone's opinion on what the difference between strong and dynamic typing in sync?

I have the impression that static is that it's known in advance, and strong is that it's enforced. Usually strong typing is a prerequisite to static typing, but does not imply when the type check is made.

Does anyone have a better definition?

And what's the diff between weak and dynamic?

-nuffin
zz zZ Z Z #!perl
  • Comment on Re: The most useful form of typing is...

Replies are listed 'Best First'.
Re^2: The most useful form of typing is...
by Errto (Vicar) on Dec 19, 2004 at 23:00 UTC

    I like your definitions, so I'll try to put together a short list of some of the languages I know and where they fit in the scale.

    • Strong and static: Haskell, ML, PL/SQL, Java (but only if they implemented generics properly so you wouldn't need typecasting)
    • Strong and dynamic: Perl, Lisp, Scheme
    • Weak and static: C, C++, Pascal, Java (as is)
    • Weak and dynamic: Javascript, VB, bash

    The reason (as I understand it) that it is possible to have weakly-typed but also statically-typed languages is because of typecasts: you are essentially instructing the compiler to ignore the type declarations you've already given it. Also note that the first two languages I listed under Strong and Static allow total type polymorphism so that the same functions and data structures can apply to arbitrarily many types, but compile-time resolution still has to be possible.

Re^2: The most useful form of typing is...
by hardburn (Abbot) on Dec 22, 2004 at 20:15 UTC

    Your definitions are close to what is in the litature. Really, "strong" and "static" are orthoginal. Being static means that your language needs to have some means of determining the types at compile time, while strong means those types are difficult to change during execution (runtime). Pascal/C/etc. determine the types via special syntax (int foo, bar; and such), while more modern Hindley-Milner type systems can figure it out based on what you do with the variable the first time you use it.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://415498]
help
Chatterbox?
[Eily]: kinda sounds like father Christmas is late
[hippo]: (asking because I'm sure you said before about learning English) Did you know there are 2 different words for smaller quantities in English? They are "less" and "fewer". Fewer applies to a number of discrete things like days.
Eily notes also
[hippo]: So if you don't drink as much milk and not as often you are said to drink less milk on fewer days. Confusing, eh?
[Eily]: same as many/much, few/little
[Discipulus]: so my 'less' usage sounded not so correct? 'fewer' was more appropriate? i take a note too

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2018-01-23 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (242 votes). Check out past polls.

    Notices?