Unofficial Hacker News companion — get notified on comment replies, and more.

What Could Object Pascal Look Like in 2030? (opens external site)

44 points by carteragecat 6 hours ago blogs.remobjects.com 21 comments (opens Hacker News) Vote (opens Hacker News)

Comments (21)

  1. Pascal is all about minimizing compile time. This was not an accident --- Niklaus Wirth designed it this way.

    In other words, Pascal is more focused on compilation speed rather than on runtime speed. This may have made sense in a bygone era where PCs where slow and single core.

    This is not to say that the runtime speed of today's Pascal code is "bad" --- it is "good enough" for a lot of uses but it typically lags somewhat behind the best available.

    This is enough to exclude it from consideration for things like OS development or network/web services where speed (or the lack thereof) tends to get carried forward and inflict additional, cumulative costs.

    And this is not to say that it must remain this way --- but it's history and momentum has worked to exclude much effort to change it. To the point where today, not many developers focused on performance would reach for a Pascal compiler. This has a carry on effect and will need to change in order for the language to grasp more development mindshare.

    Replies (1)
    1. Talk author here, hi! Yes, the original compilers were single-pass and very fast. And that does limit optimisations.

      In the talk I discuss things other languages are doing, including inbuilt SIMD types, where I think runtime speed can be a language design goal. And the Pascal compiler I work on, Oxygene, has had a bunch of runtime performance recently - some via a third party math library, but some via LLVM including even custom passes we built. At the same conference I gave the above talk at, I also gave a talk on optimisation techniques using a Delphi app (a raytracer), ie, very practical, let's spend an hour optimising this code, and at the end after I did everything I thought of, I recompile the Delphi VCL app in Oxygene -- and it's another 2.5x faster. That's on ARM. Other tests have seen much bigger on x64 or x32.

      I figure performance is like any other industry problem: you can choose which you focus on, not all languages solve everything, but ultimately your language has to have a solution.

  2. I've got a long-term project of building an Oberon compiler. Oberon is a language in the Pascal family, the newest language from Wirth, and an attempt to remove any unnecessary features from his languages, indeed he went a little too far in some early versions of Oberon and restored a feature or two in successive versions.

    Mostly I've learnt a lot from building a compiler, in particular the back-end which I didn't have much experience with. But also I've started using Oberon more and more. My compiler targets the 65C816 processor, but I ended up porting the front-end to LLVM so that I had native oberon, and used it to build a number of tools, an emulator, and actually the compiler (there was a C intermediate step).

    In the end I've started to really like Oberon, and I don't miss much from more modern languages. I did add some extensions so I have a very simple form of object-orientation, and used it to implement a UI toolkit similar to AppKit, but much simpler. Some of the modern language features add more complexity than they give in benefits. And sometimes it's just better to write code than learn a new language feature or library.

    Plus it's a very readable language.

    Replies (4)
    1. Oberon is definitely an interesting language, and there's a few self-hosting compilers coded in Oberon itself in under 6 thousand lines of Oberon.
    2. If a language features adds more in complexity than benefits, it doesn't feel very Wirth-ian (Oberon or Pascal.)

      What features do you have in mind?

      Replies (1)
      1. Floating point for GUIs is a rare and important exception. Compilers rarely need floating point.
    3. > indeed he went a little too far in some early versions of Oberon and restored a feature or two in successive versions

      Actually the most minimalistic version is the one he made for his retirement project, Oberon-07. Oberon-2 (by Mössenböck et al.) had most features. My Oberon+ is a superset of all (original) Oberon versions.

    4. Which version though?

      While my interest got spiked initially by the original Project Oberon, I was more found of the paths taken by Component Pascal and Active Oberon, as language evolution.

      Anyway, it was what initially opened my eyes to systems programming with GC enabled languages, and drew me into the rabbit hole of Cedar, Modula-2+, Modula-3 and co.

  3. It should look like a set of vector embeddings that can be rotated into any LLM using Plato's Key.
    Replies (2)
    1. Oberon on Laravel for Cobol.
    2. Are you saying it should be accessible to LLMs? What do you mean?
  4. the moment the post talked about the scarf dude i closed the window. citing an idiot… is stupid :)
  5. As it seems, the author is envisioning (a subset of) Ada and SPARK without mentioning them.
    Replies (2)
    1. By talking Rust-style safety? Or other language features?
      Replies (1)
      1. Ada already has language-level contracts and tasking; SPARK has ownership and borrowing rules for Ada pointers. The "allowing multiple readers but ruling out mutation while those read-only aliases are live" in the demo is what made me think of SPARK.
    2. Yeah, I don't know why people just... Don't use Ada and SPARK if they want Ada and SPARK features. Ada needs a comeback.
  6. i read somewhere a while back that a (joking) slogan of haskell is "avoid success at all costs".

    does what the op says about the haskell group's recent statements, mean that this is a turning point for its direction?

    Replies (1)
    1. Author here. I actually don't know much about Haskell, and I think I came across the quoted blog here on HN. But I was struck by the post.

      I've never heard that joke about Haskell but you can see that sort of behaviour in all sorts of areas, not just programming languages. Sometimes it takes someone to say something, seriously, directly, for something to happen. I felt I was reading that kind of statement. And it can be met by defensiveness, denial, attack -- or action. And I wish the absolute best for Haskell.

  7. Very interesting!

    I have said before that any language should be able to break from the past (in a controllable, careful way, but if between stagnation and progress, progress win).

    I also has explore many ideas about how build a programming language (example https://tablam.org), and agree that nothing beats put semantics at the language level.

    This is where I have not idea if the author means for things like Rust-like safety to be or not optional. That is where things always go wrong, imho. Certain semantics can't be useful unless enforced, defaults and preferred. Deviations is what need effort.

  8. Pascal (FPC) and Lazarus were some of the first programming tools I learnt (after a variant of BASIC), they were pretty okay!

    Personally, I think it'd could still be something that people sometimes use (especially with AI) if the ecosystem was stronger:

      * some general quality of life improvements in Lazarus (like coming out of the box with the docking support preinstalled instead of multi-window to copy what other tools are working); I actually don't think that VS Code needs to be a super big focus, nothing wrong with a dedicated tool and everything it brings along, especially because it's fast and has the potential to be less sluggish than the JetBrains IDEs, alongside having a very simple project setup for minimal barrier of entry (click & run)
      * support for all of the popular file types: XML, JSON, CSV, YAML, TOML, all of the PDF, DOC/DOCX/ODT, XLS/XLSX/ODS and typical office formats, more or less out of the box
      * connectors for all contemporary DBs, including latest versions of MySQL/MariaDB/PostgreSQL/SQLite, stuff like MongoDB, Redis/Valkey, RabbitMQ/NATS/Kafka and so on
      * strong web development support, both clients and server frameworks (something like Laravel, Spring Boot, Django, Rails, FastAPI and so on), also support for GraphQL and protobuf
      * stronger support for native GUI development, more of whatever lcl was doing: https://en.wikipedia.org/wiki/Lazarus_Component_Library
      * not encumbered in any unnecessary way, like Delphi
    
    I'm not a language designer so others will probably have more to say about it, I just want Pascal (or a distribution with it together with some tooling, like what Lazarus gives you) to be immensely productive and be as batteries included as needed, without needing to look at a crapload of inconsistent 3rd party packages and under-maintained stuff without much presence.

    I guess I'm just describing most of what Go already does, except maybe for mainstream native GUI choices not being as strong as lcl (I just use Wails cause I'm lazy and evil like that). Come to think of it, since Go exists, maybe that's why I haven't reached for Pascal in a long time too.

  9. That cover picture is certainly one of the AI images of all time.