logoalt Hacker News

Zig ELF Linker Improvements Devlog

134 pointsby kristoff_ittoday at 5:29 PM20 commentsview on HN

Comments

onlyrealcuzzotoday 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
bpavuktoday 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 4 replies
librastevetoday 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 1 reply
teabee89today 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!

c0rruptbytestoday 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
derefrtoday 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 1 reply
ksectoday 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 1 reply
quikoatoday 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?

bcardarellatoday 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