Zig ELF Linker Improvements Devlog
128 points
3 hours ago
| 8 comments
| ziglang.org
| HN
bpavuk
2 hours ago
[-]
I am so used to thinking that Zig, Rust, and the likes are only viable in niches where C is viable, but no. not anymore at least - once this linker and incremental compilation on other targets land, Zig will become THE C replacement and that will let me iterate at the speed of JS or Python with performance of C or Rust. even Andrew's initial dream - to create a DAW with uncompromising UX - will become much easier to create. once someone creates a Zig-native immediate-mode or reactive UI framework, that is.

I am still a little salty about `@cImport` removal, though! without it, I can't confidently call it "Kotlin of C" anymore.

reply
gliptic
18 minutes ago
[-]
> Zig-native immediate-mode

dvui?

reply
librasteve
1 hour ago
[-]
There has been some speculation about porting the Raku backend (Meta-Object Aware Runtime Virtual Machine - MOARVM)from C to Zig. For example the wider set of Zig Hash options could be a big optimization.

Since you ask, the front end is self hosting in NQP and with the ripening RakuAST project increasingly in Raku Grammars. The new AST (6.e.PREVIEW) will bring much better introspection and high level optimization handles. So the potential to refactor/rewrite the VM for substantial speed gains is wide open.

Anyway those with skills and interest are welcome to join the -Ofun at https://raku.org/community

reply
nagaiaida
47 minutes ago
[-]
minor correction, moar stands for metamodel on a runtime, not meta-object aware runtime
reply
c0rruptbytes
16 minutes ago
[-]
i'm not cool and hip like hacker news devs, but I've been seeing Zig a lot, is this the new cool thing on the street? no more Rust?
reply
agluszak
11 minutes ago
[-]
Zig's been around for ~10 years. It's more low-level and lightweight than Rust. Different goals, different trade-offs. If Rust is the new C++, Zig is the new C.
reply
c0rruptbytes
10 minutes ago
[-]
> If Rust is the new C++, Zig is the new C.

thank you, this helps!

reply
teabee89
3 hours ago
[-]
This is the promise that blew my mind the first time I heard about Zig years ago. So happy to see this become reality!
reply
ksec
1 hour ago
[-]
Are there any other languages that offer similar compilation performance. The only one I know of or remember is Turbo Pascal.
reply
mgrandl
41 minutes ago
[-]
Isn’t go (with cgo disabled) still at least as fast to compile?
reply
derefr
2 hours ago
[-]
So, this linker does fast incremental linking, which is great for development iteration speed.

But I assume that any kind of incremental linking, is mutually exclusive with link-time optimization? I.e. you'd never want to use this option for a release build?

reply
quikoa
2 hours ago
[-]
These improvements are quite promising and I'm looking forward to giving that a spin once it is released.

Will the Windows side for 0.17.x get some compiler improvements as well or is this Linux only?

reply
bcardarella
2 hours ago
[-]
I wonder how much this work being pushed forward right now is a response to the Bun drama.
reply
kristoff_it
2 hours ago
[-]
None of it, we've been working on this stuff for a long time already, scroll the devlog backwards, you will find plenty of entries on that topic.

It's the opposite: people have become more receptive to communication about this work now that there's "drama" attached to it.

This post I co-authored with Andrew is from 2020. In it we announce the idea of getting rid of LLVM from the debug build pipeline and since then work has been steadily going forward, it's just not trivial to bootstrap a full compiler pipeline for all major targets, but we're finally getting there.

https://kristoff.it/blog/zig-new-relationship-llvm/

reply
bcardarella
2 hours ago
[-]
I'm very glad to see the work, thank you for all of the efforts.
reply
cafebabbe
1 hour ago
[-]
There is absolutely no "Bun drama", there are just two projects with different goals and methodologies, mutually incompatible. All this thing is just a small bunch of bored, terminally-twitting people ...

In any case, I'm super glad for this milestone (and impressed!).

reply
dzbarsky
2 hours ago
[-]
None? All of these things were in flight for a while and given Zigs anti-AI stance i think they wrote off Bun ever since the acquisition
reply
mi_lk
2 hours ago
[-]
Some people really can’t operate without stirring unnecessary drama.

What if that’s true and what if that’s not true?

reply