Live data from Hacker News

Pascal at Apple

blog.fogus.me

61–70 of 145 posts

Re: Pascal at Apple

#61
I've started with Basic, some assembly (CALL-151) on my Apple ][ clone (Pravetz 8C), but as soon as I got my hands on IBM PC/XT (or AT) Turbo Pascal (the 30-40kb turbo.com) was just the right choice. It fit on one disk, there was plenty more, while a Microsoft C/C++ compiler and linker each took a whole separate disk.

The best thing I've loved were the .TPU files (but not sure whether TP4 or TP5 had them truly). There were no .h files to be included, or .lib (.a) to be added, it worked just magically well (with some limitations).

I've moved to C/C++ later simply because, well it's a stupid reason. I was writing a "File Manager" like app for DOS (just single column, not like Norton Commander, FAR or Midnight Commander), and the only function in Turbo Pascal 5.0 to move files was just renaming a file in the same folder... Had I known about inline assembly and be more brave, I would've stayed in Pascal Land (And I was already familiar with Ralph Brown's Interrupt List)... But hey, this stupid reason moved me to C/C++ as the builtin function there did it... then again, soon after that I've started using more and more inline assembly.

I love C/C++ now (especially C), and where I used to be really good at Pascal, I might have some hurdles reading pascal code today. Delphi was my last stop, and while I like it, I switched to video game development, and Pascal was not much used there (... Age Of Wonders I believe was written in some form of Pascal and possibly some other games,... Also part of Xoreax's IncrediBuild might've been, especially the part that does the C/C++ header processing, I think it was since we had issues with it, and while debugging found something pascal-ish in there, but don't remember now).

Re: Pascal at Apple

#62

I've been reading a lot about Niklaus Wirth recently. I read an interesting piece about Oberon I found in an HN archive[0] that mentions Oberon usage on Macs. I'm very tempted to buy "The School of Niklaus Wirth: The Art of Simplicity" after reading a few things about him. I wish there were more instances of "computing in a vacuum" like at ETH. [0]: https://news.ycombinator.com/item?id=10058486

I studied under Wirth at ETH Zurich in the 1980s, so I got to interact with him personally a number of times. His class on compiler construction was particularly interesting. You could see how a philosophy of simplicity and clarity in syntax and semantics would translate to simple and clear compilers.

The downside of this philosophy was that aspects of interacting with a computer that were inherently messy tended to be swept under the rug: The original "file" and "string" concepts as described in early Pascal reports were simply unworkable, and combined with a marked disinterest in language standardization efforts (which I personally suspect stems from Wirth's involvement in Algol 68, although I have no direct evidence) led to each implementation rigging up their own ad hoc solutions.

As a consequence, even TeX, a batch program with no fancy demands on hardware, was not written in strictly "standardized" Pascal, but basically Knuth had to assume the existence of a number of non-standard mechanisms.

Re: Pascal at Apple

#63
post #43

Earlier quoted context omitted.

I liked nested functions in Pascal, and put them in D. They turn out to be surprisingly useful: 1. Properly encapsulating their scope, as opposed to having static functions sit awkwardly somewhere else. 2. Factoring out common code within the function. 3. A lot of my need for goto statements vanished with nested functions. 4. Take the address of a nested function, and it serves as a lambda. 5. No need to create "Cont…

Off-topic, but nested functions are one of my favorite gcc extensions.

I discovered with C and C++ compilers, if an extension was added that was not in the Standard, nobody would use it - not even the people who requested the extension. It wasn't like the Pascal community, where nobody would use the compiler unless it had a boatload of extensions :-)

Re: Pascal at Apple

#64
post #50

Earlier quoted context omitted.

Oh lordy, I'd forgotten the array index thing. That was painful.

The Low and High compiler intrinsics make array indexes easy to deal with. You don't need to care about the indexing to iterate over the array. You just go from Low(array) to High(array): http://docwiki.embarcadero.com/Libraries/Berlin/en/System.Lo...

I don't remember if Apple Pascal had those intrinsics or not. But I never saw any code that used them, and I read most of the Pascal code base for MPW and a bunch for the OS.

Re: Pascal at Apple

#65
post #60

I wrote a fair amount of Pascal in my 680x0 Mac days, both in MPW (the Macintosh Programmer's Workshop) and THINK Pascal. Back then Modula-2 was available on VAXen and "big" machines, but Pascal was almost "portable" across Mac/PC/VAXen and was amazingly fast, so it was pretty fun. I eventually moved to C (also using THINK C - see retrospective link below for a sample of those heady times) and never looked back until…

I have used Modula 2 on my Apple II. It ran under the UCSD-p machine system.

Re: Pascal at Apple

#66
post #60

I wrote a fair amount of Pascal in my 680x0 Mac days, both in MPW (the Macintosh Programmer's Workshop) and THINK Pascal. Back then Modula-2 was available on VAXen and "big" machines, but Pascal was almost "portable" across Mac/PC/VAXen and was amazingly fast, so it was pretty fun. I eventually moved to C (also using THINK C - see retrospective link below for a sample of those heady times) and never looked back until…

Lazarus: definitely cool

Re: Pascal at Apple

#67
post #60

I wrote a fair amount of Pascal in my 680x0 Mac days, both in MPW (the Macintosh Programmer's Workshop) and THINK Pascal. Back then Modula-2 was available on VAXen and "big" machines, but Pascal was almost "portable" across Mac/PC/VAXen and was amazingly fast, so it was pretty fun. I eventually moved to C (also using THINK C - see retrospective link below for a sample of those heady times) and never looked back until…

I don't know anything like Lazarus, but I do know a language that shares many of the characteristics of Pascal (small, fast, native binaries). That language is Nim and I think there is a good chance we could get something like Lazarus out of it.

Re: Pascal at Apple

#68
post #60

I wrote a fair amount of Pascal in my 680x0 Mac days, both in MPW (the Macintosh Programmer's Workshop) and THINK Pascal. Back then Modula-2 was available on VAXen and "big" machines, but Pascal was almost "portable" across Mac/PC/VAXen and was amazingly fast, so it was pretty fun. I eventually moved to C (also using THINK C - see retrospective link below for a sample of those heady times) and never looked back until…

Lazarus looks interesting, but what holds me back is that the language doesn't seem to have evolved. I enjoy functional languages much more these days, and I prefer not to go back to an old language. I would be happy to be proven wrong on this

Re: Pascal at Apple

#69
post #10

I joined Apple in 1987, about the time they started ditching Pascal in favor of C. C++ (in the form of CFront) was just starting to be a thing. Apple's Pascal had been extended to the point where there were few true differences between it and C, other than - strings with busted semantics (size being part of the type being a huge mistake, leading to a proliferation of types like Str255, Str32, Str31, Str64, etc). I sh…

I liked nested functions in Pascal, and put them in D. They turn out to be surprisingly useful: 1. Properly encapsulating their scope, as opposed to having static functions sit awkwardly somewhere else. 2. Factoring out common code within the function. 3. A lot of my need for goto statements vanished with nested functions. 4. Take the address of a nested function, and it serves as a lambda. 5. No need to create "Cont…

> nested functions in Pascal and D

Or just have first class functions, and prototype based inheritance. Way more flexible and powerful than class based inheritance. See JavaScript 5 as an example, ask Crockford.

Re: Pascal at Apple

#70
post #2

I really miss Pascal; it was a great and safe language for beginners. As it was extended with Objects and Modules, it was great for development. But there are good reasons it was surpassed by C. In early Pascal, you got a pointer by allocating memory; you could not get a pointer to an existing variable. You'd be surprised how often that gets in the way when implementing a data structure. Just try to implement the fol…

I don't understand the extreme focus on brevity, though it does seem to be mentioned regularly. In practice I don't notice a difference between "begin" and "{". It's not something I have to think about, and my typing speed exceeds the speed at which I'm able to determine what to type next.

I understand avoiding excessive amounts of large boiler plate where standard patterns are constantly repeated for no particular reason, but that's not a comparable situation to individual keywords.

Post reply on HN