Questions tagged [compilers]
Historical compilers, or modern compilers targeting retro platforms.
71
questions
31
votes
3
answers
18k
views
Why did Borland ignore the Macintosh market?
During the 80s and 90s, Borland developed several amazing, cutting edge developer products. Their Turbo Pascal and Delphi, an Object Pascal development environment, were very popular on DOS and ...
12
votes
2
answers
1k
views
Is there a pre-defined compiler macro for legacy Microsoft C 5.10 to get the compiler's name and version number?
In Microsoft Visual C++, I can use the macros _MSC_VER for compiler identification and _MSC_FULL_VER for its version number to retrieve the data of the used compiler at runtime of my C program. But ...
4
votes
2
answers
218
views
How were strings printed in the Dijkstra-Zonneveld ALGOL 60 compiler for the Electrologica X1?
Reading the report on the first Algol 60 compiler in the world, namely the Dijkstra-Zonneveld ALGOL 60 compiler for the Electrologica X1, which contains the Pascal source faithfully reproducing its ...
19
votes
6
answers
5k
views
How did the `long` and `short` integer types originate in C?
I was wondering why C has the long and short integer type in addition to the plain int, and came across the following quote in the C99 Rationale (thanks to this answer here):
[...] In the 1970s, 16-...
7
votes
0
answers
531
views
Looking for the name of a natural language Fortran compiler
Back in the 80s I ran across a book at a garage sale titled something like "Programming Fortran In English" or "Programming Fortran In Natural Language" that described a compiler ...
23
votes
3
answers
3k
views
Why were OS/360 PL/I procedure calls so expensive in terms of stack space?
In 1977, Guy Steele published a paper entitled Debunking the “expensive procedure call” myth or, procedure call implementations considered harmful or, LAMBDA: The Ultimate GOTO. The paper was the ...
32
votes
11
answers
12k
views
Has there ever been a C compiler where using ++i was faster than i++?
Please take a look at this post: Is there a performance difference between i++ and ++i in C?
There are two essential statements in the answer:
Modern compiler produce the same machine code no matter ...
23
votes
2
answers
3k
views
Using Clang to compile MS-DOS executables
I have a simple C program, and I would like to compile it targeting MS-DOS. Can this be achieved with Clang?
I would like to produce the following formats:
COM executable
16-bit MZ executable
32-bit ...
6
votes
5
answers
3k
views
Were there cross-compiler online services for the public?
Compiling takes computing power, and to a lesser extent, storage and memory. Back in the 70s and 80s personal computers weren't powerful enough to compile codes in high-level languages or if capable ...
3
votes
1
answer
2k
views
What were top-10 popular programming languages in the 60s, 70s, and the 80s?
TIOBE index has been tracking the most popular programming languages since 2001, which reflects the dominance of C/C++/Java in the first score of 21st century. However C derivatives hadn't beat Pascal ...
7
votes
1
answer
340
views
Is there really any implementation of a Ada compiler/cross-compiler/interpreter for 6502?
I found some Ada compilers for CP/M machines but no luck for 6502-based C64/Apple II/BBC Micro. I'm not sure if Abacus Ada on C64 exists or how much a subset it implements for Ada.
There is, though, ...
17
votes
2
answers
2k
views
When did type punning through violating the strict aliasing rule become disallowed?
Looking at the C code from the Fast Inverse Square Root, the casting of a float to a long is done via pointer arithmetic:
i = * ( long * ) &y; // evil floating point bit level hacking
The ...
21
votes
2
answers
737
views
What is the history of SysV i386 calling convention for struct return?
I would like to understand historical roots of the quirk in the SysV calling convention for the 32-bit x86, which was inherited by the ELF standard, and so remains used on Linux to this day. Consider ...
14
votes
1
answer
901
views
What sequence of instructions is the equivalent to `fcomip` on i486?
Do you perhaps happen to know, what would be the easiest way to modify my AEC-to-x86 compiler (you can run the core of it in browser: https://flatassembler.github.io/compiler ) to be able to target ...
13
votes
3
answers
3k
views
Were Windows 3.x applications dependent upon 80286 instructions?
While Windows 3.x operating system stuck to the 80286 platform, did applications compiled for Windows 3.x have to use 80286 instructions explicitly or be aware of the 80286 memory layout?
Or was it ...
25
votes
12
answers
7k
views
Why were nested functions excluded from B and C?
I'm learning C and was curious as to why the language does not allow nested functions.
From what I've read, the lack of nested functions seems to have been a simplification that was inherited from its ...
31
votes
4
answers
6k
views
Most modern C compilers targeting DOS 8086, running on DOS 8086 (16-bit)
I'm looking for the most recent versions of modern C compilers which were/are targeting DOS 8086, also running on DOS 8086 (16-bit). I'm mostly interested in production-ready C compilers, rather than ...
14
votes
1
answer
2k
views
GCC to make Amiga executables, including Fortran support?
I have been compiling some command line programs to run on the classic Commodore Amiga. I started with GCC on WinUAE which worked but I realised I didn't have the understanding of the memory stack and ...
10
votes
1
answer
560
views
What were the typical game development toolchains for the pre-i386 IBM PC era
On i386 and beyond (assuming MS-DOS as the target OS and IBM PC as the target platform), my impression is game developers most typically used Watcom C / DJGPP plus one of the DOS extenders (DOS4GW, ...
38
votes
6
answers
7k
views
Why couldn't early C compilers handle variable declarations between statements?
In modern C, you may place variable declarations between statements:
do_something();
int x;
x = something_else();
However, older C compilers required that variables are declared before all statements:...
14
votes
1
answer
2k
views
Did any compilers hash long symbol names when truncating them?
Many early compilers and interpreters had maximum length for variable and function names. Usually you could use longer names but everything beyond e.g. the first 8 characters was discarded.
This ...
7
votes
1
answer
375
views
When was a compiler first used to generate code to be placed in ROM?
In the early days of compilers, it was expected that programs would generally be stored in an inexpensive medium (such as punched cards or magnetic tape) when not in use. Although it was possible to ...
20
votes
1
answer
2k
views
How can I set up the Microsoft C compiler to make it prefer immediate-mode push instructions?
I started a project to get a better understanding on how to compile a game for Windows 3.x. I tried to set up the build workflow so that it produce the byte-exact clone of a great open sourced Win16 ...
3
votes
1
answer
252
views
How to remove ___EXPORTEDSTUB statement from a NE (Win16) program's MAP?
I started a project to get a better understanding on how to compile a game for Windows 3.x. I tried to set up the build workflow so that it produce the byte-exact clone of a great open sourced Win16 ...
11
votes
7
answers
4k
views
Did compilers ever give error messages without line numbers?
I'm having an argument with my friend, who told me that when she was learning programming in the 1980s, the compiler gave errors without line numbers.
I'm pretty sure that compilers have always given ...
10
votes
1
answer
476
views
What sort of intermediate representation did the first Fortran compiler use?
Proebsting's Law asserts that improvements to compiler technology double the performance of typical programs every 18 years, but even granted that this is somewhat tongue-in-cheek, it's not really ...
5
votes
1
answer
270
views
Which extant ALGOL-60 compilers fully support numeric labels?
This question is prompted by a related one by texdr.aft. It turns out that the Revised report on Algol-60 allowed numeric labels (3.5.1, page 15),
<label> ::= <identifier> | <unsigned ...
4
votes
1
answer
356
views
Where can I find a copy of the HiSoft C compiler manual for ZX Spectrum?
I've been able to find the manual for the CPC version of HiSoft C, but not for the ZX. The only ones I could find appeared to have been OCRed, so virtually all of the necessary information was lost.
...
9
votes
1
answer
678
views
What was the first compiler/interpreter/assembler to indicate problematic columns in diagnostic messages?
These days, most compilers and interpreters seem to provide the following in diagnostics:
A description of the problem
The name of the source file
A line number
A relevant position within the line
...
13
votes
6
answers
850
views
Are there any primary sources for the “passing constant by reference” behavior in old Fortran compilers?
Occasionally I have heard references to a peculiarity of certain (old) Fortran compilers, with regards to subprogram argument passing. Here is an example, from an answer to a Stack Overflow question:
...
1
vote
1
answer
233
views
When did cross-platform C start assuming function prototypes? [closed]
The most important difference between the original 'K&R' C, and ANSI/ISO C89/90, was function prototypes. These started being supported by some compilers in the mid-eighties, were formally ...
23
votes
2
answers
2k
views
Where and when did the ".s" suffix for assembly-language source files originate?
The closest I was able to find on StackOverflow is What are .S files?, in which no answerer addresses why we use .s for assembly. (And .S for preprocessor/macro assembly; and gcc -S to produce ...
22
votes
10
answers
7k
views
When if ever was the C language 'int' size altered from the host machine word (register) size into a literal 32 bit size?
From the earliest K&R reference manuals I read, 'int' was synonymous with machine word and it seemed to raise adverse reactions in various user domains. With the UNIX crowd, they minimally ...
35
votes
15
answers
12k
views
When did compilers start generating optimized code that runs faster than an average programmer's assembly code?
It is highly unrecommended to write your own code in assembly now since, in most cases, gcc -O3 does magic. But in the ‘80s it was believed that compiled C code takes 4(?) times or more than a well-...
56
votes
13
answers
10k
views
What languages are better fit for generating efficient code for 8-bit CPU's than C?
I found Why do C to Z80 compilers produce poor code? very interesting as it pointed out that C (which was leveraged to be an abstraction of a CPU for porting Unix) was not a very easy language to ...
37
votes
11
answers
9k
views
When and why did high-level language compilers start targeting assembly language rather than machine code?
From what I've read, the first FORTRAN compiler built a machine-code program entirely in memory; it was, in fact, designed to read the entire source code of the program, and then sequentially load ...
12
votes
1
answer
656
views
How much time and how many people were required to develop Delphi version 1?
I would guess the compiler was primarily a modification of Borland's Turbo Pascal, while the Integrated Development Environment and Visual Component Library required a lot more development from ...
3
votes
3
answers
596
views
How can I get cl65 to include its subroutines, like pushax and tosmulax?
This question is about cc65, which is a toolkit including a C compiler, assembler, linker, etc. All targeting various 6502 computers, like the various 8 bit commodores, the Apple II and whatever else. ...
3
votes
5
answers
1k
views
Z88DK ZX Spectrum "%f" printf not working
I'm attempting to compile a program in C for the ZX Spectrum using Z88DK.
However, I'm facing an issue when trying to use printf to print out the value of a float.
The code I'm trying to compile:
#...
6
votes
2
answers
407
views
Why isn't the 'restrict' keyword useful in SDCC when compiling for Z80 target? [closed]
Context
SDCC claims to support C11.
I use it to write games on Z80 target (for fun and experience).
C11 defines restrict
C11 specifies the restrict keyword on pointers, which can improve generated ...
19
votes
0
answers
1k
views
Oxford C compiler for Commodore 64
I kept one floppy from my Commodore 128 (which I used mostly in C64 mode), labelled ‘Oxford C compiler’. It is a 5.25″ floppy. Don't ask me why I kept just this one; probably because I thought I ...
11
votes
1
answer
3k
views
What was the first Lisp implementation that could generate machine code?
LISP is considered by some to be primarily an interpreted language, but compilers
have been made for it. What was the first compiler?
To be clear, this is about compilers that compile LISP code stored ...
3
votes
0
answers
438
views
How do Apple II BASIC compilers compare? [closed]
Programs like The Beagle Compiler allow AppleSoft BASIC or other Apple II BASIC variants to be compiled. How do the compilers compare in terms of compatibility with AppleSoft language features? Eg how ...
7
votes
1
answer
517
views
Was dynamic type check in Pascal commonplace?
The BESM-6 Pascal compiler I'm experimenting with has a notable difference from Standard Pascal: formal arguments of formal parameters-procedures or functions are not specified, but are checked at ...
17
votes
1
answer
2k
views
ZSPL language, anyone heard of it?
While reading the Byte sieve article (Gilbreath 1981), I came across a language I have never heard of, ZSPL.
I suspected this was actually a specific version of another language, perhaps PL/1. ...
62
votes
7
answers
16k
views
Did any compiler fully use Intel x87 80-bit floating point?
There is a paradox about floating point that I'm trying to understand.
Floating point is an eternal struggle with the problem that real numbers happen to be both essential and incomputable. It's the ...
1
vote
2
answers
290
views
What was the first language compiler to support subtype polymorphism? [closed]
I'm trying to understand the history of Dependency Injection in compiled languages, as an intentional feature of the language. The Wikipedia article on the subject is decidedly Java focused, but I ...
6
votes
0
answers
270
views
How did the template cache in CFront work?
I've seen some discussion of how templates were historically implemented in CFront around the web, including here.
The link describes the Borland model, which is familiar, and the CFront model with a ...
12
votes
4
answers
1k
views
How was dataflow analysis performed before SSA?
If we look at something like LLVM or the GNU Compiler Collection, Dalvik and many others, their intermediate representation (IR) uses SSA (Static Single Assignment form), as part of their Data-Flow ...
7
votes
1
answer
686
views
BCC LD86 file has bad magic number
I wanted to write a simple hello world program in DOSBox, so I downloaded Bruce's C Compiler from here. And wrote this program (using edit.exe):
#include <stdio.h>
int main() {
printf("...