On 18/09/2006, at 9:04 PM, Matthew Hannigan wrote:
I think dynamic typing's actually a total cop-out. There is
exactly one sceneario where dynamic typing is necessary and
useful, which is when you are loading unknown code at
run-time (e.g. plugins) and you have no idea what that code
could potentially do. Dynamic typing is useful there since
you're actually doing type-checking of the code you're
loading and ensuring that it's at least of the correct type[1].
Is it even necessary then? Why should plugins not be of type
"Plugin"?
I've deleted Andre's original, but I guess he's saying
it's possible to do strong dynamic typing. Which java does
surely.
Java's actually got one of the most complex dynamic loaders around
(certainly the most sophisticated out of the well-known programming
languages). I'm not too sure about the details, but the Java class
loader will actually check and verify the bytecode's that loaded, and
since Java also has a security model, it will also not run any
bytecode that can do dangerous things. Google around for
"classloader bytecode verification" for more info: it's complex
enough that there are papers and probably Ph.D theses written about it.
I guess you could say that Java does strong dynamic typing of
bytecode. I don't know what happens if you feed in invalid bytecode
to Perl/Python/Ruby's VM: will they segfault, throw an exception...?
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
_______________________________________________
coders mailing list
coders@slug.org.au
http://lists.slug.org.au/listinfo/coders