Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Perl 6: Static/Dynamic Strong/Weak Type Systems

by tomazos (Deacon)
on Apr 16, 2006 at 22:15 UTC ( [id://543715]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl 6: Static/Dynamic Strong/Weak Type Systems
in thread Perl 6: Static/Dynamic Strong/Weak Type Systems

I realize now that there is clearly no standard definition of "strongly typed".

For me it related to type casting pointers.

In "Weakly Typed" C/C++...

Foo f; Foo *pf = &f; Bar *pb = (Bar*) pf; Bar& b = *pf;

Here, f points to a piece of memory it will treat as if it was in the structure of a Foo. b points to *the same* piece of memory and instead it will treat as if it was in the structure of a Bar. Foo and Bar may have totally unrelated structures. This is what I was thinking of in terms of weak typing.

I thought you couldn't do that in Perl - hence I called in strongly typed.

(It looks like you might be able to something similiar with the pack/unpack magic mentioned above - although it is certainly not a common practice.)

-Andrew.

Replies are listed 'Best First'.
Re^3: Perl 6: Static/Dynamic Strong/Weak Type Systems
by Anonymous Monk on Apr 17, 2006 at 19:47 UTC
    My favorite take...
    So what is "strong typing"? This appears to be a meaningless phrase, and people often use it in a non- sensical fashion. To some it seems to mean "The language has a type checker". To others it means "The language is sound" (that is, the type checker and run-time system are related). To most, it seems to just mean, "A language like Pascal, C or Java, related in a way I can't quite make precise". If someone uses this phrase, be sure to ask them to define it for you. (For amusement, watch them squirm.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://543715]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found