Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Does Georgism work? Five years later (astralcodexten.com)
    196comments
  2. Go Concurrency Distilled (antonz.org)
    59comments
  3. PipePipe: NewPipe hard fork implementing SponsorBlock (github.com/infinityloop1308)
    214comments
  4. Flip Fluid on Flip Dots (mitxela.com)
    3comments
  5. DeepSeek Elastic Compute (DSec) (arxiv.org)
    78comments
  6. Improving site performance by shipping more CSS (github.blog)
    11comments
  7. Show HN: Reladraw – A diagram language where you decide where to place things (github.com/reladraw)
    79comments
  8. What is the size of Yemen? (2024) (theborys.substack.com)
    23comments
  9. A searchable library of forgotten public-domain film clips from 1915 onward (movingimagearchive.com)
    26comments
  10. Biology might not be quantum, but its math is quantumlike (quantamagazine.org)
    19comments
  11. Evolving programming languages in the AI era (dashbit.co)
    51comments
  12. Fifteen years later, the Apple Cards origin story (lexontech.org)
    98comments
  13. ASML says it sold 'absolutely nothing' in Europe in 2026 (tomshardware.com)
    584comments
  14. Drawgent: Coding agent on a live Excalidraw canvas (tangled.org/yanndegat.tngl.sh)
    39comments
  15. An agent used DNS to reach an external chatbot (alignment.openai.com)
    90comments
  16. Reverse-engineering the Intel 8087's tangent algorithm: more than CORDIC (righto.com)
    9comments
  17. Turning GLM-5.3-Flash into a Jev-like decision model (privatemode.ai)
    29comments
  18. Exploding variance of means of exponentials: least-squares to the rescue (francisbach.com)
    —discuss
  19. Snap Wants to be a State Actor??–Kansas v. Snap (ericgoldman.org)
    10comments
  20. We Should Be Able to Change Our Languages (jimmyhmiller.com)
    16comments
  21. Promising discoveries about the potential for life on one of Saturn’s icy moons (fu-berlin.de)
    25comments
  22. How I changed teaching after AI managed to do all my homework assignments (thelastsoftwareengineer.substack.com)
    169comments
  23. Bob Mackie dressed stars–if they were brave enough (economist.com)
    1comments
  24. Real-time feedback: My closing move in every interview (mgrebler.substack.com)
    26comments
  25. How to keep enjoying programming in a world of LLMs (haskell.org)
    263comments
  26. Modern Object Pascal Introduction for Programmers (castle-engine.io)
    74comments
  27. Generate fonts where every LLM token is the same width (mesh.host)
    12comments
  28. Welcome to the Medical Clinic at the Interplanetary Relay Station (lightspeedmagazine.com)
    12comments
  29. The Evolution of Vending Machines (saturdayeveningpost.com)
    11comments
  30. LA Metro has some of the slowest escalators (basin.la)
    83comments

Modern Object Pascal Introduction for Programmers

170 pointsby 2d agocastle-engine.io
74 comments
2d agoHN ↗

I was introduced a very long time ago --- aka Delphi 2. I really like the language but there are mainly 2 problems that stand in the way of using it.

1) The code isn't as "optimized" as it could be.

2) The talent pool is limited --- chicken or egg issue.

It has been this way for a very long time so I don't see it changing.

18h agoHN ↗

As a different datapoint Pascal is still taught here in Romania in secondary school just as it was the case 20 years ago.

Bigger problem is that they teach the fundamentals with the abandonware that is turbo pascal instead of using something like the modern Free Pascal Compiler. Which means knowledge of what is possible outside curricula is limited.

Last year I almost was tasked with porting some Pascal codebase to a modern language. Problem was the project had a bus factor of 1, legacy overengineered and would only compile on windows with some proprietary compiler.

Maybe that company would use Claude/Codex or something like that, today, to port the project.

10h agoHN ↗

