At 2002-08-10 01:21, Marcin 'Qrczak' Kowalczyk wrote:
Perhaps we can assume some widely true facts even if ANSI C doesn't guarantee that if it makes life easier. For example that a C type corresponding to Int32 exists at all, and that different pointer types have the same representation - we already rely on that, don't we?
No, we have separate Ptrs and FunctionPtrs IIRC... One of the things that really bothers me about C is the way its unspecifiedness about types can "infect" other languages. For instance, what exactly is a Haskell Int? Java, at least, stands firm, but then platform-independence was one of Java's explicit design priorities. -- Ashley Yakeley, Seattle WA
On Sat, 10 Aug 2002, Ashley Yakeley wrote:
One of the things that really bothers me about C is the way its unspecifiedness about types can "infect" other languages. For instance, what exactly is a Haskell Int?
I think it's the idea that's infectious, because it is a good idea. The C standard didn't do this for fun, but to allow programmers to find out what integer type would be most efficient for general use. The ideal is probably to provide Int, Int8, Int16, Int32, Int64, Int128, Word8, Word16, Word32, Word64, Word128. Or something.
Java, at least, stands firm, but then platform-independence was one of Java's explicit design priorities.
And all Java programs run equally slowly.
Ashley Yakeley wrote:
One of the things that really bothers me about C is the way its unspecifiedness about types can "infect" other languages. For instance, what exactly is a Haskell Int?
Java, at least, stands firm, but then platform-independence was one of Java's explicit design priorities.
Platform-independence is *also* one of Standard C's explicit design goals, it just approaches it in a different way. Standard C attempts platform independence by specifying the existence of a certain number of built-in numeric types, and certain guarantees about each of them. It requires that programmers know what is and is not guaranteed, however, and write code accordingly. It's possible to write portable code in C, but you must abandon the assumption that (for instance) an 'int' is exactly 32 bits, since that's not true on all platforms. The slogan is "All the world is not a VAX." Java attempts platform independence by declaring that all the world *is*, in fact, a VAX [*]. [*] More precisely, a 32-bit platform with IEEE 754 floating point. --Joe English jenglish@flightlab.com
Joe English wrote:
Java attempts platform independence by declaring that all the world *is*, in fact, a VAX [*].
[*] More precisely, a 32-bit platform with IEEE 754 floating point.
And the original VAX did in fact not have IEEE floating point. :-) -- Lennart
participants (4)
-
Ashley Yakeley -
David Feuer -
Joe English -
Lennart Augustsson