Cleanup Required
I came to this page trying to find out about Type Safety. I read in the first paragraph that there are different definition of the term, but I'm not told what any of them are. I keep reading but I still don't find out what Type Safety is.
So I looked in the Definitions thinking I'd find some clues. But the definition starts with a nice little quote which doesn't really tell me (and, by the way, is obviously not true). So I keep reading and find that there are definitions in there, but definitions for Type Safety. Even a definition of 'Type' would be good, but alas no.
I'm reading the article because I want a quick understanding of what Type Safety is. What is a Type? What is Type Safety. I can't find anything in the article that gives me a quick overview so I can decide which bits I want to carry on reading.
The definition of Type Safety on the article "Strongly-typed programming language" is much clearer than the content of this article. A cleanup is definitely required
Garbage collection and type safety
Is it so? I don't think gc has anything to do with type safety. The type safety, as described in datatype, is that type rules are enforced rigidly. For example, you cannot performance integers addition over a value with a character datatype, even though it is perhaps possible on the level of the underlying computer architecture. -- Taku 23:13, Apr 17, 2004 (UTC)
Why merge? Datatypes and type-safety are different topics. Might I suggest the type safety discussion of datatype gets placed in here? This page should discussion type safety as in this book
Complete semantic model?
Some question:
Maybe I am not knowledgable enough to understand this. I read in your userpage that your Ph.D student so I don't doubt your expertise in computer science. I am just trying to understand some.
Anyhow, what is a complete semantic model? From reading, it seems C lacks semantic mode while Java and Scheme, so C is not type-safe but Java and Scheme are. Is this simply means C has a mean to bypass a type system? What about C++? Is it as unsafe as C? -- Taku 23:41, Apr 17, 2004 (UTC)
Why did you remove this ? I thought it helps understand what does it mean by bugs making Java's type system unsafe. -- Taku 00:22, Apr 18, 2004 (UTC)
Type safety/types
Maybe it's just a bad term, but I find the idea of "type-safety" having apparently nothing to do with types rather suspect. Is this some kind of historical accident?
Derrick Coetzee 17:01, 18 Apr 2004 (UTC)
Questionable claims
This article is full of highly questionable claims (Java and Scheme have been "mathematically proven" to be type-safe? Type safety requires a garbage collector?). There isn't even any mention of the key concepts in type-safety, viz. type-preservation and progress! I encourage editors to read the illuminating discussion on this very topic on the TYPES list. The present article only exposes a needless confusion of semantics (types) and implementation details (gc, etc.). — Kaustuv 20:06, 2004 Aug 17 (UTC)
Garbage Collection Confusion
The phrase "typically needs" is pure weasel wording. Either GC is necessary in a type safe language or not. If it is just one way to implement type safety, than the relationship is such that some type-safe languages do not have GC, and some non-type-safe language have GC. I think this qualifies as irrelevant.
The explanation given is weak as it is couched completely in a single example, and makes no effort to give a definitive reason why GC may be required.
It's very difficult for a general language to be typesafe and not have GC. I'll try to explain the concept here: Suppose that there was no GC in your language. Then that would mean you could have so-called dangling pointers. Now suppose you have a dangling pointer to an object that has an integer field. Now suppose that a new object is allocated on top of where this integer field uses to be, but instead of an integer field it's a pointer. If you now take the dangling pointer and change the integer field, you've actually arbitrarily changed the pointer value!
A non-GC language could only get around this problem by only allowing objects of the same type to be allocated in only the same locations. Reference counting could also be used, but reference counting is really considered a GC technique... but that's a whole other topic. MShonle 22:14, 7 May 2005 (UTC)
I've updated the article. I also removed a rather snide, philistine comment that these claims about garbage collection were "dubious". I'm amazed how many times I've had to repeat this fact that appears repeatedly in computer science literature. I hope now that my saying "garbage collection or specialized memory management" will clear up any doubts.
Here is the much-wanted quote from Pierce , in his book Types and Programming Languages, 2002. Page 158:
MShonle 01:31, 14 May 2005 (UTC)
Just to be sure: Type safety is about programs "not going wrong." What I've described here is a way that, even if you can't manipulate the bits of a pointer directly (like typecasting in C allows) you can still make the program "blow up" through this complex dangling pointer example I've described. To get around this dangling pointer problem you can either use garbage collection (common), or pools of object allocations where only structurally equivalent objects get allocated in the same memory regions (rarely used). If you don't fall into either GC or this (relatively) rare management, the language isn't typesafe. MShonle 21:59, 13 May 2005 (UTC)
The requirement of storage reclamation (garbage collection or otherwise) is entirely a pragmatic one, having nothing to do with semantics. You could perfectly well define a language that has bounded storage requirements (requiring fixed-size arrays, no pointers, and no recursion, even indirectly -- and yes, such languages do exist), or that fails when it runs out of storage (the cleanest semantics can't prevent that in general...). The wording needs to be changed to reflect all this. --Macrakis 00:36, 27 January 2006 (UTC)
New "Definitions" section
I originally just wanted to add the link to Wright and Felleisen, who are generally credited with having invented Preservation and Progress. I ended up creating a new Definitions section, and became worried about the fact that the article defined type soundness in such a way as to completely rule out denotationally-specified languages (they have nothing analogous to Progress). W&F's paper describes some of the denotational-semantics-based notions of safety that were around before they did their thing; it seems like as long as this article is going to mention formal stuff we should at least leave room for someone who knows about denotational semantics to put in a word or two, so I tried to do that.
I have also clarified a bit how a dynamically-typed language can be type safe.
Another thing I think this article should say but doesn't is: Only in a type-safe language are type annotations really meaningful. In C, you can declare a local variable
but, because C is not type-safe you can never be sure that
xpoints to a legitimatesomethingunless you have just created it yourself. In Java, on the other hand, if you saythen anything that might result in
xbeing anything other than an instance ofSomething(or of one of its subclasses) will be illegal.And since Ph.D. students in programming languages seem to be playing a big role in this discussion, I'll mention that I am one too. :-)
Cjoev 00:04, 24 January 2006 (UTC)
Theory vs. Praxis.
While I am a great advocate of type safetyI feel that the article is to much on the theoretical side of live.
So more I read the discussion here so more if wonder if any "real" programming language can actualy archive "Type safety" as described here. That's unless they give up on the option of beeing self-hosted:
Actualy most languages mentioned here as type save are not self-hosted.
This reminds me of Why Pascal is Not My Favorite Programming Language - especial the Chaper 2.6. "There is no escape". Question: Is a type save language allowed to have an escape? Example: I allways considered Ada to be type save - and indeed: Ada's default behavior follows the two rules outlined in this module. However Ada does have escapes in the form of Unchecked_conversion and Unchecked_Deallocation (and some others).
--Krischik T 10:18, 25 January 2006 (UTC)
Krischik, I hope you won't mind, but I reorganized your most recent contribution. I hope I preserved your intent, if not your language. I think what our conversation has shown is that when it comes to judging real-world languages and implementations, there is a large gray area between C (really really unsafe) and somethi
Safety Toolbox Talks :: Toolbox Topics and Safety Meetings - Welcome ...
Free safety toolbox topics, talks, meetings and resources., Welcome to Safety Toolbox Talks, the free exchange resource for Safety Professionals
Safety Talks Page
A safety talk is a hands-on way to remind workers that health and safety are important on the job. Each talk takes about five minutes and can help workers recognize and control ...
Safety Talk - www.hospitalsafetycenter.com - a division of HCPro, Inc ...
Safety Talk. One of the benefits of your subscription to Hospital Safety Center is the chance to participate in Safety Talk," a moderated e-mail talk group that deals with a wide ...
ISMP Safety Talk
Moderated forum (New Posts) Normal Forum (New Posts) Moderated forum Normal Forum Redirect forum Closed forum (No new posts allowed)
Safety Toolbox Talks | BLR.com
Safety toolbox talks help to keep you in compliance with OSHA worker safety training rules. Free safety toolbox talk to keep you in compliance.
Caterpillar Safety Toolbox Talks
Google Code -->...
Safety Talk - British Sub Aqua Club
Safety Talk. Forming part of the monthy membership bulletin 'BSAC Talk', 'Safety Talk' highlights key safety themes and provides guidance for addressing the issues raised.
Safety Talks | Membership Exclusives | Arizona Chapter National Safety ...
Arizona Chapter National Safety Council © 2009 All rights reserved.
Safety Toolbox Talks :: Toolbox Topics and Safety Meetings - Toolbox ...
Free safety toolbox topics, talks, meetings and resources.
Safety Talks
** 24 Hour Hazwoper Class (also 8 Hour Refresher) at Huntington Nov. 16th Must pre-register by Nov. 13th ** Closed for Thanksgiving on November 26th and 27th