frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Zig Devlog: Self-Hosted x86 Back End Is Now Default in Debug Mode

https://ziglang.org/devlog/2025/#2025-06-08
80•brson•6h ago

Comments

treeshateorcs•5h ago
so, a helloworld program (`zig init`) is 9.3MB compiled. compared to `-Doptimize=ReleaseSmall` 7.6KB that is huge (more than 1000 times larger)
AndyKelley•5h ago
Indeed, good observation. Another observation is that 82% of that is debug info.

-OReleaseSmall -fno-strip produces a 580K executable, while -ODebug -fstrip produces a 1.4M executable.

zig's x86 backend makes for a significantly better debugging experience with this zig-aware lldb fork: https://github.com/ziglang/zig/wiki/LLDB-for-Zig

I don't recall whether it supports stepping through comptime logic at the moment; that was something we discussed recently.

Retro_Dev•5h ago
As far as I know, Zig has a bunch of things in the works for a better development experience. Almost every day there's something being worked on - like https://github.com/ziglang/zig/pull/24124 just now. I know that Zig had some plans in the past to also work on hot code swapping. At this rate of development, I wouldn't be surprised if hot code swapping was functional within a year on x86_64.

The biggest pain point I personally have with Zig right now is the speed of `comptime` - The compiler has a lot of work to do here, and running a brainF** DSL at compile-time is pretty slow (speaking from experience - it was a really funny experiment). Will we have improvements to this section of the compiler any time soon?

