Recent

Author Topic: Pascal origin, where does it come from  (Read 20540 times)

440bx

  • Hero Member
  • *****
  • Posts: 3921
Re: Pascal origin, where does it come from
« Reply #30 on: August 12, 2020, 02:57:01 am »
This is just out of curiosity, anyway. I wonder how Object Pascal, Modula or Ada would look if they where designed in, say, 2015, from scratch.
That's an interesting thought.  My guess is that it would probably depend on what the language designer(s) consider(s) important in the language.

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Pascal origin, where does it come from
« Reply #31 on: August 12, 2020, 09:50:34 am »
To whom it may concern:

Revised Report On The Algoritmic Language Algol 60

by J.W.  Backus et al
Edited by Peter Naur

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjrt86Th5TrAhXbi1wKHatEB7EQFjAFegQIBBAB&url=http%3A%2F%2Fwww.eah-jena.de%2F~kleine%2Fhistory%2Flanguages%2FAlgol60-RevisedReport.pdf&usg=AOvVaw2PMyMl4we82-BWrLJFMi5Z

:= ruled already then!

Winni

Thanks for that. I can certainly see that they've used it as a de-facto equivalent, but skimming the paper I can't see it defined as a digraph etc. My experience- although I'm entirely happy to be proven wrong- is that computers of the ALGOL-60 era very often had caps-only 64-codepoint character sets with arrows (and inequalities etc.) available, and that manufacturers had their own list of equivalents to allow the industry-standard IBM cardpunches to be used.

Interestingly, I got into a slight amount of trouble elsewhere for making the assumption that because a program fragment contained odd characters it had to be bogus. It turned out not to be: the early EDSAC computer apparently had ⊖ in its terminals' character set, and the publisher and printer had reproduced the Illustrious Author's manuscript accurately :-)

https://scifi.stackexchange.com/questions/233847/first-fictional-programming-language-in-sci-fi-or-fantasy/233942#233942

MarkMLl
« Last Edit: August 12, 2020, 10:29:12 am by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Pascal origin, where does it come from
« Reply #32 on: August 12, 2020, 10:21:02 am »
I'll see if I can track it down but I don't hold out very much hope.
It is not of much importance and was just my curiosity, so no need to put much effort in it. I thought you could remember out of your head, so never mind.
What I can say is that it was reprinted in .Exe in the late 90s. I suppose I could drop Verity a line to try to get a reference, but I've got... rather a lot of odd stuff going on in life and could do with it not getting odder :-)
 
Quote
... he criticises ALGOL's dangling-else, without mentioning that it was fixed in ALGOL-68 but still present in his (slightly later) Pascal.
In his self critique of GOTO he also regrets not fixing dangling else in Pascal:
Quote
The designer of Pascal retained the goto statement (as well as the if statement without closing end symbol). Apparently he lacked the courage to break with convention and made wrong concessions to traditionalists. But that was in 1968. By now, almost everybody has understood the problem, but apparently not the designers of the latest commercial programming languages, such as C#.

Except that for the problem to be fixed in ALGOL-68 it must have been known several years earlier. I can sympathise with Wirth not fixing it in ALGOL-W, but since he intentionally broke ALGOL's syntax to get to Pascal he really has very little excuse (unless, of course, his earliest Pascal implementations still used recursive ascent, some of his earlier compilers look like right bitches to maintain and modify).

Quote
He talks about := being ALGOL's assignment, which is wrong (it used a left arrow).
Are you sure? Wikipedia is not always right but it quotes use of := in this ALGOL 60 code example:
https://en.wikipedia.org/wiki/ALGOL#ALGOL_60

Somebody else has contributed a link that demonstrates that e.g. := as an alternative to an arrow was known to the standard-setters early on. My understanding had been that it was a later occurrence, because of the necessity of being compatible with IBM card punches and (later) Teletypes. Of course, we've still got ¬ on UK keyboards :-)

Quote
It is worthwhile to note that along with the OOP paradigm came an entirely new terminology with the purpose of mystifying the roots of OOP. Thus, whereas you used to be able to activate a procedure by calling it, one now sends a message to the method. A new type is no longer built by extending a given type, but by defining a subclass which inherits its superclass.
This is so true. I remember my early OOP days when I didn't have problems in embracing methodology, but have been struggling with terminology.

That might actually throw useful light on the bigger picture. Let's assume for a moment that the difference between "calling a procedure with parameters" and "sending a message to a method" is that methods are late-bound and polymorphic. Let's also assume that when Wirth claimed (according to my recollection) that classes/objects contributed nothing that couldn't be done with records, that he was overlooking (intentionally or otherwise) late binding and polymorphism.

