<story><title>Modern Pascal is still in the race (2022)</title><url>https://blog.synopse.info/?post/2022/11/26/Modern-Pascal-is-Still-in-the-Race</url></story><parent_chain><item><author>deergomoo</author><text>I&amp;#x27;m very much not a C programmer, but I&amp;#x27;ve never understood why it seems far more common to write `float *foo` instead of `float* foo`. The &amp;quot;pointerness&amp;quot; is part of the type and to me the latter expresses that far more clearly.</text></item><item><author>nine_k</author><text>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.&lt;p&gt;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&amp;#x27;s literally convoluted: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;c-faq.com&amp;#x2F;decl&amp;#x2F;spiral.anderson.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;c-faq.com&amp;#x2F;decl&amp;#x2F;spiral.anderson.html&lt;/a&gt;&lt;p&gt;Sadly, this is a general stylistic difference: where Pascal tries to go for clarity, C makes do with cleverness, which is more error-prone.</text></item><item><author>PumpkinSpice</author><text>I&amp;#x27;m surprised that you draw a sharp distinction between C and Pascal syntax. They have a shared lineage and are really very close to each other. Yeah, curly braces won over &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot;, but that&amp;#x27;s not a matter of some huge conceptual rift, just convenience.&lt;p&gt;There are numerous languages today, including Haskell and Ocaml, that are far more removed from the Algol lineage than these two. Heck, the differences between Rust and C are probably more pronounced than between C and Pascal.</text></item><item><author>runlaszlorun</author><text>I 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.&lt;p&gt;But these days folks are mostly used to the C style syntax. And I&amp;#x27;m not even arguing that it is a better language than C or others. But the whole industry has gone overall into believing that anything newly &amp;#x27;invented&amp;#x27; is good and anything that&amp;#x27;s been around a while is passé. Ironically, at the same time as the core technologies we use are based on decades old tech like Unix, relational databases, TCP&amp;#x2F;IP, etc. And many others like Lisp and Smalltalk fell by the wayside at least partly due to performance issues that were made irrelevant by Moore&amp;#x27;s law long ago.&lt;p&gt;Oh humans... :)&lt;p&gt;Btw, Logo is another one that&amp;#x27;s under appreciated. Seymour Papert was brilliant in making programming more visual and intuitive for kids. And I didn&amp;#x27;t actually know until recently it&amp;#x27;s actually a Lisp based language with a lot of power. Who knew?&lt;p&gt;In some parallel universe, I&amp;#x27;d love to see folks like those, along with many others from that era, as the ones we heap recognition on instead of our worship of current tech billionaires. Those guys generally understood the hardware, software, and core theory. Given the mess that is computing and the internet, it&amp;#x27;s a shame that we&amp;#x27;ll be losing them over the next few decades.</text></item></parent_chain><comment><author>kazinator</author><text>Because the syntax is:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  &amp;lt;specifiers&amp;gt; &amp;lt;declarator&amp;gt; {, &amp;lt;declarator&amp;gt;, ...} ;
&lt;/code&gt;&lt;/pre&gt;
The star is a type-deriving operator that is part of the &amp;lt;declarator&amp;gt;, not part of the &amp;lt;specifiers&amp;gt;!&lt;p&gt;This declares two pointers to char:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  char *foo, *bar;
&lt;/code&gt;&lt;/pre&gt;
This declares &lt;i&gt;foo&lt;/i&gt; as a pointer to char, and &lt;i&gt;bar&lt;/i&gt; as a char:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  char* foo, bar;
&lt;/code&gt;&lt;/pre&gt;
We have created a &lt;i&gt;trompe l&amp;#x27;oeil&lt;/i&gt; by separating the * from the declarator to which it begins and attaching it to the specifier to which it doesn&amp;#x27;t.</text></comment>
<story><title>Modern Pascal is still in the race (2022)</title><url>https://blog.synopse.info/?post/2022/11/26/Modern-Pascal-is-Still-in-the-Race</url></story><parent_chain><item><author>deergomoo</author><text>I&amp;#x27;m very much not a C programmer, but I&amp;#x27;ve never understood why it seems far more common to write `float *foo` instead of `float* foo`. The &amp;quot;pointerness&amp;quot; is part of the type and to me the latter expresses that far more clearly.</text></item><item><author>nine_k</author><text>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.&lt;p&gt;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&amp;#x27;s literally convoluted: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;c-faq.com&amp;#x2F;decl&amp;#x2F;spiral.anderson.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;c-faq.com&amp;#x2F;decl&amp;#x2F;spiral.anderson.html&lt;/a&gt;&lt;p&gt;Sadly, this is a general stylistic difference: where Pascal tries to go for clarity, C makes do with cleverness, which is more error-prone.</text></item><item><author>PumpkinSpice</author><text>I&amp;#x27;m surprised that you draw a sharp distinction between C and Pascal syntax. They have a shared lineage and are really very close to each other. Yeah, curly braces won over &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot;, but that&amp;#x27;s not a matter of some huge conceptual rift, just convenience.&lt;p&gt;There are numerous languages today, including Haskell and Ocaml, that are far more removed from the Algol lineage than these two. Heck, the differences between Rust and C are probably more pronounced than between C and Pascal.</text></item><item><author>runlaszlorun</author><text>I 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.&lt;p&gt;But these days folks are mostly used to the C style syntax. And I&amp;#x27;m not even arguing that it is a better language than C or others. But the whole industry has gone overall into believing that anything newly &amp;#x27;invented&amp;#x27; is good and anything that&amp;#x27;s been around a while is passé. Ironically, at the same time as the core technologies we use are based on decades old tech like Unix, relational databases, TCP&amp;#x2F;IP, etc. And many others like Lisp and Smalltalk fell by the wayside at least partly due to performance issues that were made irrelevant by Moore&amp;#x27;s law long ago.&lt;p&gt;Oh humans... :)&lt;p&gt;Btw, Logo is another one that&amp;#x27;s under appreciated. Seymour Papert was brilliant in making programming more visual and intuitive for kids. And I didn&amp;#x27;t actually know until recently it&amp;#x27;s actually a Lisp based language with a lot of power. Who knew?&lt;p&gt;In some parallel universe, I&amp;#x27;d love to see folks like those, along with many others from that era, as the ones we heap recognition on instead of our worship of current tech billionaires. Those guys generally understood the hardware, software, and core theory. Given the mess that is computing and the internet, it&amp;#x27;s a shame that we&amp;#x27;ll be losing them over the next few decades.</text></item></parent_chain><comment><author>badsectoracula</author><text>I think it is a manner of preference, both &amp;quot;float* foo&amp;quot; and &amp;quot;float *foo&amp;quot; are widely used.&lt;p&gt;Personally i used &amp;quot;float *foo&amp;quot; for years until at some point i found &amp;quot;float* foo&amp;quot; more natural (as the pointer is conceptually part of the type) so i switched to that, which i&amp;#x27;ve also been using for years. I&amp;#x27;ve worked on a bunch of codebases which used both though (both in C and C++) - in some cases even mixed because that&amp;#x27;s what you get with a codebase where a ton of programmers worked over many years :-P.&lt;p&gt;I do tend to put pointer variable declarations on their own lines though regardless of asterisk placement.&lt;p&gt;(and of course there is always &amp;quot;float foo[42]&amp;quot; to annoy you with the whole &amp;quot;part of the type&amp;quot; aspect :-P)*</text></comment>