5 ms·
For some reason, I find this idea extremely disturbing; almost dystopian. To me, the sentence "a program is a text file" is one of the first axioms of computer
by enriquto 9y ago
For some reason, I find this idea extremely disturbing; almost dystopian. To me, the sentence "a program is a text file" is one of the first axioms of computer technology.
- throwaway91111 9y agoBut—only in very metaphorical ways is a program a text file.
- enriquto 9y agoHow is that metaphorical at all? In all current languages, you write programs precisely by writing text files.
- coldtea 9y agoFor one, in that a running program is not a text file -- it has been parsed into an AST, processed in various pipelines, and converted into several forms before it even hits a register...
- enriquto 9y agoOn the other hand, you can compile the same program with different optimization options, and even on different architectures, and we say that it is always the same program, but the binary objects may be wildly different. Thus, the program is the text file, not the binary object.
- MereInterest 9y agoI can add blank lines, change variable names, add comments, and yet through all these changes, it is the same program. By your logic, then, none of them can be the "real" program, just as none of the different binaries could be the "real" program. I think that it is better to think of all of these as representations of the same abstract program. The Sieve of Eratosthenes can be implemented in different languages, binary or assembler, high-level or low-level, English or code, but they are all representations of the same abstract program.
- fasquoika 9y agoStrictly speaking though, the text itself isn't a program, it's the input to a program (a compiler) that produces an actual program. On the other hand, this definition seems a little pedantic and you could even argue that the binary produced by the compiler isn't a program either, that a program consists entirely of its behavior.
- Koshkin 9y agoGenerally, this is not correct - compiling is not the only way to "translate" a program into an executable form: there are direct interpreters for many programming languages.
- fasquoika 9y agoI never said compiling was the only way, just that "translation" (as you put it) is in fact necessary.
- geoffpado 9y agoIn all current _serious_ languages, maybe, but also Piet exists: http://www.dangermouse.net/esoteric/piet.html http://www.dangermouse.net/esoteric/piet.html
- Terr_ 9y agoI think it's fair to say that all programs are written artifacts as opposed to visual ones. The few visually oriented programming languages haven't really taken off. However, it doesn't necessarily have to be the plainest of plain text. Even today, it is ridiculously popular for people to use syntax-highlighting, which adds color to everything they do. It might not get stored to the disk, but it shows that the experience of writing/reading code goes far beyond the purely textual. Other things to consider: Code-block folding; call-graph and type-hierarchy visualizations; GUI tools for files that are half-generated and half-written; the way that diff tools turn text differences into a visual experience... In other words, while storing your creative output in a simple and consistent way is good, the craft of programming has organically added many visual interactions to match the strengths and weaknesses of our human brains. It's not unreasonable to expect more of that, even if the core remains a written conversation with an idiot savant computer.