‹ BackHN Continuity

Thread

Modern Object Pascal Introduction for Programmers

204 points · 90 comments · birdculture

  1. baranul · · focus · HN ↗
    It's amazing how underestimated the Object Pascal language is. Certain people or rivals want to write it off or declare it's "dead", yet the language (including various dialects) are still going strong.
    1. pjmlp · · focus · HN ↗
      Yeah, it was pity that Borland lost its way, and Apple decided to refocus from Object Pascal into C++.

      Otherwise it would still be a big contender.

      Everything that Zig offers over C as selling point was already there in Object Pascal.

      1. applfanboysbgon · · focus · HN ↗
        Comptime? Vastly superior toolchain? Trivial C interop? Sub-second incremental compilation in large projects? I'm not familiar with Object Pascal at all, so do correct me if I'm wrong, but I'd really be surprised if it has much of Zig's standout features.
        1. pjmlp · · focus · HN ↗
          Comptime is the only thing going for it.

          Object Pascal compilers were already super fast in MS-DOS hardware!

        2. lelanthran · · focus · HN ↗
          > Comptime? Vastly superior toolchain? Trivial C interop? Sub-second incremental compilation in large projects?

          No comptime, but everything else, sure, Turbo Pascal (and then Delphi) had.

          Maybe it'll blow your mind (not sure if you find this impressive or not), but Turbo Pascal had sub-second compilation per module on large modules back on my 486 with 4MB of RAM.

          Sure, Zig has more features than Pascal, but not the ones you listed (except, of course, for comptime).

          1. andsoitis · · focus · HN ↗
            > (and then Delphi) had.

            And still does. You can get the latest version of Delphi (including a free version for non-commercial use) here: <a href="https:&#x2F;&#x2F;www.embarcadero.com&#x2F;products&#x2F;delphi" rel="nofollow">https:&#x2F;&#x2F;www.embarcadero.com&#x2F;products&#x2F;delphi

            It rocks.

            You&#x27;re also not limited to Delphi. You can use Oxygene <a href="https:&#x2F;&#x2F;www.remobjects.com&#x2F;elements&#x2F;oxygene&#x2F;language" rel="nofollow">https:&#x2F;&#x2F;www.remobjects.com&#x2F;elements&#x2F;oxygene&#x2F;language

            1. lelanthran · · focus · HN ↗
              &gt; You&#x27;re also not limited to Delphi. You can use Oxygene <a href="https:&#x2F;&#x2F;www.remobjects.com&#x2F;elements&#x2F;oxygene&#x2F;language" rel="nofollow">https:&#x2F;&#x2F;www.remobjects.com&#x2F;elements&#x2F;oxygene&#x2F;language

              If you&#x27;re not in the mood to rent your compiler, you can also try Lazarus.

              1. andsoitis · · focus · HN ↗
                Sure. The rent does give you polish, however.

                Also, for non-commercial use, Delphi is free.

        3. mickeyp · · focus · HN ↗
          Delphi would compile &amp; link 2 MLOC of code on a crappy work laptop in 30 seconds to a minute. Incremental compiles were instant. So fast most developers never bothered learning the &quot;go to next error&quot; hotkey and just spammed F9 (compile &amp; run) whenever they fixed a syntax error. It was that fast.

          Trivial C interop - yes. Both pascal and cdecl style calling conventions.

          Toolchain? Back then - yes. Today? Probably not; depends what you mean by it. It had perfect COM interop which mattered back then, and you could trivially link stuff if you wanted to. And people did.

          1. tliltocatl · · focus · HN ↗
            Comptime here means not &quot;compilation time&quot;, but rather ability to run some your code during compilation (i. e. compile-time metaprogramming). Pascal didn&#x27;t had this.
            1. applfanboysbgon · · focus · HN ↗
              They probably know that. I specifically mentioned actual compilation time as another one of the things that&#x27;s great about Zig, so it is relevant to mention. Certainly the language sounds nice from what I&#x27;m hearing. These days most languages are deeply neglecting compilation time as a feature (interpreted languages aside), so Zig is a breath of fresh air for me in that regard.
              1. klipt · · focus · HN ↗
                Golang is also designed to compile very fast.
                1. applfanboysbgon · · focus · HN ↗
                  Yes, I do appreciate Go&#x27;s existence as well.
                  1. jan_m_savage · · focus · HN ↗
                    Go directly is inspired by Modula-3 and Oberon-2, both are descendants from Pascal family. One of the Go&#x27;s fathers was Wirth&#x27;s students IIRC.
                    1. pjmlp · · focus · HN ↗
                      Oberon-2 surely, there are zero Modula-3 influences in Go.

                      Also Wirth had nothing to do with Modula-3, that was all DEC &#x2F; Olivetti SRC work, done by ex-Xerox people with experience on Cedar and Modula-2+.

                      1. jan_m_savage · · focus · HN ↗
                        &quot;Go is mostly in the C family (basic syntax), with significant input from the Pascal&#x2F;Modula&#x2F;Oberon family&quot;

                        source: <a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;faq" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;faq

                        Without Pascal there would be no Modula.

                        1. pjmlp · · focus · HN ↗
                          Modula-3 where is it?

                          I do agree with Modula, which isn&#x27;t the same as Modula-3.

                2. baranul · · focus · HN ↗
                  This includes some languages inspired by Golang, that have &quot;inherited&quot; Pascal influences, such as Vlang. There&#x27;s also a focus on fast compilation and being useful for prototyping.
          2. mldbk · · focus · HN ↗
            Oh my gosh! Core memories unlocked:

            &gt; most developers never bothered learning the &quot;go to next error&quot; hotkey and just spammed F9 (compile &amp; run) whenever they fixed a syntax error

            We didn&#x27;t know we were privileged. I thought it was normal thing to have.

          3. pjmlp · · focus · HN ↗
            COM interop matters even more today, as COM (and WinRT as its evolution) has become the main mechanism to deliver new APIs since Windows Vista.

            Ironically it is still easier in Delphi than the frameworks Microsoft keeps pouring out for .NET and C++.

            I keep joking they should afford some Embarcadero licenses to learn how to actually do it.

        4. sakesun · · focus · HN ↗
          Object Pascal has more runtime reflection features which were added to facilitate visual programming paradigm. Do you know what can be faster than sub-second incremental compilation ? Run-time&#x2F;Design-time manipulation !
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.