lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2017-06-20 01:04, Italo Maia wrote:
Ok ... then, could someone provide an example of a weakly typed
language? If there is no problem to operate on different types
because the operation is defined, I'm quite unsure of what could be
weakly typed.

C is weakly typed: `int main(void) { return *((int*)0); }` escapes from
the type system and hard-crashes the program, and it compiles with zero
warnings under `gcc -Wall -Wextra -pedantic`.

(`clang -Weverything` complains that I should have said `volatile int*`.
Adding that gives a warning-free compilation.  At -Weverything.  So as
far as C is concerned, that crashing one-liner is top quality code!)

-- nobody