News for hackers. Stuff that matters.
Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Saturday September 26, 2026 @09:43AM (#49856482)
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.

Re:Modern Object Pascal Introduction for Programmers – Castl... by sehugg on Saturday September 26, 2026 @11:19AM (#49857401)
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)
Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Saturday September 26, 2026 @11:23AM (#49857439)
Turbo Pascal 7 had them as well.
Re:Modern Object Pascal Introduction for Programmers – Castl... by ape4 on Saturday September 26, 2026 @11:12AM (#49857337)
If I remember right, it was memory safe - something C/C++ has yet to achieve.
Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Saturday September 26, 2026 @11:24AM (#49857443)
Even PL/I, JOVIAL, and NEWP on the decade predating C had it.
Re:Modern Object Pascal Introduction for Programmers – Castl... by cyberax on Saturday September 26, 2026 @04:42PM (#49860348)
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.

Re:Modern Object Pascal Introduction for Programmers – Castl... by cisc on Saturday September 26, 2026 @05:11PM (#49860586)
> It just made any dynamic structures so painful that few programmers used them

What's an example of the pain?

Re:Modern Object Pascal Introduction for Programmers – Castl... by cyberax on Saturday September 26, 2026 @06:08PM (#49860991)
Awkward syntax for pointer access, for one thing.
Re:Modern Object Pascal Introduction for Programmers – Castl... by cisc on Saturday September 26, 2026 @06:15PM (#49861054)
Re:Modern Object Pascal Introduction for Programmers – Castl... by cyberax on Saturday September 26, 2026 @06:27PM (#49861155)
You need to dereference pointer to access the structure fields, for example.
Re:Modern Object Pascal Introduction for Programmers – Castl... by cisc on Saturday September 26, 2026 @06:56PM (#49861373)
Nope, you don't need to. For example, all class references are pointers and they don't need to be dereferenced manually.

Object Pascal's pointer syntax is detailed in the links I gave you.

Re:Modern Object Pascal Introduction for Programmers – Castl... by cyberax on Sunday September 27, 2026 @02:56PM (#49869694)
This is the modern Object Pascal. Here's the Turbo Pascal syntax: https://en.wikipedia.org/wiki/Object_Pascal#Heap_based_alloc... - if we're comparing something that was around the same time as C++.
Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Monday September 28, 2026 @03:02AM (#49874523)
So your point is having to write ptr^.val instead of either (*ptr).val, or ptr->val?
Re:Modern Object Pascal Introduction for Programmers – Castl... by applfanboysbgon on Saturday September 26, 2026 @10:06AM (#49856690)
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.
Re:Modern Object Pascal Introduction for Programmers – Castl... by lelanthran on Saturday September 26, 2026 @10:35AM (#49856993)
> 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).

Re:Modern Object Pascal Introduction for Programmers – Castl... by andsoitis on Saturday September 26, 2026 @10:50AM (#49857146)
> (and then Delphi) had.

And still does. You can get the latest version of Delphi (including a free version for non-commercial use) here: https://www.embarcadero.com/products/delphi

It rocks.

You're also not limited to Delphi. You can use Oxygene https://www.remobjects.com/elements/oxygene/language

Re:Modern Object Pascal Introduction for Programmers – Castl... by lelanthran on Saturday September 26, 2026 @12:39PM (#49858175)
> You're also not limited to Delphi. You can use Oxygene https://www.remobjects.com/elements/oxygene/language

If you're not in the mood to rent your compiler, you can also try Lazarus.

Re:Modern Object Pascal Introduction for Programmers – Castl... by andsoitis on Saturday September 26, 2026 @12:53PM (#49858333)
Sure. The rent does give you polish, however.

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

Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Saturday September 26, 2026 @10:23AM (#49856866)
Comptime is the only thing going for it.

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

Re:Modern Object Pascal Introduction for Programmers – Castl... by mickeyp on Saturday September 26, 2026 @12:42PM (#49858225)
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.

Re:Modern Object Pascal Introduction for Programmers – Castl... by mldbk on Saturday September 26, 2026 @03:26PM (#49859718)
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.

Re:Modern Object Pascal Introduction for Programmers – Castl... by tliltocatl on Saturday September 26, 2026 @02:35PM (#49859230)
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.
Re:Modern Object Pascal Introduction for Programmers – Castl... by applfanboysbgon on Saturday September 26, 2026 @02:46PM (#49859342)
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.
Re:Modern Object Pascal Introduction for Programmers – Castl... by klipt on Saturday September 26, 2026 @04:56PM (#49860465)
Golang is also designed to compile very fast.
Re:Modern Object Pascal Introduction for Programmers – Castl... by applfanboysbgon on Saturday September 26, 2026 @05:21PM (#49860661)
Yes, I do appreciate Go's existence as well.
Re:Modern Object Pascal Introduction for Programmers – Castl... by jan_m_savage on Sunday September 27, 2026 @02:00AM (#49863763)
Go directly is inspired by Modula-3 and Oberon-2, both are descendants from Pascal family. One of the Go's fathers was Wirth's students IIRC.
Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Sunday September 27, 2026 @03:28AM (#49864236)
Oberon-2 surely, there are zero Modula-3 influences in Go.

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

Re:Modern Object Pascal Introduction for Programmers – Castl... by jan_m_savage on Sunday September 27, 2026 @04:31AM (#49864552)
"Go is mostly in the C family (basic syntax), with significant input from the Pascal/Modula/Oberon family"

source: https://go.dev/doc/faq

Without Pascal there would be no Modula.

Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Monday September 28, 2026 @03:02AM (#49874533)
Modula-3 where is it?

I do agree with Modula, which isn't the same as Modula-3.

Re:Modern Object Pascal Introduction for Programmers – Castl... by baranul on Monday September 28, 2026 @01:46AM (#49874092)
This includes some languages inspired by Golang, that have "inherited" Pascal influences, such as Vlang. There's also a focus on fast compilation and being useful for prototyping.
Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Sunday September 27, 2026 @03:27AM (#49864231)
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.

Re:Modern Object Pascal Introduction for Programmers – Castl... by sakesun on Saturday September 26, 2026 @06:47PM (#49861311)
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 !
Re:Modern Object Pascal Introduction for Programmers – Castl... by LoganDark on Saturday September 26, 2026 @12:33PM (#49858128)
> 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?

Re:Modern Object Pascal Introduction for Programmers – Castl... by pjmlp on Saturday September 26, 2026 @12:46PM (#49858254)
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.

Re:Modern Object Pascal Introduction for Programmers – Castl... by LoganDark on Saturday September 26, 2026 @12:56PM (#49858362)
Thanks!