From: | Martin Ward <martin@gkc.org.uk> |
Newsgroups: | comp.compilers |
Date: | Mon, 6 Jan 2014 19:32:31 +0000 |
Organization: | Compilers Central |
References: | 13-11-025 13-12-009 |
Keywords: | design |
Posted-Date: | 08 Jan 2014 00:55:52 EST |
On Tuesday 17 Dec 2013 at 23:07, Kaz Kylheku <kaz@kylheku.com> wrote:
> Since highly portable programs that produce bit-exact results on multiple
> platforms can be written in languages that have implementation-defined
> behaviors, there is no reason why languages cannot themselves provide this,
> at least with regard to their internal data structures.
>
> There are practical concerns that stand in the way, at least one of
> which is damning of the idea, however.
Kaz gives two examples, the first is floating point, which I have
already discussed.
The second is operating system interfacing: specifically text file
representations. Here, the issue is that the program is not operating
on a set of bits but on a higher-level structure called a "text file".
The same program should produce identical text files on any operating
system (with any version of the compiler). The exact representation of
the text file in each operating system is a different issue. This
means than on opening a file the language needs to specify whether
this is a binary or text file (or a file containing some other type of
data) and if it is text. what encoding to use (ASCII, Unicode, EBCDIC
etc.)
This means that the same program should generate the same text file
(which may well be a different binary file) on an ASCII or EBCDIC
system, for example.
--
Martin
Dr Martin Ward STRL Principal Lecturer and Reader in Software Engineering
martin@gkc.org.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/
Mirrors: http://www.gkc.org.uk and http://www.gkc.org.uk/gkc
Return to the
comp.compilers page.
Search the
comp.compilers archives again.