+4  A: 

Strongly typed means that there are restrictions between conversions between types. Statically typed means that the types are not dynamic - you can not change the type of a variable once it has been created.

Svetlozar Angelov
To demonstrate this: In a strongly-typed language, you cannot compare "5" == 5 and get it to be true: Strings are not integers. If my memory serves, most modern scripting languages are strongly dynamically typed. Tcl/Tk, however is weakly typed - Everything can be treated as a string.
Little Bobby Tables
Bobby, in a weakly typed language "5" == 5 is read as 0x35 == 0x05. Or in other words, everything is treated as raw bytes.
Jonathan Allen
I have to disagree with you both. Take Lua; you can compare "5" == 5 and it will return false, however a quick conversion can be done by going "5" + 0.
RCIX
+41  A: 
cletus
Instead of saying $s is a integer or string ,would have been better if you say the type is associated with the "abcd" or 1234 not with the variable $s.
Srinivas Reddy Thatiparthy
Excellent answer with clear examples. However, I think it doesn't completely address the confusion as to WHY people ask about strong/static as a twin pair of concepts. For example, the OP's wording of "does static typing IMPLY strong typing?" Your answer emphasizes their independence. To continue the clarification of why the strong is often PAIRED with static, Norman Ramsey's previous answer is very good: http://stackoverflow.com/questions/376611/why-interpreted-langs-are-mostly-ducktyped-while-compiled-have-strong-typing#376828
JasDev
`"abc" + 123` is a *runtime* error, not a compile error in ruby. If it was a compile error, ruby would be statically typed.
sepp2k
The weak typing examples need to be improved (see my answer) but otherwise nice formating.
Adam Gent
In my opion strong vs weak typgin is this: Strong: "c" + True = runtime error or compile time error. Weak: "c" + True = "b" or "d" because everything is treated as raw bytes. Strong: C#, Ruby, C++ Weak: Assembly, C (due to implicit void pointers)
Jonathan Allen
+4  A: 

One does not imply the other. For a language to be statically typed it means that the types of all variables are known or inferred at compile time.

A strongly typed language does not allow you to use one type as another. C is a weakly typed language and is a good example of what strongly typed languages don't allow. In C you can pass a data element of the wrong type and it will not complain. In strongly typed languages you cannot.

Joe Cannatti
+1  A: 

Both are poles on two different axis:

  • strongly typed vs. weakly typed
  • statically typed vs. dynamically typed

Strongly typed means, a will not be automatically converted from one type to another. Weakly typed is the opposite: Perl can use a string like "123" in a numeric context, by automatically converting it into the int 123. A strongly typed language like python will not do this.

Statically typed means, the compiler figures out the type of each variable at compile time. Dynamically typed languages only figure out the types of variables at runtime.

Daren Thomas
I have to disagree. A strongly typed language is one that knows what the types are at runtime. A weakly typed language is one that doesn't like Assembly. Your example is on a third axis, "implicit vs explicit conversions".
Jonathan Allen
Actually normal I agree Jonathan but you don't have to have the types available at runtime to be strongly typed if you do complete static analysis and don't allow casting. (see my edited answer).
Adam Gent
+2  A: 

Strong typing probably means that variables have a well-defined type and that there are strict rules about combining variables of different types in expressions. For example, if A is an integer and B is a float, then the strict rule about A+B might be that A is cast to a float and the result returned as a float. If A is an integer and B is a string, then the strict rule might be that A+B is not valid.

Static typing probably means that types are assigned at compile time (or its equivalent for non-compiled languages) and cannot change during program execution.

Note that these classifications are not mutually exclusive, indeed I would expect them to occur together frequently. Many strongly-typed languages are also statically-typed.

And note that when I use the word 'probably' it is because there are no universally accepted definitions of these terms. As you will already have seen from the answers so far.

High Performance Mark
+4  A: 

Data Coercion does not necessarily mean weakly typed because sometimes its syntacical sugar:

The example above of Java being weakly typed because of

String s = "abc" + 123;

Is not weakly typed example because its really doing:

String s = "abc" + new Integer(123).toString()

Data coercion is also not weakly typed if you are constructing a new object. Java is a very bad example of weakly typed (and any language that has good reflection will most likely not be weakly typed). Because the runtime of the language always knows what the type is (the exception might be native types).

This is unlike C. C is the one of the best examples of weakly typed. The runtime has no idea if 4 bytes is an integer, a struct, a pointer or a 4 characters.

The runtime of the language really defines whether or not its weakly typed otherwise its really just opinion.

EDIT: After further thought this is not necessarily true as the runtime does not have to have all the types reified in the runtime system to be a Strongly Typed system. Haskell and ML have such complete static analysis that they can potential ommit type information from the runtime.

Adam Gent
B is probably a better, if a little less well known, example.
Tom Hawtin - tackline
Javascript is also rather weakly type but because there are so few types and because you can't really construct new types.
Adam Gent
+10  A: 
Norman Ramsey
This is the more correct answer although a little verbose :)
Adam Gent
@Adam: Evidently not correct enough to be upvoted :)Because Cletus's answer contains so many misconceptions (although I edited out the worst of them), I felt compelled to spell everything out in words of one syllable...
Norman Ramsey
@Norman: Well I upvoted you :) Even the word "compile" is not a clear one with today's VMs running dynamic languages. Technically Java and C# are both compiled twice (JIT) and both do some type analysis. A language like Javascript running in .NET vm might be more Typesafe because of the VM.
Adam Gent