Bart said:
Have you also checked
http://en.wikipedia.org/wiki/Type_safety and
http://en.wikipedia.org/wiki/Type_system#Safely_and_unsafely_typed_systems,
where it is described what is meant by type safety?
When you do, you will see that implicit conversions do not affect type
safety but that the lack of type safety in C and C++ is the result of
the unrestricted use of pointers that C and C++ allow combined with
the manual memory management.
Thank you for the links. The proposal is actually a compile-time type-safety feature, and I have just updated
the web page to reflect that.
From the first link "Type safety", I think the following (which are not all the features mentioned in that
page) are accomplished so far (the proposal is a work in progress), without sacrificing the expressiveness of
C++98/03:
"most definitions involve the use of a type system to prevent certain erroneous or undesirable program
behavior (called type errors)".
"The enforcement can be static, catching potential errors at compile time, or dynamic, associating type
information with values at run time and consulting them as needed to detect imminent errors, or a combination
of both".
"The behaviors classified as type errors by a given programming language are usually those that result from
attempts to perform an operation on some values, that is not appropriate to their data types.
[...]
, while others consider any contravention of the programmer's intent (as communicated via typing annotations)
to be erroneous and deserving of the label "unsafe"".
"In the context of static type systems, type safety usually involves (among other things) a guarantee that the
eventual value of any expression will be a legitimate member of that expression's static type".
"Most statically-typed languages provide a degree of type safety that is strictly stronger than memory safety,
because their type systems enforce the proper use of abstract data types defined by programmers even when this
is not strictly necessary for memory safety or for the prevention of any kind of catastrophic failure".
The last one is one I am thinking about currently:
"A well typed program never gets "stuck", i.e., never gets into an undefined state where no further
transitions are possible".
This means we must have all compile-time type-safe variables initialised with a value.
Example:
int x; // OK, "only" is not used.
only int i1; // Error, "only" objects must be initialised always.
only int i2= 5; // OK
Regarding the second link "Safely and unsafely typed systems", I think the keyword "only", compile-time
type-safety solution accomplishes this.
More specifically I think it accomplishes in a high degree, the following:
"A third way of categorizing the type system of a programming language uses the safety of typed operations and
conversions. Computer scientists consider a language "type-safe" if it does not allow operations or
conversions which lead to erroneous conditions".