Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
31–40 of 59 posts
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#32However, 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).
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#33Sorry, 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.
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#34Excited to see another project targeting the QBE back end, from what I can tell it's a great lightweight alternative to LLVM.
Only downside is Windows support.
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#35Initially, 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…
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#36Looks 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?
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
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#37Looks 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?
Not the OP, but I can answer with an objection to COM-style GUIDs myself. Delphi's interfaces are heavily based around COM, and so you need GUIDs, ARC, etc. But interfaces as a concept don't require the COM backend. If you want your code to be cleanly separated, but don't want to split ownership/management models* (create/free vs ARC), and have no need for an interface and type identity to be managed outside your cod…
Delphi is just very Windows-centric with a lot of things they do.
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#38For me the only reason to use pascal is GUI apps but this doesn't have it.
[1] Homepage (terrible looking): https://fpgui.sourceforge.net/ [2] Github repo: https://github.com/graemeg/fpGUI/ The Discussion area has some interesting conversations and screenshots.
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#39I 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.
Re: Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE
#40Can this compile these games? https://jxself.org/git/supernova.git https://jxself.org/git/beyond-the-titanic.git Ok, there's no way to bootstrap it without FPC... can the compiler compile itself?
Yes, Blaise reached self-hosting after just 7 days. Meaning it could compile itself, and was byte-for-byte identical to the bootstrapped version. The language was absolutely barebones, but that's not the goal at that stage. The first (FPC) compiled binary is called the Stage 1 binary. That binary then compiles the compiler code to make a Stage 2 binary (a read Blaise compiler binary). Then Stage 2 compiles the compiler code again to make a Stage 3 binary. Self-hosting is when the stage-2 binary and stage-3 binaries are byte-for-byte identical. Blaise has already achieved that.
I'm currently actively working on removing the FPC and GCC bootstrap requirements. After which Blaise would become it's own bootstrap compiler.