Live data from Hacker News

Pascal at Apple

blog.fogus.me

31–40 of 145 posts

Re: Pascal at Apple

#31
post #27
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…

Intro to computer science freshman year of high school in 2004 was still using turbo pascal and it was great. Dropping into BGI graphics mode was a great beginner friendly way to draw shapes and make some cool things. It's what got me into game development in earnest. I wish I could get this same setup to teach people with but BGI doesn't work in later versions of Windows.

I think BGI graphics will still work in DOSBox. I remember having a setup a couple of years ago where I shared a directory between Windows and DOSBox. I'd edit the code in Windows using Sublime Text, and then pop in to DOSBox to build/run it.

So although it doesn't quite make BGI graphics based apps run directly on Windows...it's still quick and easy enough to have some fun. I did it specifically to give myself a way to make programming fun again at a time when I was feeling a bit burned out from working on massive, overly complex C# and JavaScript code all day at the office.

Re: Pascal at Apple

#32
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…

Speaking of few differences from C and busted string semantics: my least favorite thing about Pascal is that strings and some types are 1-indexed, but dynamic arrays are 0-indexed.

https://stackoverflow.com/questions/4083356/array-begin-from...

Re: Pascal at Apple

#33
In order to run Apple Pascal on my Apple ][+, I had to buy a "language card". This was bigger than an index card (maybe 3 by 6 inches) and added sixteen whole kilobytes to your computer's RAM, beefing it up to a massive 64K and rendering it capable of running such a system hog as Apple Pascal. I think it was about a hundred bucks in the early 1980s.

Meanwhile, the Apple ][+ could only display 40 columns on screen, where of course by "screen" I mean "television". (You could buy another big card to give you enough memory to display 80 columns at a time, but who had the cash to make another huge purchase like that?). Of course, 40 columns isn't enough to write in a structured programming language with indentation like Pascal, and in fact the Pascal program itself supported logical lines of up to 80 characters.

This issue was resolved as brilliantly as you might expect. You could toggle between looking at the left half of your program (cut off at the 40-character mark) or the right half. I'm not kidding.

Re: Pascal at Apple

#34

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've got that book, it is interesting to read. I also spent quite a bit of time looking at the Oberon system and that has been very educational. Oberon is quite like Pascal, but in some ways simplified even more. He wrote a complete operating system and user interface in Oberon and it is just amazing how much he achieved with very few lines of code.

I'm currently attempting to write a C compiler and the complexity is incredible compared to Oberon or Pascal. Sometimes I regret choosing C over Pascal as I'd probably be done now with the compiler, as it is I've only got the parser and preprocessor implemented.

Eiffel is another language that didn't gain a lot of popularity but is very interesting to read about. Bertrand Meyer, the creator of Eiffel is now at ETH Zurich, where Wirth spent most of his career. It's a very nice language that didn't achieve a lot of popularity, but some of the ideas, such as preconditions and postconditions, have been used in other systems.

Re: Pascal at Apple

#35

It may seem quaint now, but Apple Pascal was a serious tool. I took AP Computer Science in 1985 and the language taught was UCSD Pascal on the Apple ][+. (In the 80's, C on an Apple ][ was impossible. The only C compiler you could get was for a card that went in the expansion slot that included a Z80 processor.) When I went to college in 1986, Pascal was the primary language used in all entry-level courses at Virgini…

A major issue was that C compilers were actually fairly ill-suited for 8-bit processors with limited memory, limited processing power, and at most a floppy disk (if that) for external storage.

Pascal was designed to allow single pass compilation of programs, while the C preprocessor alone was a source of what was immense overhead at that time. On CP/M, Turbo Pascal blew all C compilers out of the water in terms of compilation speed. The one C compiler I had on a ZX Spectrum at the time did not actually implement the full language so that you'd have some memory left over (I remember that the C type cast syntax was replaced with a keyword in order to simplify the parser, for example).

That said, UCSD-Pascal on an Apple II (which we got to use in school as part of our regular computer science course), was not all that convincing as an implementation (even if the system as a whole was fairly impressive). Because it used a bytecode interpreter (even if that bytecode interpreter leveraged type information and was much faster than a bytecode interpreter for a dynamically typed language), execution speed – including that of the development environment, which was written in UCSD-Pascal itself – was still pretty sluggish in comparison to an actually compiled language. (The UCSD p-code in principle also allowed compilation to native code, but at least the system I had access to – that was in the early 80s – didn't support that.) But it was still more pleasant than many other compilers, and that was at a time when cassette recorders were often still the primary external storage medium, so people were more tolerant, when their point of comparison was systems that literally included source code from cassette tape at compile time, because for large programs you couldn't fit both the source code and the object code into memory at the same time.

Re: Pascal at Apple

#37
post #30

It may seem quaint now, but Apple Pascal was a serious tool. I took AP Computer Science in 1985 and the language taught was UCSD Pascal on the Apple ][+. (In the 80's, C on an Apple ][ was impossible. The only C compiler you could get was for a card that went in the expansion slot that included a Z80 processor.) When I went to college in 1986, Pascal was the primary language used in all entry-level courses at Virgini…

Is Clascal the language you're thinking of?: https://en.wikipedia.org/wiki/Clascal

Yes! That's it. MPW was also (contemporaneously) great for Pascal.

Re: Pascal at Apple

#38
post #33

In order to run Apple Pascal on my Apple ][+, I had to buy a "language card". This was bigger than an index card (maybe 3 by 6 inches) and added sixteen whole kilobytes to your computer's RAM, beefing it up to a massive 64K and rendering it capable of running such a system hog as Apple Pascal. I think it was about a hundred bucks in the early 1980s. Meanwhile, the Apple ][+ could only display 40 columns on screen, wh…

Oh, I remember, although in my mind's eye, the 16K expansion card was bigger, about as big as a graphics card of today.

Re: Pascal at Apple

#39

I'm reminded of a really great interview with Bill Atkinson where he describes (among many other things) how he initially brought Pascal to Apple and the Apple II. https://youtu.be/6tUWoy1tJkE?t=45m The Pascal bits are from 45:00 to about 50:00. ... My manager at the time said, no, we don't want to do this [Pascal], people are happy with what they got. I overrode him and went to Jobs, and Jobs said "Well, I'm not con…

Didn't know about Triangulation, thank you.

When will someone build HN for Audio/Video.

Re: Pascal at Apple

#40
post #32
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…

Speaking of few differences from C and busted string semantics: my least favorite thing about Pascal is that strings and some types are 1-indexed, but dynamic arrays are 0-indexed. https://stackoverflow.com/questions/4083356/array-begin-from...

And the string length is in the 0 byte, meaning no strings longer than 255 bytes. At least in old Turbo Pascal anyway!
Post reply on HN