I'd suggest that uncertainty as to /which/ procedure/method is to be called and uncertainty as to exactly how parameters will be promoted to alternate types to suit the implemented procedures are major language problems, and ones that- certainly in the Modula-2 era- Wirth did not want to grapple with. I certainly consider excessive polymorphism and automatic promotion to be a problem, perhaps there needs to be a pragma or linguistic "hint" indicating whether or not "useful idiocies" of that nature should be applied (again, I think that Modula-3 was more open to that sort of solution than any of Wirth's own languages).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Blade

  • Full Member
  • ***
  • Posts: 177
Re: Pascal origin, where does it come from
« Reply #33 on: August 13, 2020, 02:40:28 am »
It is worthwhile to note that along with the OOP paradigm came an entirely new terminology with the purpose of mystifying the roots of OOP. Thus, whereas you used to be able to activate a procedure by calling it, one now sends a message to the method. A new type is no longer built by extending a given type, but by defining a subclass which inherits its superclass.
This is so true. I remember my early OOP days when I didn't have problems in embracing methodology, but have been struggling with terminology.

That might actually throw useful light on the bigger picture. Let's assume for a moment that the difference between "calling a procedure with parameters" and "sending a message to a method" is that methods are late-bound and polymorphic. Let's also assume that when Wirth claimed (according to my recollection) that classes/objects contributed nothing that couldn't be done with records, that he was overlooking (intentionally or otherwise) late binding and polymorphism.

I'd suggest that uncertainty as to /which/ procedure/method is to be called and uncertainty as to exactly how parameters will be promoted to alternate types to suit the implemented procedures are major language problems, and ones that- certainly in the Modula-2 era- Wirth did not want to grapple with. I certainly consider excessive polymorphism and automatic promotion to be a problem, perhaps there needs to be a pragma or linguistic "hint" indicating whether or not "useful idiocies" of that nature should be applied (again, I think that Modula-3 was more open to that sort of solution than any of Wirth's own languages).

I strongly believe that Wirth knew exactly what he was talking about, in reference to OOP.  When he was asked to consult on the creation of Clascal (which became Object Pascal) with Larry Tesler in 1985, he was dealing with a former employee of Alan Kay (who personally hired him) and one of the designers of Smalltalk, which some might say is true OO.  And Alan Kay has not been shy about voicing his opinions.  Wirth is also a Turing award winner.  So not only that and his front row seat to the creation of Object Pascal, but having many years since then to reflect on it (and see it evolve) before the 1997 interview I linked to.  Polymorphism is not owned by OOP, nor even overloading (which advanced records can do).  Among other things, there is also usage of default/optional parameters, which I have seen referred to jokingly as sloppy polymorphism.  Based on various quotes from Wirth, it seems he was thinking more along the lines of project size, kind of problem, and various simpler or different ways one can go about solving problems versus being forced or "religiously" locked into a paradigm. 

The beauty of Object Pascal as a hybrid language, is people have more freedom and options to decide the way they want to go about things.  It appears that Modual-3, Oberon-2, and Component Pascal have had to follow in the footsteps of Object Pascal, in terms of embracing being a hybrid.  I don't think this is a knock on Wirth, but possibly more a reflection of expectations and/or an added selling point, that a language include OOP.
« Last Edit: August 13, 2020, 07:13:14 am by Blade »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: Pascal origin, where does it come from
« Reply #34 on: August 13, 2020, 02:17:17 pm »
I think we should add Component Pascal into the mix, which is a superset of Oberon-2.  Part of the issue is that with the various Object Pascal flavors (including Delphi) being so prominent and also evolving/updating, I think the other Wirthian languages can't get traction.

I don't think that. I simply think those languages and their tooling never were complete enough to really be attractive. (Some commercial Modula2's excepted maybe).

I originally migrated back to Pascal because I was translating Turbo Pascal code half of the time anyway, to get decent examples of how to do something, and I was really frustrated with the overly laborious string handling in Modula2.

At the same time, the Modula2 newsgroup seemed mostly filled with language enthusiasts and the then emerging "standard", something that didn't help *users*  very much.

hansotten

  • Jr. Member
  • **
  • Posts: 88
Re: Pascal origin, where does it come from
« Reply #35 on: August 14, 2020, 12:12:21 pm »
As we are going down memory lane and doing origins.  The Lisa Pascal Reference Manual, for which Clascal (later Object Pascal) is based on, is itself based on and references the Pascal User Manual and Report (the basis of the ISO standard), created by Kathleen Jensen and Niklaus Wirth.  Presented as viewable PDF.

Pascal User Manual and Report

