logoalt Hacker News

Zig ELF Linker Improvements Devlog

220 pointsby kristoff_ityesterday at 5:29 PM94 commentsview on HN

Comments

bpavukyesterday at 6:19 PM

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.

show 6 replies
onlyrealcuzzoyesterday at 9:13 PM

I've been building a memory safe language that transpiles to Zig with a Go-like runtime that can run interpreted (no GC) or compiled - high-level that feels like Ruby but with incremental typing like TypeScript.

The Zig team between 0.16 and this has really made me glad I chose Zig as the target instead of Rust - which probably would've been a lot easier to target (since it's already memory safe).

I believed it had the best build system design and was the best transpilation target, and I really believe that 6 months later.

The main reason I wanted no GC is because I think aliasing is the root of all evil, and I want a language with zero global complexity (but doesn't require a PhD to use).

show 1 reply
librasteveyesterday at 7:43 PM

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

show 3 replies
setherontoday at 3:07 PM

Is there a design dock or explanation about how it can do incremental linking?

It's evaded other linkers in the past: gcc, llvm, mold etc....

teabee89yesterday at 5:57 PM

This is the promise that blew my mind the first time I heard about Zig years ago. So happy to see this become reality!

derefryesterday at 6:42 PM

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?

show 2 replies
ksecyesterday at 7:39 PM

Are there any other languages that offer similar compilation performance. The only one I know of or remember is Turbo Pascal.

show 2 replies
up2isomorphismtoday at 2:25 PM

I don’t think either zig or rust can replace C, no matter how much this kind of work. They will of course improve its own language. The only language that can replace C is a language is as simple as C. None of them are simple language.

androiddrewyesterday at 10:58 PM

I really would like a 1.0, then I think it can actually be adopted by business.

quikoayesterday at 6:21 PM

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?

show 1 reply
c0rruptbytesyesterday at 8:42 PM

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?

show 1 reply
bcardarellayesterday at 6:11 PM

I wonder how much this work being pushed forward right now is a response to the Bun drama.

show 4 replies