Harbour MiniGUI with 64-bit ZIG compiler

339 views
Skip to first unread message

Grigory Filatov

unread,
Oct 21, 2025, 10:03:54 AMOct 21
to Harbour Minigui
Good afternoon,

Let's continue a good news.

I've successfully tested the ZIG compiler snapshot 2025-10-17 with the newest MiniGUI build (64-bit). The support of this new compiler have been recently added to the Harbour. This compiler is compatible with MinGW binary as well.

Harbour Build Info
---------------------------
Version: Harbour 3.2.0dev (r2510192048)
Compiler: LLVM/Clang C 21.1 (https://github.com/ziglang/zig-bootstrap 1b08653ddc0b2770f51
Platform: Windows 11 or newer 10.0.22000
PCode version: 0.3
ChangeLog last entry: 2025-10-19 22:48 UTC+0200 Aleksander Czajczynski (hb fki.pl)
ChangeLog ID: 2f8dcbcf6097ba02e7b1a316ba0a6991342ba96a
Built on: Oct 20 2025 13:42:43

I've attached speed test results in the MT mode for your review.

And at the end there is a screenshot:
image.png

Is this interesting to anyone?

Your comments are very welcome!

Regards,
Grigory
hbspeed.txt

Marcos Jarrin

unread,
Oct 22, 2025, 9:55:17 AMOct 22
to Harbour Minigui
Hello everyone

This topic about using Zig in Harbour is quite interesting because Zig is gaining popularity as a modern and efficient language for systems programming. For those who are not familiar with Zig, here is a brief explanation in a few words:

Zig is a general-purpose programming language designed to offer a better and safer experience than C, while maintaining the control and performance of low-level languages. It has no hidden control flow or macros, making writing predictable and safe code easier. Additionally, it includes an integrated build system with native support for cross-compilation, which is ideal for developers working on multi-platform development.

Its ability to interoperate directly with C code makes it very attractive for modernization or integration projects, such as many developed in Harbour.


zig.jpg

Regards,
Marcos Jarrin

Grigory Filatov

unread,
Oct 23, 2025, 11:39:45 AMOct 23
to Harbour Minigui
Hello Marcos,

Thanks for your kind feedback.

I've attached the brief explanation elaborates on what the Zig compiler is, how it works as a C compiler replacement, and the extensive advantages this brings.

What's your opinion? Can this Zig compiler be considered a replacement for MinGW C in Harbour?

Thank you for your attention.

Regards,
Grigory

среда, 22 октября 2025 г. в 15:55:17 UTC+2, marcos...@gmail.com:
What Zig Compiler Is.docx

Grigory Filatov

unread,
Nov 1, 2025, 8:44:22 AMNov 1
to Harbour Minigui
Hi there,

Let's continue a good news.

I've successfully compiled the useful SQLRDD library using Zig as C compiler frontend.

Here is a screenshot of the MySQL client application as an example:
image.png

Your feedback is welcome.

Regards,
Grigory

четверг, 23 октября 2025 г. в 17:39:45 UTC+2, Grigory Filatov:

Marcos Jarrin

unread,
Nov 1, 2025, 8:05:13 PMNov 1
to Harbour Minigui
Hello everyone,

Interesting.

But I would need more information to give an opinion. I haven't programmed in ZIG, but I have in C and C++.
I would need to see how long it takes to compile, and I'm not referring to a single-file program with a few lines, but to projects with many PRGs and thousands of lines. How large are the resulting executables?
How efficient is it?
Other technical details.
How well do libraries written in C compile, for example, like LetoDBf, SQLite, etc.
On paper, ZIG looks excellent, but it needs to be tested.

A test, for example, would be:

Create a table with at least 1 million records with 10 indexes and observe the following details:

    A table with 50 fields: how long does it take to populate it with 1 million records.

    The time it takes to create simple and composite unique indexes.

    Simple: a numeric field. Complex: two or more fields with functions like ALLTRIM, formatting dates, etc.

    How long it takes for sequential and index-based searches.

    How efficient are the RDDs in ZIG.

Only after that could I give my opinion on whether ZIG is a good choice or not.
On paper, it says it's excellent, but real-world work shows if it's true.

Regards,

Marcos Jarrin

Grigory Filatov

unread,
Nov 2, 2025, 1:09:58 PMNov 2
to Harbour Minigui
Hello Marcos,

Many thanks for your kind feedback.

I have already compiled the "SuperChef Pizza" app (45 .prg files) with the following build log using 4 compilation threads:

hbmk2: Processing environment options: -plat=win -comp=zig
hbmk2: Using Harbour: c:\project\harbour\bin c:\project\harbour\include
       c:\project\harbour\lib\win\zig c:\project\harbour\bin
       c:\project\harbour\contrib c:\project\harbour\addons
hbmk2: Processing local make script: hbmk.hbm
hbmk2: Processing: ..\..\harbour\bin\zig.hbc
hbmk2: Compiling Harbour sources...
Harbour 3.2.0dev (r2510211120)
Copyright (c) 1999-2025, https://harbour.github.io/
Harbour 3.2.0dev (r2510211120)
Copyright (c) 1999-2025, https://harbour.github.io/
Harbour 3.2.0dev (r2510211120)
Copyright (c) 1999-2025, https://harbour.github.io/
Harbour 3.2.0dev (r2510211120)
Copyright (c) 1999-2025, https://harbour.github.io/
hbmk2: Compiling...
hbmk2: Linking... ..\..\bin\super.exe
hbmk2: Running time: 73s

The 64-bit executable size is 4,06 MB.
Everything works fine (see picture below).
super.png

I would like to clarify that we are not using the zig language, but rather using zig as a Clang backend compiler.

Thank you for your attention.

Regards,
Grigory

воскресенье, 2 ноября 2025 г. в 01:05:13 UTC+1, marcos...@gmail.com:
Message has been deleted

José Quintas

unread,
Nov 2, 2025, 7:30:49 PMNov 2
to Harbour Minigui

Is it easy to setup for zig ?

May be I could include a test on github machines.

The default, used to build harbour.


And about compatibility ?

There are commercial libraries that can't be compiled by zig.


José M. C. Quintas

Grigory Filatov

unread,
Nov 13, 2025, 1:22:54 PM (8 days ago) Nov 13
to Harbour Minigui
Good evening,

Let's continue a good news.

I've compiled IDE by Roberto Lopez using MiniGUI and Zig compiler 0.16.0dev.

You can see the result in the picture below:
ide.png

I've also compiled the repost example with this IDE as shown in this picture:
report_test.png

Thanks in advance for your feedback!

Best regards,
Grigory

вторник, 21 октября 2025 г. в 16:03:54 UTC+2, Grigory Filatov:

Grigory Filatov

unread,
Nov 14, 2025, 12:03:30 PM (7 days ago) Nov 14
to Harbour Minigui
Hi,

I have a small addendum: 'About' dialog and build.log file for this IDE.
about.png

Regards,
Grigory

четверг, 13 ноября 2025 г. в 19:22:54 UTC+1, Grigory Filatov:
build.log
Reply all
Reply to author
Forward
0 new messages