Hot answers tagged

135

Turbo Pascal programs start by calibrating a delay loop (so that the Delay function knows how much to spin to achieve a certain delay). The calibration counts the number of times a certain loop is run for 55ms (as measurable using the PC’s timer interrupt with its default setting), then divides the number of loops by 55 so that Delay can then busy-wait in ...


63

The definition of PASCAL is, above all else, intended to be simple. PASCAL was designed as a pedagogical language (with aspirations to be useful for commercial purposes, but that was a secondary concern). For this purpose, the definition had to be small and orthogonal so that it could be explained simply and concisely. For ease of implementation, the ...


37

Was Ritchie correct, or was he just being modest? I’m not sure modesty plays a part here; I don’t see any statement of value attached to the size of a language’s family. As of the date of the quote (1993), were more computer languages descended from Pascal than C? Yes, he was correct, at least as phrased in the paper. Perceptions are perhaps biased ...


37

UCSD Pascal was a product of UCSD - The University of California at San Diego. It was not a product of Apple. UCSD Pascal was available on a number of machines, including the PDP-11, TI99/4, the BBC Micro and the IBM PC. It was a noble attempt to produce a fully cross-platform language. UCSD Pascal used a disk filing system that was intended to be ...


27

I think it’s worth looking at the rise of Turbo Pascal (in particular) to understand its “downfall”. When Turbo Pascal was released, it has a number of advantages over the competition, regardless of programming language: it was fast, it produced (reasonably) fast programs, it came with excellent documentation, it included a full development environment with ...


24

UCSD Pascal was developed prior to the Apple II, during the 70's in San Diego, using PDP-11 class machines with a 512-byte block disk structure. In the process of porting it to microcomputers, often (not always) the file system also got ported. UCSD Pascal was seen as a closed environment offering everything in one place. Today we might call this an IDE ...


22

From personal communication with Adam Sampson: I think it's fairly likely that the designers of your 1979 dialect of Pascal were thinking of this as a feature to support (what was then called) "backtrack programming" for AI-like applications, rather than as an exception handling mechanism... There were several programming languages ...


20

Unlike Boolean constants, the value of NIL cannot be assigned a particular type. That's why it has to be parsed in a special way, that is, it has to be a keyword. Another reason for NIL to be a keyword is to disallow explicitly dereferencing NIL by writing NIL@. If NIL were a predefined constant of any pointer type, even a magic polymorphic pointer, it ...


17

