24 comments

[ 3.3 ms ] story [ 56.8 ms ] thread
Looks cool and does aim to address some of the annoying warts in Pascal. Especially the memory model.
It is a bit curious with the Mojo 1.0 beta coincidence, as Pascal was the other langauge with a highly readable and quite simple language combined with performant compiled code without GC.

What it lacked was a modern compiler and stack. There is FreePascal for sure, and Lazarus is impressive, but it for sure has its baggage.

That’s so great! Thank you!

I wish something like this existed for Ada :)

Looks interesting. As someone who's been using Pascal since Turbo Pascal 6, and use Delphi daily at work, I'm not sure I quite get the "COM-style interface GUID" objection. What exactly about it is complex, and how do you implement Supports() without it?
In my early programming days, working with Clipper, I used to look at Delphi from a distance with awe and a bit of jealousy. There also used to be PowerBuilder and Paradox, as competition to the xBase platforms.

I'd love to hear more about how you're using Delphi and what it excels at, compared to current web and native software stacks.

It's magic! ;-)

Not wanting to go into too much technical details: Blaise's interface system uses TypeInfo pointers as identity tokens. Meaning manually added GUIDs are not needed.

The two Supports() forms. Delphi has two overloads:

// 1. Boolean test function Supports(AObject: TObject; const IID: TGUID): Boolean;

// 2. Combined test + assignment (the useful one) function Supports(AObject: TObject; const IID: TGUID; out Intf): Boolean;

In Blaise, without GUIDs, the second argument is an interface type identifier rather than a GUID. The most natural design is to treat Supports as a compiler intrinsic (like is/as) rather than a library function, because the second argument isn't a runtime value — it names a type.

So Blaise code looks like this:

if Supports(Obj, IFoo) then ... // boolean test if Supports(Obj, IFoo, FooRef) then ... // test + assign fat pointer

For me the only reason to use pascal is GUI apps but this doesn't have it.
I have not used Pascal, but things that appeal to me (other than GUI apps) are that it seems simple to learn, and is readable, fast and compiles fast.

What languages would be better in these ways?

You can use Lazarus from a C interface - via liblcl. There are bindings for Go and Nim that use this method. Given the QBE backend, this may be one possible route for Blaise but needs investigation.
Congratulations on your projects, Graeme! When Blaise gets an IDE, make sure the editor component is modern, pleasant to work with (like vscode, for example) and with proper support for fonts. All things that Lazarus missed.
Does this support declaring variables anywhere (as opposed to only in the beginning of a function)? That was my primary complaint when using Lazarus.
“ The Object Pascal ecosystem has two options: Embarcadero Delphi (proprietary, Windows-first) and Free Pascal…”

This part isn’t true, for many years now we’ve also had Oxygene - https://www.remobjects.com/elements/oxygene/ (also proprietary)

From somebody that used to live in the Delphi world for about a decade: very nice!
Sorry, I don't trust a compiler project that's done in 3 weeks (I've checked the repo commits history). Downvote this if you want.
Excited to see another project targeting the QBE back end, from what I can tell it's a great lightweight alternative to LLVM.
Initially, I was skeptical and thought that this is the millionth vibe-coded project that will die once the author gets bored.

However, when I checked who the author is, I found he is is Graeme Geldenhuys, the author of the fpGUI library [1]. He surely has a lot of experience with FreePascal and the Pascal language, and in these years he has proven to be a committed worker (fpGUI exists since 2010!). So, this project seems to start on good grounds!

I really hope it will gain traction, as I have often wondered myself why somebody would not create a “clean” Pascal compiler from scratch with no legacy cruft and good defaults (e.g., UTF-8 strings, inline variable declaration).

[1]: https://fpgui.sourceforge.net/

That looks cool. If they support binary releases on macOS Apple Silicon I will try it out.

I wrote one major project in UCSD Pascal on Apple II 45 years ago: my Honnibo Warrior Go Playing program. For its time, a fantastic dev environment.

Will you port it to 32 bit? There's already a QBE port for it.
I'm actually really happy to see a fresh "just Pascal", and one that is aiming for a slim bootstrap at that.
But no with statement. :(

I find with-style code so convenient that I recreate it in other languages (auto _=&foo; ...)

What a great option to have! All of the good parts of Pascal and non of the baggage