Thanks for the link!  Book added, it is an important part of the ISO Pascal information.
« Last Edit: August 14, 2020, 01:03:48 pm by hansotten »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Pascal origin, where does it come from
« Reply #36 on: August 14, 2020, 12:52:47 pm »
Hans, do you have this link https://www.research-collection.ethz.ch/handle/20.500.11850/68669 from Wp? I believe that it describes the original Modula, i.e. pre-2, and if I'm correct it's significant in that it indicates at what point the dangling-else problem was fixed.

Also, if you've not got it, https://github.com/retro-software/B5500-software and possibly https://github.com/pkimpel/retro-b5500 might interest. I've not investigated whether the copy of Euler there is actually compilable/runnable, and the mapping from the 64-codepoint character set to 7-bit ASCII can be a bit weird.

I think you've got links to all his Stanford stuff, but http://www.ianjoyner.name/Files/Waychoff.pdf suggests some of the politics behind the university's (and SRI/SLAC etc.) choice of computers... and don't forget Pastel.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

hansotten

  • Jr. Member
  • **
  • Posts: 88
Re: Pascal origin, where does it come from
« Reply #37 on: August 14, 2020, 01:15:18 pm »
Hans, do you have this link https://www.research-collection.ethz.ch/handle/20.500.11850/68669 from Wp? I believe that it describes the original Modula, i.e. pre-2, and if I'm correct it's significant in that it indicates at what point the dangling-else problem was fixed.

Also, if you've not got it, https://github.com/retro-software/B5500-software and possibly https://github.com/pkimpel/retro-b5500 might interest. I've not investigated whether the copy of Euler there is actually compilable/runnable, and the mapping from the 64-codepoint character set to 7-bit ASCII can be a bit weird.

I think you've got links to all his Stanford stuff, but http://www.ianjoyner.name/Files/Waychoff.pdf suggests some of the politics behind the university's (and SRI/SLAC etc.) choice of computers... and don't forget Pastel.

MarkMLl

Thank you for the links! Yes, the collection is still a bit mostly early Pascal. Modula requires more attention.

dtoffe

  • Jr. Member
  • **
  • Posts: 55
Re: Pascal origin, where does it come from
« Reply #38 on: August 14, 2020, 08:13:25 pm »
Hans, do you have this link https://www.research-collection.ethz.ch/handle/20.500.11850/68669 from Wp? I believe that it describes the original Modula, i.e. pre-2, and if I'm correct it's significant in that it indicates at what point the dangling-else problem was fixed.

MarkMLl

    Thanks for this link, 240 documents by Niklaus Wirth, it's a treasure !!!  In this one:

https://www.research-collection.ethz.ch/handle/20.500.11850/68705

    he talks about the object oriented programming fad and how Modula 2 can be extended to achieve the same features, and how he did that in Oberon (this paper is from '89, the first Oberon was from '83). Very enlightening. Well, to me at least, I guess most people around here are aware of this.

Daniel

Blade

  • Full Member
  • ***
  • Posts: 177
Re: Pascal origin, where does it come from
« Reply #39 on: August 15, 2020, 01:24:12 am »
https://www.research-collection.ethz.ch/handle/20.500.11850/68705

he talks about the object oriented programming fad and how Modula 2 can be extended to achieve the same features, and how he did that in Oberon (this paper is from '89, the first Oberon was from '83). Very enlightening. Well, to me at least, I guess most people around here are aware of this.

Agree, this is a very good find, when it comes to Wirth's thoughts on OOP and his other creations (Modula and Oberon).  Here he is making it very clear and breaking down what is OOP, then showing what his approach is about.

440bx

  • Hero Member
  • *****
  • Posts: 3921
Re: Pascal origin, where does it come from
« Reply #40 on: August 24, 2020, 03:38:34 pm »
Here he is making it very clear and breaking down what is OOP, then showing what his approach is about.
And more importantly, he made it quite clear that OOP isn't the panacea (magic bullet that makes all programs better) it has been painted as.

Quote
... we believe the use of object oriented programming should be employed selectively only where appropriate.  In the design of an entire operating system, we found that almost the whole system was advantageously programmed in the conventional style, the object-oriented style being restricted to the viewer system which provides distributed control.
(emphasis mine) That's a far cry from what is happening these days.  Just about everything under the sun is being turned into a class/object.

Ignore my comments but, don't ignore those of N. Wirth.  He knows a "little bit" about programming.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Pascal origin, where does it come from
« Reply #41 on: August 25, 2020, 09:53:13 am »
Ignore my comments but, don't ignore those of N. Wirth.  He knows a "little bit" about programming.

I agree, provided that he's not blinkered by "what he's thought of" and "what he can graft onto existing projects" traps.

I can't help but feel that that paper has a number of flaws, one of the most serious of which is that Wirth glosses over any consideration of the distinction between method references which are unambiguously resolved at compilation time, and those that- due to polymorphism etc.- cannot be resolved until runtime. Because of this, he appears to condemn the use of objects to represent short-lived transient data, where the create/manipulate/destroy cycle can be particularly useful: provided that each message is not burdened with excessive references to VMTs etc.

I certainly agree that any technique can be overused, and I am regularly dismayed when I see a description of some new technique boast of "only" a 5% inefficiency relative to its predecessor, which in turn had "only" and 5% inefficiency relative to its predecessor...

I'd suggest that the real problem is poor documentation, and poor discipline amongst programmers implementing facilities from poor definitions. And having such a vital part of modern software being implemented by volunteers who can be expected to keep doing it only as long as they are having fun is perhaps the biggest problem of our time, dwarfing the "software crisis" of the late 60s and early 70s.

-----

I would crave indulgence for a moment whilst I recount a bit of history, or at least my perception of it. It is common knowledge that Wirth spent at least one sabbatical at Xerox PARC, during which he learnt about the mouse, GUIs, the possibility of building a comparatively simple microprogrammed CPU and so on.

What isn't generally known is the extent to which Logitech- who at the time were a Swiss company- either acted as Wirth's commercial vehicle, or watched what he was doing and got their inspiration from the same sources. Those few who remember them as a compiler supplier (and at one time I was their de-facto British technical support) obviously know about their initial DOS/embedded products and their later (and not entirely successful) foray into supporting OS/2. They also had a well-regarded debugger called Multiscope which I think was spun off when they morphed into a mouse manufacturer.

At one point Logitech had something which I think they called their Mouse Programmer's Toolkit, and in it there was example code (in Modula-2) which had a complete message loop handler unifying keyboard and mouse input. I can't remember whether this had hooks for GUI or TUI support, but it was pretty damned unusual stuff to find as source in the mid-80s.

Which takes us back to a possible assumption by Wirth that the /only/ way to program an OO system was by using explicit messages, with all dispatching to appropriate handlers done at runtime, and no optimisation by the compiler which could make unambiguous references every bit as efficient as straight procedural programming. Or possibly only lose 5% or so in relative efficiency :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Pascal origin, where does it come from
« Reply #42 on: September 28, 2020, 11:53:16 pm »

At one point Logitech had something which I think they called their Mouse Programmer's Toolkit, and in it there was example code (in Modula-2) which had a complete message loop handler unifying keyboard and mouse input. I can't remember whether this had hooks for GUI or TUI support, but it was pretty damned unusual stuff to find as source in the mid-80s.

MarkMLl

Hi!

The Logitech Modula toolkit was cool. I learned a lot from it.

The manual can be found here:

https://archive.org/details/bitsavers_logitechLoersToolkitNov86_1580854

Winni

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Pascal origin, where does it come from
« Reply #43 on: September 29, 2020, 12:03:29 pm »
Hans, do you have this link https://www.research-collection.ethz.ch/handle/20.500.11850/68669 from Wp? I believe that it describes the original Modula, i.e. pre-2, and if I'm correct it's significant in that it indicates at what point the dangling-else problem was fixed.

MarkMLl
Thanks for this link, 240 documents by Niklaus Wirth, it's a treasure !!!  In this one:

https://www.research-collection.ethz.ch/handle/20.500.11850/68705

he talks about the object oriented programming fad and how Modula 2 can be extended to achieve the same features, and how he did that in Oberon (this paper is from '89, the first Oberon was from '83). Very enlightening. Well, to me at least, I guess most people around here are aware of this.

Daniel
That leads us to three questions:
1. Why Niklaus Wirth moved on from Pascal to Modula, and then to Oberon?
2. Is there any current worth mentioning professional software built with Modula or Oberon?
3. Is Modula or Oberon any better than modern Pascal?

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Pascal origin, where does it come from
« Reply #44 on: September 29, 2020, 12:33:35 pm »
That leads us to three questions:
1. Why Niklaus Wirth moved on from Pascal to Modula, and then to Oberon?
2. Is there any current worth mentioning professional software built with Modula or Oberon?
3. Is Modula or Oberon any better than modern Pascal?

My understanding:

1) Separate compilation (in particular separate precompiled definition modules), remove "magic" required for things like WriteLn() from the language, coroutines, and better-defined type checking. Strings implemented as zero-based arrays of char might or might not have been an advance, bitsets were an advance but ordering was platform-specific without adequate infrastructure.

2) Not that I know of.

3) Fixes dangling-else. Arguably provides a more robust base language on which extensions could be built, but ideally this would require an extensible language definition accessible to (senior) application programmers.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018