[Preface: It's about genuine Pascal history, thus I will answer this based on the original 1970 Pascal Manual. Since then many different implementations have been made, so it might not be true for all variations out there] Why have numeric labels? To start with, one has to keep in mind that Pascal is intended to do away with labels and goto. It is not to ...


15

What exactly does it mean to be a "Pascal machine" in that context? It's close but not really the case. It starts with the term Pascal Machine being misused, as this usually describes a software and/or hardware to interpret p-code; today we would call it bytecode, like the Pascal Microengine or a p-code interpreter. This virtual machine was called by its ...


14

Delphi 1.0 was released Feb 14, 1995. By my (now somewhat foggy) recollection, research / experimentation that directly contributed to defining the Delphi visual development experience started around 1992. The research group included some folks who had previously worked at Xerox Parc Place on human-machine interface design and theory, as well as the Turbo ...


14

The ISO 7185 Pascal standard, section 6.4.3.5 "File-types", says (my emphasis): There shall be a file-type that is denoted by the required structured-type-identifier text. The structure of the type denoted by text shall define an additional sequence-type whose values shall be designated lines. A line shall be a sequence cs ~S(end-of-line), where ...


12

Pascal can be parsed without using a table of user symbols. If general symbols were allowed as labels, a compiler that encounters a user identifier when a statement is expected would have no way of knowing in advance whether it was a statement label without having to refer to a symbol table. As for the way forward declarations work, it simplifies the ...


11

I don't think the answer is very complicated, but the scope and time-frame of the transition was much bigger than you indicate. This wasn't so much about what was happening in DOS/PC programming as it was about the slow but steady unification of scientific computing and mainstream/business computing. The C Language, along with the Unix OS, grew to dominate ...


11

If the compilers you have were based on the P-series, then I believe that there was indeed a bug. In the P-series compilers after P2, the destination of an assignment is determined by a routine named selector, which branches on the klass field of fcp, a variable that holds information about a relevant identifier. When the klass is func, i.e., when the ...


8

They probably meant Landin's J operator, which is basically a precursor to the call-with-current-continuation function from Scheme. See the relevant part of Racket documentation.


7

Short Answer: Yes Was Ritchie correct, or was he just being modest? As of the date of the quote (1993), were more computer languages descended from Pascal than C? (*1) Well, it's not as easy as it sounds, as there is no birth certificate with all parents named. Both languages are Algol descendants. And throughout the 1980s Pascal was seen as the way to ...


7

Will CODE (pcode 'executables') files from the II. p-System run correctly on the IV. p-System? Quick answer: No The roman numeral (I..IV) of the p-code system denotes the underlying p-code engine. They are incompatible with each other. Even though they are quite similar, the binary representation changed with each version. Making them not (upward) ...


7

It is difficult to say for sure, because there have been a lot of implementations of the Pascal Language (some of them not very widely distributed), each with their own specific additions to the language. Anyway, my researchs show that it is very unlikely that a feature like the one you describe have been made available before 1979: The Turbo Pascal ...


7

This is not an answer as I don't know the real reason. It is just a comment about parsing label: In pascal varname: is expected to be followed by either = or a variable type. If a statement were added, then parsing would be a lot more complicated. If, however, you get number: it is relatively unique. If it is followed by anything else other than a ...


6

I suspect it was, at least in part, due to the offerings from Microsoft getting a lot better. MFC was launched in 1992, I believe, and that, combined with C++, made a huge difference in productivity, compared to the painful old world of C and Windows API. Also, Visual Basic arrived in 1991, although it was widely available before then in beta, and that made ...


6

How can I recognise in the p-Code, that this is an integer function and has not 3 parameter values (6 bytes = 3 words data). Has not? To be honest, I'm a bit confused about what you're asking. So here are my two (no, not cents) possible interpretations of this question. If it's about how many parameters a function has: In p-code functions always have (at ...


6

At the time he wrote that, it would have been literally true. Concurrent Pascal, *Pascal, SUE (which I'd like to know more about), Modula (not Modula-2), Modula-2, Mesa, Modula-3, Euclid, Concurrent Euclid, Turing, Turing+, the Gypsy specification language, LIS (another one I'd like to know more about), and arguably CLU. Those are just ones I can call to ...


6

A few pretty-printers were published in the 13th Pascal Newsletter in 1978. The machine-readable text of a version of the one by Hueras and Ledgard is available on the SAILDART archive. (Also on SAILDART is an unrelated formatter named PFORM, although it might be fairly specific to the weird variety of PDP-10 Pascal used at Stanford.) The source code of a ...


5

Pascal compilers/runtimes typically do some (very often, optionally, enabled by a flag) run-time type checking. A very typical run-time check supported by most Pascal compilers is array bounds checking, because it is the most common type-related mismatch error in Pascal programs and bounds of actually used array indices are very hard to check at compile time ...


5

The singular problem with Pascal in contrast to C was that C is a much more generic language than Pascal with a more flexible typing system. In Pascal, notably, I/O is a first class concept, with direct, and "special", support in the language. The original Pascal typing system wasn't flexible enough to handle outliers such the I/O system which need to ...


5

Because neither 0 nor false is a pointer. Pointers are pointers and not numeric values that can be used in directly in mathematical expressions. Assigning false to a pointer doesn't make any sense so Pascal assigns nil to it. Talking about "sense" there's a famous example in C++ where previously pointers were generally compared with the literal 0 or macro ...


4

Pascal for the Apple /// actually used the SOS file format and was compatible with files written by Business Basic. SOS was adapted into ProDOS for the Apple II-series machines, but Pascal /// was never ported to it to my knowledge. And, yes, it's a darn shame Pascal and the other UCSD languages FORTRAN, BASIC, and MODULA/2 couldn't run together.


4

There are excellent answers in this thread. The clearest answer is that nil cannot be a value because it has no type. Whereas true and false are understood to be values of enumerated, i.e., type boolean = (false, true); What type of pointer would nil be an instance of? Recall pointer definitions are: type p = ^integer; nil, if it is a value, is compatible ...


4

You should download and use CiderPress which is a Swiss Army Knife tool for Apple disk images - It understands and supports the UCSD Pascal file system format and should be able to transfer a file from one disk image to the other.


Only top voted, non community-wiki answers of a minimum length are eligible