Overall I'm really hyped for these new backends that Zig is introducing. Can't wait to make my own URCL (https://github.com/ModPunchtree/URCL) backend for Zig. ;)

bgthompson•4h ago
Hot code swapping will be huge for gamedev. The idea that Zig will basically support it by default with a compiler flag is wild. Try doing that, clang.
Retro_Dev•4h ago
Totally agree with that - although even right now zig is excellent for gamedev, considering it's performant, uses LLVM (in release modes), can compile REALLY FAST (in debug mode), it has near-seamless C integration, and the language itself is really pleasant to use (my opinion).
AndyKelley•3h ago
For comptime perf improvements, I know what needs to be done - I even started working on a branch a long time ago. Unfortunately, it is going to require reworking a lot of the semantic analysis code. Something that absolutely can, should, and will be done, but is competing with other priorities.
9d•3h ago
Have you considered hiring people to help you with these tasks so you can work in parallel and get more done quicker?
AndyKelley•2h ago
It's a funny question because, as far as I'm aware, Zig Software Foundation is the only organization among its peers that spends the bulk of its revenue directly paying contributors for their time - something I'm quite proud of.
9d•2h ago
Oh so then you're already doing that. Well then that's fine, the tasks will get done when they get done then.
lenkite•18m ago
Thank you for working so hard on Zig. Really looking forward to Zig 1.0 taking the system programming language throne.
ww520•2h ago
Is comptime slowness really an issue? I'm building a JSON-RPC library and heavily relying on comptime to be able to dispatch a JSON request to arbitrary function. Due to strict static typing, there's no way to dynamically dispatch to a function with arbitrary parameters in runtime. The only way I found was figuring the function type mapping during compile time using comptime. I'm sure it will blow up the code size with additional copies of the comptimed code with each arbitrary function.
Okx•1h ago
Yes, last time I checked, Zig's comptime was 20x slower than interpreted Python. Parsing a non-trivial JSON file at comptime is excrutiatingly slow and can take minutes.
bgthompson•5h ago
This is already such a huge achievement, yet as the devlog notes, there is plenty more to come! The idea of a compiler modifying only the parts of a binary that it needs to during compilation is simultaneously refreshing and totally wild, yet now squarely within reach of the Zig project. Exciting times ahead.
9d•3h ago
> For a larger project like the Zig compiler itself, it takes the time down from 75 seconds to 20 seconds. We’re only just getting started.

Excited to see what he can do with this. He seems like a really smart guy.

What's the package management look like? I tried to get an app with QuickJS + SDL3 working, but the mess of C++ pushed me to Rust where it all just works. Would be glad to try it out in Zig too.

stratts•2h ago
Package management in Zig is more manual than Rust, involving fetching the package URL using the CLI, then importing the module in your build script. This has its upsides - you can depend on arbitrary archives, so lots of Zig packages of C libraries are just a build script with a dependency on a unmodified tarball release. But obviously it's a little trickier for beginners.

SDL3 has both a native Zig wrapper: https://github.com/Gota7/zig-sdl3

And a more basic repackaging on the C library/API: https://github.com/castholm/SDL

For QuickJS, the only option is the C API: https://github.com/allyourcodebase/quickjs-ng

Zig makes it really easy to use C packages directly like this, though Zig's types are much more strict so you'll inevitably be doing a lot of casting when interacting with the API

LAC-Tech•17m ago
It's also worth pointing out that the Zig std library covers a lot more than the rust one. No need for things like rustix, rand, hashbrown, and a few others I always have to add whenever I do rust stuff.
9d•3h ago
> And we’re looking at aarch64 next - work that is expected to be accelerated thanks to our new Legalize pass.

Sorry, what?

garbagepatch•5m ago
It seems to be Zig's equivalent to this part of LLVM: https://llvm.org/docs/GlobalISel/Legalizer.html
VWWHFSfQ•2h ago
I'm interested in Zig but kind of discouraged by the 30 pages of open issues mentioning "segfault" on their Github tracker. It's disheartening for a systems programming language being developed in the 21st century.
AndyKelley•2h ago
I see 40 pages in rust-lang/rust. Are you sure this heuristic is measuring what you think it's measuring?
VWWHFSfQ•2h ago
Oh I wasn't comparing to Rust. But just a quick glance between the two repos shows a pretty big difference between the nature of the "segfault" issues reported.

yikes... https://github.com/ziglang/zig/issues/23556

steveklabnik•2h ago
Every mature compiler (heck, project of any kind) has thousands of bugs open. It’s just a poor metric.
VWWHFSfQ•2h ago
Yep and like I said, I'm interested in Zig. But it's still somewhat discouraging as a C replacement just because it seems to still have all the same problems but without the decades of tools and static analyzers to help out. But I'm keeping an eye on it.
stratts•1h ago
What's the state of the art here?

Most of Zig's safety, or lack thereof, seems inherent to allowing manual memory management, and at least comparable to its "C replacement" peers (Odin, C3, etc).

ArtixFox•1h ago
I guess formal verification tools? That is the peak that even rust is trying to reach with creusot and friends. Ada has support for it using Spark subset [which can use why3 or have you write the proofs in coq] Frama-C exists for C. Astree exists for C++ but i dont think lone developers can access it. But it is used in Boeing.
ArtixFox•1h ago
Im pretty sure valgrind and friends can be used in zig.

Zig is still not 1.0, theres not much stability guarantees, making something like Frama-C, even tho it is possible is simply going to be soo much pain due to constant breakages as compared to something like C.

But it is not impossible and there have been demos of refinement type checkers https://github.com/ityonemo/clr

Beyond that, tools like antithesis https://antithesis.com/ exist that can be used for checking bugs. [ I dont have any experience with it. ]

garbagepatch•11m ago
No shame in waiting until 1.0. There's other production ready languages you can use right now so you can ignore Zig until then.
9d•2h ago
That's about size and popularity, not maturity.

Several very popular, small, mature projects have zero or few open issues.

(And several mature, huge and unpopular ones too.)

mirekrusin•1h ago
Sounds like Julia should consider switching to Zig to get considerable performance gains. I remember authors feeling uneasy with each llvm release worrying about performance degradations.
bobbylarrybobby•20m ago
Isn't LLVM considered part of Julia’s public API? You've got macros like @code_llvm that actually give you IR
foresto•6m ago
Isn't this one of the preconditions for bringing async/await back to Zig?

https://github.com/ziglang/zig/wiki/FAQ#what-is-the-status-o...

FSE meets the FBI

https://blog.freespeechextremist.com/blog/fse-vs-fbi.html
136•1337p337•2h ago•14 comments

Why Android can't use CDC Ethernet (2023)

https://jordemort.dev/blog/why-android-cant-use-cdc-ethernet/
175•goodburb•7h ago•80 comments

Building supercomputers for autocrats probably isn't good for democracy

https://helentoner.substack.com/p/supercomputers-for-autocrats
199•rbanffy•7h ago•111 comments

Riding high in Germany on the world's oldest suspended railway

https://www.theguardian.com/travel/2025/jun/09/riding-high-in-germany-on-the-worlds-oldest-suspended-railway
49•pseudolus•5h ago•8 comments

Zig Devlog: Self-Hosted x86 Back End Is Now Default in Debug Mode

https://ziglang.org/devlog/2025/#2025-06-08
80•brson•6h ago•33 comments

Tracking Copilot vs. Codex vs. Cursor vs. Devin PR Performance

https://aavetis.github.io/ai-pr-watcher/
95•HiPHInch•3d ago•47 comments

Omnimax

https://computer.rip/2025-06-08-Omnimax.html
94•aberoham•8h ago•26 comments

The wire that transforms much of Manhattan into one big, symbolic home (2017)

https://www.atlasobscura.com/articles/eruv-manhattan-invisible-wire-jewish-symbolic-religious-home
60•rmason•8h ago•63 comments

Administering immunotherapy in the morning seems to matter. Why?

https://www.owlposting.com/p/the-time-of-day-that-immunotherapy
134•abhishaike•12h ago•94 comments

Panjandrum: The 'giant firework' built to break Hitler's Atlantic Wall

https://www.bbc.com/future/article/20250603-the-giant-firework-built-to-break-hitlers-atlantic-wall
94•rmason•4d ago•62 comments

Endangered classic Mac plastic color returns as 3D-printer filament

https://arstechnica.com/apple/2025/06/new-filament-lets-you-3d-print-parts-in-authentic-1980s-apple-computer-color/
83•CobaltFire•4d ago•13 comments

Analyzing IPv4 Trades with Gnuplot

https://ipv4a-5539ad.gitlab.io/
26•todsacerdoti•3h ago•3 comments

My first attempt at iOS app development

https://mgx.me/my-first-attempt-at-ios-app-development
102•surprisetalk•4d ago•57 comments

Show HN: Let’s Bend – Open-Source Harmonica Bending Trainer

https://letsbend.de
87•egdels•12h ago•17 comments

Software Is About Promises

https://www.bramadams.dev/software-is-about-promises/
11•_bramses•4h ago•1 comments

Gaussian integration is cool

https://rohangautam.github.io/blog/chebyshev_gauss/
154•beansbeansbeans•20h ago•31 comments

How to get started with writing tech video essays

24•sonderotis•3d ago•8 comments

Joining Apple Computer (2018)

https://www.folklore.org/Joining_Apple_Computer.html
400•tosh•1d ago•116 comments

How Compiler Explorer Works in 2025

https://xania.org/202506/how-compiler-explorer-works
133•vitaut•4d ago•22 comments

Poison everywhere: No output from your MCP server is safe

https://www.cyberark.com/resources/threat-research-blog/poison-everywhere-no-output-from-your-mcp-server-is-safe
95•Bogdanp•6h ago•51 comments

Cheap yet ultrapure titanium might enable widespread use in industry (2024)

https://phys.org/news/2024-06-cheap-ultrapure-titanium-metal-enable.amp
79•westurner•4d ago•55 comments

Generating Pixels One by One

https://tunahansalih.github.io/blog/autoregressive-vision-generation-part-1/
30•cyruseption•3d ago•1 comments

The last six months in LLMs, illustrated by pelicans on bicycles

https://simonwillison.net/2025/Jun/6/six-months-in-llms/
759•swyx•21h ago•188 comments

Self-Host and Tech Independence: The Joy of Building Your Own

https://www.ssp.sh/blog/self-host-self-independence/
430•articsputnik•1d ago•204 comments

I used AI-powered calorie counting apps, and they were even worse than expected

https://lifehacker.com/health/ai-powered-calorie-counting-apps-worse-than-expected
63•gnabgib•5h ago•39 comments

Binfmtc – binfmt_misc C scripting interface

https://www.netfort.gr.jp/~dancer/software/binfmtc.html.en
85•todsacerdoti•16h ago•21 comments

<Blink> and <Marquee> (2020)

https://danq.me/2020/11/11/blink-and-marquee/
208•ghssds•1d ago•162 comments

FAA to eliminate floppy disks used in air traffic control systems

https://www.tomshardware.com/pc-components/storage/the-faa-seeks-to-eliminate-floppy-disk-usage-in-air-traffic-control-systems
87•daledavies•21h ago•97 comments

Launching the BeOS on Hitachi Flora Prius Systems (1999)

http://testou.free.fr/www.beatjapan.org/mirror/www.be.com/support/guides/hitachi_boot.html
44•doener•14h ago•15 comments

Building an AI server on a budget

https://www.informationga.in/blog/building-an-ai-server-on-a-budget
98•mful•3d ago•54 comments