Earlier quoted context omitted.
One huge difference between C and Pascal grammars us that Pascal is LR(1), so it can be parsed easily, which helps one-pass translation. It also helps humans read it. C, on the other hand, has needlessly complicated syntax; a function definition is hard to detect, and a pointer to a function is hard to interpret, because it's literally convoluted: https://c-faq.com/decl/spiral.anderson.html Sadly, this is a general s…
You misremember. Pascal's grammar is "easy" because it is LL(1), not LR(1)! C is almost LR(1), if we allow prior declarations to decide how some tokens are classified, like whether an identifier is a variable or type name. Declarations like void (*signal(int, void (*fp)(int)))(int); are LR(1). LR(1) sentences are harder to read than LL(1) because you have to keep track of a long prefix of the input, looking for right…
Modern Pascal is still in the race (2022)
141–150 of 160 posts
Re: Modern Pascal is still in the race (2022)
#142Hmm meh. I have a soft spot for Delphi/Object Pascal but I think the case here is not great. What it looks like at a glance is they wrote a better Pascal program than the Go one it was competing against, rather than just idiomatically port it. A fine approach, but it doesn't tell us that much. Specifically, it doesn't tell us very much about programming languages. Go has plenty of weaknesses versus Pascal, but two co…
Delphi was really a "Concorde moment" in that it was actually rapid , both in terms of development speed, and performance, which was somehow forgotten as the web emerged. Forgotten to the point that people thought Visual Basic was a good idea.
Visual Basic 5 was kinda awesome.
It may very well be that if I had looked at both again after, say, 5 years of programming I might have different views, but even now I still look back fondly on VB, it got shit done, esp if you needed a quick UI with not a lot of business logic.
Re: Modern Pascal is still in the race (2022)
#143Earlier quoted context omitted.
Here are the mentioned sixteen pages if anyone is interested: https://miasap.se/obnc/oberon-report.html Oberon also has an interesting set of features to enable object-oriented programming without the syntactic sugar. Here is an article which describes basic abstractions in Oberon: https://miasap.se/obnc/data-abstraction.html
I referred to this one: https://people.inf.ethz.ch/wirth/Oberon/Oberon.Report.pdf .
Re: Modern Pascal is still in the race (2022)
#144Earlier quoted context omitted.
I'm very much not a C programmer, but I've never understood why it seems far more common to write `float *foo` instead of `float* foo`. The "pointerness" is part of the type and to me the latter expresses that far more clearly.
Because the syntax is: {, , ...} ; The star is a type-deriving operator that is part of the , not part of the ! This declares two pointers to char: char *foo, *bar; This declares foo as a pointer to char, and bar as a char: char* foo, bar; We have created a trompe l'oeil by separating the * from the declarator to which it begins and attaching it to the specifier to which it doesn't.
Re: Modern Pascal is still in the race (2022)
#145Earlier quoted context omitted.
I referred to this one: https://people.inf.ethz.ch/wirth/Oberon/Oberon.Report.pdf .
The current version of Oberon (sometimes called Oberon-07) is about the same length though.
Re: Modern Pascal is still in the race (2022)
#146Earlier quoted context omitted.
Because the syntax is: {, , ...} ; The star is a type-deriving operator that is part of the , not part of the ! This declares two pointers to char: char *foo, *bar; This declares foo as a pointer to char, and bar as a char: char* foo, bar; We have created a trompe l'oeil by separating the * from the declarator to which it begins and attaching it to the specifier to which it doesn't.
On the other hand, for those of us who agree with the GP on this, one way around the pitfall is to have your project's style guide ban multiple declarations on a single line, or at least ban them for non-trivial variables— so `int x, y, z;` is permitted, but nothing more than that.
Re: Modern Pascal is still in the race (2022)
#147Earlier quoted context omitted.
Ada, at least, uses begin...end in part because it prevents certain kinds of errors. In its syntax you have to specify what you are ending, reducing the risk of invalid matches and increasing the likelihood of the error report system guessing correctly what you intended . E.g.: if X > 0 then Y := 0; end if; Curly braces are shorter, but a close curly brace will match any open curly brace. Such is the nature of trade-…
Ngl, I think that's brilliant. Braces matching the wrong brace is like a daily occurrence. It's such a tedious small thing that constantly hounds me whenever I'm writing code
Re: Modern Pascal is still in the race (2022)
#148I def have a soft spot for Pascal. And I think Niklaus Wirth deserves more recognition in broader circles for his foundational work with pcode, compilers, Oberon, etc. I learned Pascal like many of us growing up in the early PC era and never could look at BASIC the same way again (or respect Gates for his love of it, lol). I think having such a highly structured language at a young age did wonders. But these days fol…
>But the whole industry has gone overall into believing that anything newly 'invented' is good and anything that's been around a while is passé. I think this is partially accepted to keep wages down. New languages allow fresh developers to be on a level playing field with more senior developers. Both have say 2 years experience in said new language. Fresh developers are cheaper and therefore push down wages.
Also, at better places the language itself is a tool - someone will be a senior in any other language as well.
Re: Modern Pascal is still in the race (2022)
#149Pascal is an abandoned prototype for Modula-2 and Oberon.
Modula-2 and Oberon are abandoned dialects of Pascal. I just wish Concurrent Pascal would have survived. As the only properly safe system language.
Wirth made a mistake by fragmenting his language development over similar, but incompatible languages under different names.
When we look at C, the story is different. ANSI C was carefully designed to be backward compatible with K&R C. C99 didn't break too much in C90: test cases to demonstrate incompatibility have to be contrived. The name of the language didn't change.
Simply not changing the name is a powerful social tactic. People overlook differences when the name has not changed. (Look at how Lisp outsiders think that Lisp is all the same.)
Modern Fortran is very different from Fortran 66 or 77. Because the name is the same, the "Frankenfortran" is accepted in the same circles (e.g. scientific computing). Had the name changed, that would be unlikely.
I can't escape the suspicion that Wirth should have continued to use the Pascal name for that entire succession of languages.
Re: Modern Pascal is still in the race (2022)
#150Earlier quoted context omitted.
>But the whole industry has gone overall into believing that anything newly 'invented' is good and anything that's been around a while is passé. I think this is partially accepted to keep wages down. New languages allow fresh developers to be on a level playing field with more senior developers. Both have say 2 years experience in said new language. Fresh developers are cheaper and therefore push down wages.
It’s almost like there are improvements in PL design. Also, at better places the language itself is a tool - someone will be a senior in any other language as well.
Eh, not really, at least not in the last 10+ years. I'm sure some obscure hotness does something neat, but mostly inconsequential for the vast, vast majority of shops.
>someone will be a senior in any other language as well.
While I agree with you, that often isn't the opinion of people hiring. If someone is looking for 2 years of java, in most places, 10 years of C# isn't what they are willing to hire.