From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: Chad Perrin <perrin@apotheon.com>, Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml)
Date: Fri, 22 Dec 2006 13:21:07 +0100 [thread overview]
Message-ID: <3EC73FC3-41A6-4FB1-9549-29286A6568CC@epfl.ch> (raw)
In-Reply-To: <20061221221650.GL9440@apotheon.com>
Le 21 déc. 06 à 23:16, Chad Perrin a écrit :
> I mean that it doesn't allow you to go around doing in-place type
> changes willy-nilly the way something like C does.
(Well in fact you can with Obj.magic, but that's not my point)
The problem is that this weak/strong terminology is hopelessly
confused (see [1],[2]). Since there is no clear unique definition of
strong/weak typing I think this terminology should be avoided. I tend
to favour the definitions you can find in the introduction of this
book [3] which are imho less confusing.
Basically the author distinguishes on one hand between statically and
dynamically typed languages, and on the other hand, between safe and
unsafe languages.
Static and dynamic type checking refers to whether type checks are
respectively performed at compilation or run time.
Safety is broadly defined as follows :
"A safe language is one that protects its own abstractions. Every
high-level language provides abstractions of machine services. Safety
refers to the language's ability to guarantee the integrity of these
abstractions and of higher-level abstractions introduced by the
programmer using the definitional facilities of the language"
Later he gives the following chart
|Statically checked | Dynamically checked
-------------------------------------------------
safe | ML, Haskell, Java, etc. | Lisp, Scheme, Perl, Postscript, etc
unsafe | C, C++, etc. |
Subsequently he adds :
"Language safety is seldom absolute. Safe languages often offer
programmers "escape hatches", such as foreign function calls to code
written in other, possibly unsafe, languages. Indeed such escape
hataches are sometimes provided in a controlled from within the
language itself--Obj.magic in Ocaml, ... "
These are just definitions. But it is hard to argue when words do not
have a common meaning between arguers. I just think these definitions
make it simpler to have a common understanding of what we are talking
about.
Best,
Daniel
[1] <http://en.wikipedia.org/wiki/Strong_typing>
[2] <http://www.artima.com/intv/strongweak.html>
[3] <http://www.cis.upenn.edu/~bcpierce/tapl/>
next prev parent reply other threads:[~2006-12-22 12:19 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-21 3:41 Scripting in ocaml Denis Bueno
2006-12-21 4:34 ` [Caml-list] " Erik de Castro Lopo
2006-12-21 7:22 ` skaller
2006-12-21 9:12 ` Till Varoquaux
2006-12-21 9:18 ` Chad Perrin
2006-12-21 10:29 ` skaller
2006-12-21 20:21 ` Chad Perrin
2006-12-21 13:30 ` Serge Aleynikov
2006-12-21 13:52 ` skaller
2006-12-21 14:59 ` Serge Aleynikov
2006-12-21 20:25 ` Chad Perrin
2006-12-21 20:41 ` Daniel Bünzli
2006-12-21 22:16 ` Chad Perrin
2006-12-22 12:21 ` Daniel Bünzli [this message]
2006-12-22 16:51 ` strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml) Tom
2006-12-22 17:34 ` Daniel Bünzli
2006-12-22 18:16 ` skaller
2006-12-22 18:47 ` Daniel Bünzli
2006-12-22 19:42 ` skaller
2006-12-22 20:03 ` David Brown
2006-12-22 20:17 ` Chad Perrin
2006-12-23 3:48 ` skaller
2006-12-23 4:11 ` Chad Perrin
2006-12-22 20:19 ` Chad Perrin
2006-12-23 12:58 ` Daniel Bünzli
2006-12-23 16:06 ` Chad Perrin
2006-12-23 21:50 ` Tom
2006-12-26 6:10 ` Chad Perrin
2006-12-22 20:14 ` Chad Perrin
2006-12-21 21:11 ` [Caml-list] Scripting in ocaml Serge Aleynikov
2006-12-21 21:27 ` Philippe Wang
2006-12-21 22:06 ` Serge Aleynikov
2006-12-22 12:35 ` Jon Harrop
2006-12-21 22:19 ` Chad Perrin
2006-12-22 12:37 ` Jon Harrop
2006-12-22 18:52 ` Chad Perrin
2006-12-22 2:51 ` skaller
2006-12-22 15:20 ` Jon Harrop
2006-12-22 11:32 ` Jon Harrop
2006-12-23 18:50 ` Jon Harrop
2006-12-24 0:15 ` Serge Aleynikov
2006-12-24 3:30 ` skaller
2006-12-21 14:59 ` Richard Jones
2006-12-21 20:27 ` Chad Perrin
2006-12-21 23:35 ` Martin Jambon
2006-12-26 17:14 ` Aleksey Nogin
2006-12-26 23:36 ` Ian Zimmerman
2006-12-27 18:25 ` Aleksey Nogin
2006-12-27 18:39 ` Richard Jones
2006-12-27 19:20 ` Aleksey Nogin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EC73FC3-41A6-4FB1-9549-29286A6568CC@epfl.ch \
--to=daniel.buenzli@epfl.ch \
--cc=caml-list@yquem.inria.fr \
--cc=jon@ffconsultancy.com \
--cc=perrin@apotheon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox