Recent

Author Topic: John Carmack talks about Pascal  (Read 1607 times)

madel

  • New Member
  • *
  • Posts: 19
John Carmack talks about Pascal
« on: August 18, 2022, 10:25:52 pm »
In his interview with Lex Fridman:

"... the world might have been better if it had gone Pascal's route..."

Thoughts?

(Talk about Pascal starts at 1:36:30)

https://youtu.be/I845O57ZSy4?t=5791

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: John Carmack talks about Pascal
« Reply #1 on: August 18, 2022, 10:58:16 pm »
Yes, Pascal at the time of C/C++ beginning,  could also be improved to the state of C++, could be made the same by CPU code fastness, by optimizations. If corporations invested into its compiler. But they did not want it. Maybe because USA corporations did not like the work of German/Swiss scientist, you know - War phobia to all Germans, to German culture, to ideas, to people. Even today in 2022 year, I often see 'bad German guys' in USA films. Even in LucasArts game 'The Dig', main bad guy is German/USA cosmonaut.
« Last Edit: August 18, 2022, 11:05:03 pm by AlexTP »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: John Carmack talks about Pascal
« Reply #2 on: August 18, 2022, 11:48:32 pm »
Maybe because USA corporations did not like the work of German/Swiss scientist,

Don't be so bloody daft: most of his work was done at Stanford.

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

VisualLab

  • Sr. Member
  • ****
  • Posts: 290
Re: John Carmack talks about Pascal
« Reply #3 on: August 18, 2022, 11:55:44 pm »
Quote
Yes, Pascal at the time of C/C++ beginning,  could also be improved to the state of C++, could be made the same by CPU code fastness, by optimizations. If corporations invested into its compiler. But they did not want it.

I totally agree on the Pascal tools improvements (compiler, etc).

Quote
Maybe because USA corporations did not like the work of German/Swiss scientist, you know - War phobia to all Germans, to German culture, to ideas, to people. Even today in 2022 year, I often see 'bad German guys' in USA films. Even in LucasArts game 'The Dig', main bad guy is German/USA cosmonaut.

However, on the issue of "eradicating" the Pascal language by US corporations, I would say that it is rather speculation. It seems to me that the main role was (as always) played by money. The (considerable) investment in their own solutions must have resulted in spreading propaganda that their programming language (tools - compiler, etc.) is the best. After all, the management of a corporation does not give money for some technical solutions, just to experiment, it just wants profits. Another thing is that many such investments have gone down the drain. Despite large investments, various projects did not work out (eg Multics, Taligent) or there was too little interest from potential clients. If you look at other technical fields (electronics, automotive, etc.), you could probably find such examples there too.

Besides, not only corporations are like that. The people (leaders) involved in open source projects are exactly the same. Just look at the myth of the best operating system: Unix. It used to be a product of a bad corporation (Bell Labs, then AT&T). But he was hailed the best OS fairly quickly. In fact, it has been a technological dinosaur for many years. This bogus "halo" went from Unix to Linux. And yet Linux is a technological crap. But corporations use it because they bear relatively little development costs. Because it is more convenient for them. And it is with this solution that the popularity of the C language is connected. Of course, there were attempts to use Pascal, but there was not enough determination and interest (I think DEC). Generally, in the IT technology clash of US companies at that time, European companies had no chance. US companies had more money and tremendous support from the government. Anyway, this is still the case today. For the president and the investing people (shareholding), the only thing that matters is whether there are prospects for profits from the solution developed by the company.
« Last Edit: August 18, 2022, 11:58:30 pm by VisualLab »

440bx

  • Hero Member
  • *****
  • Posts: 3946
Re: John Carmack talks about Pascal
« Reply #4 on: August 19, 2022, 01:26:09 am »
"... the world might have been better if it had gone Pascal's route..."
The world is going the Pascal way, albeit very slowly (and in a very contorted way.)  By that I mean including strong type checking.  This can be seen in ANSI C and in C++.

There is still a _long_, very long way to go.  Unfortunately, it is quite apparent that as far as syntax goes, the world isn't going the Pascal way. Instead it is going backwards (at a rapid pace in that area.)

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

madel

  • New Member
  • *
  • Posts: 19
Re: John Carmack talks about Pascal
« Reply #5 on: August 19, 2022, 01:37:02 am »
There is still a _long_, very long way to go.  Unfortunately, it is quite apparent that as far as syntax goes, the world isn't going the Pascal way. Instead it is going backwards (at a rapid pace in that area.)

Why do you think the Pascal syntax is the way "forward" way - the better way and everything else that isn't copying Pascal is going backwards?
To me, syntax is a personal thing.

440bx

  • Hero Member
  • *****
  • Posts: 3946
Re: John Carmack talks about Pascal
« Reply #6 on: August 19, 2022, 02:44:04 am »
Why do you think the Pascal syntax is the way "forward" way - the better way and everything else that isn't copying Pascal is going backwards?
To me, syntax is a personal thing.
Because a compiler isn't just a program that generates executable code.  A good compiler, in addition to generate reasonably decent executable code,  should flag programming mistakes and, one of the characteristics of Pascal that helps a programmer find coding mistakes is its strong type checking. 

The same thing is true of syntax.  Poor syntax design, the C language being a great example of a language with extremely poor syntax design, prevents the compiler from flagging obvious errors such as those caused by using "=" instead of "==" or "|" instead of "||" or ">" instead of ">>" and many other similar cases where a simple typo causes a program not to work properly and the compiler is unable to detect the incorrect use of a syntactic construction.
(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: 6676
Re: John Carmack talks about Pascal
« Reply #7 on: August 19, 2022, 09:23:17 am »
Linux user here.

And yet Linux is a technological crap. But corporations use it because they bear relatively little development costs. Because it is more convenient for them. And it is with this solution that the popularity of the C language is connected.

I agree, and TBH the same applies to the POSIX programming model.

Leaving aside the structural deficiencies caused by Linux's monolithic structure, there are too many recent developments which have been shoehorned into it: event monitoring, devices that don't fit either the block or character models and so on.

/But/ like IP networking and HTML layout, Linux is accessible and if you don't understand an API you can, ultimately, dive in and consult the source.

And of course, the really important thing is that no project to replace it with a sane family of APIs has been successful: every attempt has led to something with mainframe-level complexity and no easy access route for the beginners we all are.

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: 6676
Re: John Carmack talks about Pascal
« Reply #8 on: August 19, 2022, 09:47:58 am »
Why do you think the Pascal syntax is the way "forward" way - the better way and everything else that isn't copying Pascal is going backwards?
To me, syntax is a personal thing.

Syntax is not a personal thing, in the same way that approximately-correct usage of English is not a personal thing. There can be multiple ways of doing or saying things- multiple idioms- but there still has to be an agreed structure.

Syntax and semantics are the public definition of a computer language, in the same way that they're the public definition of a spoken language.

If your definition is sloppy or admits ambiguity, your language isn't fit for purpose.

So I'd suggest that while we are not going to see the World suddenly start using Pascal for all new software, that Pascal and Mosula-2 have been enormously influential and that- in particular- languages from the C family have retroactively adopted a lot of their features.

Because a compiler isn't just a program that generates executable code.  A good compiler, in addition to generate reasonably decent executable code,  should flag programming mistakes and, one of the characteristics of Pascal that helps a programmer find coding mistakes is its strong type checking. 

The same thing is true of syntax.  Poor syntax design, the C language being a great example of a language with extremely poor syntax design, prevents the compiler from flagging obvious errors such as those caused by using "=" instead of "==" or "|" instead of "||" or ">" instead of ">>" and many other similar cases where a simple typo causes a program not to work properly and the compiler is unable to detect the incorrect use of a syntactic construction.

Agreed, with one caveat: I'm not sure whether | vs || etc. is a syntax issue, or a semantic issue related to how strictly typing is enforced and the existence of multiple assignment (i.e. a = b = c;).

boolean_variable = boolean_variable... could at a glance be interpreted as either an assignment or a comparison, the real problem is that the availability of multiple assignment makes if (boolean_variable = boolean_variable) {... valid.

Multiple assignment was an ALGOL thing so you can't blame C for it, but if it were removed the language would be the better for it.

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

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: John Carmack talks about Pascal
« Reply #9 on: August 19, 2022, 11:06:51 pm »
Multiple assignment was an ALGOL thing so you can't blame C for it, but if it were removed the language would be the better for it.
They could've gone the Lua way if they thought about it for a while. Assignments in Lua is a statement, yet they allow multiple assignment this way:
Code: Lua  [Select][+][-]
  1. var1,var2,var3 = val1,val2,val3
  2.  
Of course this complicates things when the vals and vars are interdependent somehow, so yeah I agree if it's totally eliminated instead.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: John Carmack talks about Pascal
« Reply #10 on: August 20, 2022, 09:09:15 am »
They could've gone the Lua way if they thought about it for a while. Assignments in Lua is a statement, yet they allow multiple assignment this way:
Code: Lua  [Select][+][-]
  1. var1,var2,var3 = val1,val2,val3
  2.  
Of course this complicates things when the vals and vars are interdependent somehow, so yeah I agree if it's totally eliminated instead.

There's any number of ways it could be done with some sort of list notation, but C's problems are deeper than that:

Code: C  [Select][+][-]
  1. if (boolean_variable = integer_variable == integer_constant) {...
  2.  

and so on. Some of the nastiness can be caught by increasingly stringent type checking (which is the direction C has moved over the last 30 years) and some by insisting that a constant should appear to the left of a comparison and a variable to the right, but by no means all of it. Another possibility is to have different assignment operators which either do or don't leave a value available for a further assignment, I believe Python has gone that way but that they've chosen the very un-Pascal

Code: Python  [Select][+][-]
  1. a = b := c
  2.  

In any event, combined with loose type-checking, it's one of C's worst features... irrespective of whether it's syntax or semantics.

But the fact remains that, as Carmack reminds us, C and Pascal are of very similar age. And languages predating Pascal had minimal concept of types: mainframes either had an absolute distinction between e.g. numbers and strings since they were handled by different hardware, or an integer was a special case of a real number: these were distinctions which were unavoidable in older programming languages, and it fell to Hoare and Wirth to demonstrate that they could be usefully extended.

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: 6676
Re: John Carmack talks about Pascal
« Reply #11 on: August 20, 2022, 11:58:43 am »
In his interview with Lex Fridman:

"... the world might have been better if it had gone Pascal's route..."

https://youtu.be/I845O57ZSy4?t=5791

Can I also highlight https://www.youtube.com/watch?v=tzr7hRXcwkw which Youtube has just given me. It's from the same interview but there are- to my mind- some incredibly incisive comments in there: that too much of the community believes that code problems can always be found by inspection, that too much of it only uses debuggers as a last resort, and that range checking and static analysis will invariably highlight problems in apparently-working code which should not be allowed to go into production.

I particularly liked

Quote
It's good to be informed when the World has changed more than you thought it would.

which he used to criticise the tendency for people to use generic collection types without checking what's actually being put into them.

I don't normally go overboard on this sort of thing, but the opinions of a working programmer with a track record spanning decades are worth vastly more than those of a pure academic or an armchair guru.

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