Bigger problem is that they teach the fundamentals with the abandonware that is turbo pascal instead of using something like the modern Free Pascal Compiler. Which means knowledge of what is possible outside curricula is limited.

FreePascal can compile TP programs with no changes except for the MS-DOS graphics. A student can swap FP for TP and the code will keep running. But yes, I would switch to FP from the start if I were in charge.

16h agoHN ↗

What do you mean by “not optimized enough“? Binaries created with Free Pascal Compiler are very small, compilation time is super fast and runtime performance was never an issue for the typical system/userland programs. I think in many ways on par or ahead of other mainstream system programming languages.

16h agoHN ↗

Additionally, it eventually shared the same backend with Borland C++, and nowadays C++ Builder.

Also Embarcadero has also adopted LLVM, while still having fast build times.

18h agoHN ↗

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.

18h agoHN ↗

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.

17h agoHN ↗

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.

17h agoHN ↗

Comptime is the only thing going for it.

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

17h agoHN ↗

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).

14h agoHN ↗

Sure. The rent does give you polish, however.

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

15h agoHN ↗

Delphi would compile & 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 "go to next error" hotkey and just spammed F9 (compile & 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.

13h agoHN ↗

Comptime here means not "compilation time", but rather ability to run some your code during compilation (i. e. compile-time metaprogramming). Pascal didn't had this.

13h agoHN ↗

They probably know that. I specifically mentioned actual compilation time as another one of the things that's great about Zig, so it is relevant to mention. Certainly the language sounds nice from what I'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.

12h agoHN ↗

Oh my gosh! Core memories unlocked:

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

We didn't know we were privileged. I thought it was normal thing to have.

20m agoHN ↗

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.

9h agoHN ↗

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/Design-time manipulation !

16h agoHN ↗

If I remember right, it was memory safe - something C/C++ has yet to achieve.

16h agoHN ↗

Even PL/I, JOVIAL, and NEWP on the decade predating C had it.

11h agoHN ↗

It was not. It just made any dynamic structures so painful that few programmers used them.

But it _did_ have range checks for array access.

10h agoHN ↗

It just made any dynamic structures so painful that few programmers used them

What's an example of the pain?

9h agoHN ↗

Awkward syntax for pointer access, for one thing.

16h agoHN ↗

I recall the turning point was when id used the Watcom compiler for DOOM. Watcom had the 32-bit flat model DOS extender and were starting to add the difficult optimizations. Turbo/Borland Pascal was built for compile and link speed, not even getting a real -O option until Delphi (except for turning off range and stack checking)

15h agoHN ↗

Apple decided to refocus from Object Pascal into C++

IIRC Apple went and made Objective-C(/C++) and then eventually Swift. Not sure if they actually embraced C++ all that much - did they really?

15h agoHN ↗

Completely off the charts.

I am talking about Apple after Jobs was kicked out.

You missed the part where NeXT licensed Objective-C from Stepstone, Apple bought NeXT as last survival action before bankruptcy, and OS X sprung out of NeXTSTEP.

16h agoHN ↗

IMO it is not entirely dead, but not really "alive" either. TIOBE even has Object Pascal mentioned right now in TOP 20. Now, TIOBE has tons of issues, but it also means that there exists some tangible interest.

Still, I don't feel many people want to use Object Pascal these days. If you have the choice between Python and Object Pascal, most people will undoubtedly use Python. It's just how it is right now, and I also don't see how that can change in favour of Object Pascal. Programming languages nowadays have so much more competition, and people are less tolerant of flaws. Strangely enough, people barely seem to work on these flaws; this is one of my pet peeve with ruby, the documentation should be much better but it is not. I no longer find that acceptable in 2026, with AI spam slop lowering the quality and google search being terrible and almost totally useless nowadays. You'd assume that a counter-move to this slop-degradation would be to massively improve documentation, but you still find core projects in ruby or at the least important add-ons, to have low-quality documentation. And barely anybody wants to improve on that either.

7m agoHN ↗

Indeed the "why bother with performance when others write code in C for us" mindset.

15h agoHN ↗

People hate the verbose syntax. It doesn't bother me, but I've been surprised how common that is described amongst people that don't care for Pascal.

Personally, in that family of languages I prefer Ada, but I gave up with programming and programming languages.

14h agoHN ↗

For me it's less the verbose syntax but more the weirdness and inconsistency of it. Like making a distinction between a procedure and a function, or returning data from a function by assigning it to a magical variable. It feels like a cobbled-together language rather than a properly designed one.

10h agoHN ↗

I wasn't able to find a definitive account of why they're separated in Ada, but I believe the idea is this: functions are for where code behaves in a roughly functionally pure way and yields a value that should not be discarded by the caller, whereas procs are for functionality with 'deep' side-effects.

The SPARK subset of Ada comes pretty close to enforcing purity of Ada functions, although it still permits them to read globals. [0]

It's not just an oversight. The core of the Ada language was designed deliberately. [1]

[0] https://learn.adacore.com/courses/intro-to-spark/chapters/01...

[1] https://en.wikipedia.org/wiki/Ada_(programming_language)#His...

6h agoHN ↗

People hate the verbose syntax

People hate verbose syntax until it's about a language they like. Then suddenly "the IDE takes care of that so I don't care" or some such. With Ada in particular, if you gave up safer programming for 40 years because "ew nasty I have to type begin...end..." then I don't want to hear about your pet safe language.

8m agoHN ↗

The same people that now program in English, writing Markdown file after Markdown file?

17h agoHN ↗

I bought Delphi ages ago, but never got very far with it, which I regret.

I'd love to be able to take it up again, and this document looks very promising for that, esp. paired with:

https://wiki.freepascal.org/pas2js

which I now see is supported in Lazarus.

If someone has an example graphical project which compiles to an HTML page w/ JavaScript using the above, I'd love to see it and a detailed set of build instructions and notes on installing the needed toolchain and deployment. (as a note, I'm currently working in flet.dev using Python which allowed me to get a small prototype up-and-running, but I'm still looking into self-hosting and doing something more complex)

16h agoHN ↗

I think I last used Pascal, TurboPascal if I remember correctly, in school - perhaps at age 17 or something like that. I recall that we used to define some things from geometry, e. g. a triangle, calculating sides, angles, surface area and so forth, and then of some more objects from geometry.

I have not used Pascal since then but it was not the most terrible programming language of all times either. These days I would not know why I'd want to use it, compared to IMO better languages. Nonetheless I found it ok for teaching in school back then.

16h agoHN ↗

There's also a new book called Free Pascal From Square One released in 2025 that teaches programming and pascal

16h agoHN ↗

this is really neat to see and that it has support for any modern system. I don't know pascal and could be a fun way to learn it.

16h agoHN ↗

5.1. Remember to free the class instances

The class instances have to be manually freed, otherwise you get memory leaks.

manual memory management in 2026?

1h agoHN ↗

Whilw there is a certain hype, Rust has affine types to prevent use after free, based on Cyclone type system, which AT&T was researching as C replacement, contrary to the list above.

13h agoHN ↗

This takes me back, my first adventure in programming was as a 12 year old creating a Pong clone using Turbo Pascal on DOS. It came in handy later as a 20 year old when I was doing freelance as a Delphi dev. Amazing to see Pascal on HN.

12h agoHN ↗

At around the same age I learned a version/imitation of Object Pascal for scripting the PIRCH IRC client on windows 95. It was neet when a friends dad who was a professional programmer showed me the latest version of Delphi, which he was pretty excited about, and I could actually understand most of what he was showing me.

12h agoHN ↗

AI will do all our work now, but man at least I lived and wrote Pascal growing up.

11h agoHN ↗

Huwstube and Bg-Lazarus-en-CreatingaWeb-s8e are great youtube channels.

10h agoHN ↗

Perfect to implement your own haskell I guess :p

9h agoHN ↗

I was introduced to ucsd pascal on apple 2 but switched to Ada by the time turbo pascal came out. This intro is nice but I feel Ada is the way to go if one is into wirthian languages.

10m agoHN ↗

Agreed, given it being an international standard.

However even Ada Core's IDE is a bit of lackluster when comparing with 1990's Delphi, let alone today.

9h agoHN ↗

I loved writing Pascal and Modula-2 at the time, and using both for a while sure made me a better programmer. Pascal was an excellent educational tool, but for a decade had enormous business impact, too.

Most criticized things regarding Pascal e.g. https://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pas... were already fixed by extension or coukd be fixed easily.

Its slight verbosity - somewhere between C and COBOL - arguably was a pro rather than a con.

Today, Ada and Julia seem to be the langages alive that resemble Pascal the most.

6h agoHN ↗

Ada is still a thing (just not on HN). If this is your thing, check out Modula-3 for a serious 'what might have been' fix.

4m agoHN ↗

The critics were always disingenuous , ignoring that Modula-2 came out already in 1978, designed for systems programming and fixing Pascal initial flaws.

Also most of those extensions ended up in ISO Extended Pascal revision, also usually ignored in such criticism.

9h agoHN ↗

I used to have object pascal as my main language, and it has a lot in its favour. But when I go back to it I find two things drag it down.

Pre definition of variables. I would like to be able to define variables on first assignment and scoped to the begin/end in which that happens, I don't think there is a good remaining argument to keep them above the statements.

The namespace is cluttered with legacy usage, making the many years of advancement require odd. Combinations of prefixes.

I still think there is a scope for a light fork that changes the name to distinguish it and starts the RTL afresh using the decades of hindsight and improvements.

8h agoHN ↗

Oh excellent, last time I saw it proposed there were, well, ructions.

Type inference is my preference but I thought that would have been a step too far for some.

4h agoHN ↗

It's in Delphi, Free Pascal devs are still pretty resistant to the idea and it likely won't be coming to fpc any time soon.

5h agoHN ↗

When I was first learning to program, I started using the free Borland Turbo C++ compiler [1]. I had managed to get subscribed to their newsletter that seemed very insistent that Delphi was going to be the future for desktop software. Awhile later, I found out that "Spybot – Search & Destroy" was written in Delphi, so I figured it might be fun to play with.

So play with it I did. I hadn't used Visual Basic at the time, so the entire idea of "drag and drop" GUIs was kind of amazing, and I even kind of ended up liking the language.

I wasn't able to get any kind of OpenGL stuff working with it, so I ended up going back to C and I really haven't touched the language since, but I kind of feel like I should at some point just to finish off that loose thread in my education.

[1] I actually don't remember if that was proper freeware or if I had gotten it cough unofficially free...

4h agoHN ↗

Ah, Object Pascal! Delphi was my first real IDE, felt so productive back then. Good to see it getting aern modern look for new devs.

4h agoHN ↗

To learn more about vending machines, also refer to the anime "Reborn as a Vending Machine, I Now Wander the Dungeon"

2h agoHN ↗

One of the greatest features of FreePascal is that strings are managed. You never allocate or deallocate them, you just declare the variable, and it manages them. They're counted, reference counted, copy on write, and can hold gigabytes.

According to google:

When you assign one dynamic string to another, Free Pascal does not duplicate the actual characters in memory. Instead, both variables point to the same character buffer in the heap, and the runtime increments an internal reference counter. A physical memory copy is only triggered when one of the string instances is modified (written to)

Free Pascal strings are as close as you get to magic, compared to C/C++.

1h agoHN ↗

COW-strings aren't free. In a multithreaded environment they require atomic operations for use counter, which isn't cheap. Some time ago some implementations of C++ did use COW-strings too, but this approach was rejected due to such performance concerns.

12m agoHN ↗

Most of those ideas were present in PL/I, but we all know how it went.