frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Zig Interface Revisited

https://williamw520.github.io/2025/07/13/zig-interface-revisited.html
42•ww520•3d ago

Comments

ozgrakkurt•2d ago
Also can add compilation time as an upside to vtables.

And using vtable in code feels cleaner compared to using generics

kingstnap•2h ago
You've put the

pub fn implBy(impl_obj: anytype) Logger

Function in a weird place. Normal practice is for the specific implementations to have a getLogger function to create the logger. For example, the allocators in Zig have you instantiate the top level and then call .allocator() on them to get the vtable + pointer to self.

It manages sanity a lot better, and the function implementations in the vtable can be private.

lenkite•1h ago
Would it truly kill Zig to add native interface support ? All that ceremony is quite heavy and also somewhat error prone.

If nothing else, maybe they can add some helpers in the standard lib or codegen in the standard tooling to make stuff like this easier ? So one need not manually code all the function pointer types for methods and the dispatch in the interface type .

Yes, Zig is meant to be a low-level programming language, but stuff like this is basic table stakes nowadays. People will just make custom code generators after Zig 1.0 to do this exact thing - and they will likely be dozens of such custom code generators with subtle differences.

thechao•52m ago
I wonder if it's possible to not lock themselves into an ABI with a built in vtable implementation? I kinda get where they're coming from: let vtables be a user problem; but, yeah, modern compilers can do magic when they "know" the rules for built in vtables. It kinda feels like they're leaving a real performance opportunity on the ground?
wavemode•17m ago
There's just one feature Zig lacks, which would have allowed for full automation of interface definitions. In Zig you can programmatically construct data types with compile-time programming, but such types aren't allowed to have methods: https://github.com/ziglang/zig/issues/6709

This is an intentional limitation, because the language creator worries the feature would be abused.

int_19h•24m ago
This is like the inverse of the normal C++ vtable. Normally the whole point of having a separate vtable (as opposed to just a bunch of function pointers directly in the struct) is so that you can share a single one between all instances, at the cost of one extra indirection. But here a copy of the vtable is instead attached to one individual instance, and yet it still does this one extra indirection to get to the implementation object.

The borrowchecker is what I like the least about Rust

https://viralinstruction.com/posts/borrowchecker/
43•jakobnissen•51m ago•25 comments

2025 Infrastructure Report Card

https://infrastructurereportcard.org/
18•jonbaer•37m ago•2 comments

What the Fuck Python

https://colab.research.google.com/github/satwikkansal/wtfpython/blob/master/irrelevant/wtf.ipynb
25•sundarurfriend•1h ago•6 comments

OpenAI claims gold-medal performance at IMO 2025

https://twitter.com/alexwei_/status/1946477742855532918
305•Davidzheng•11h ago•484 comments

MCP Security Vulnerabilities and Attack Vectors

https://forgecode.dev/blog/prevent-attacks-on-mcp/
96•tested1•2h ago•7 comments

TSMC to start building four new plants with 1.4nm technology

https://www.taipeitimes.com/News/front/archives/2025/07/20/2003840583
16•giuliomagnifico•26m ago•6 comments

Make Your Own Backup System – Part 1: Strategy Before Scripts

https://it-notes.dragas.net/2025/07/18/make-your-own-backup-system-part-1-strategy-before-scripts/
7•Bogdanp•36m ago•0 comments

The Curious Case of the Unix workstation layout

https://thejpster.org.uk/blog/blog-2025-07-19/
32•ingve•4h ago•7 comments

Babies made using three people's DNA are born free of mitochondrial disease

https://www.bbc.com/news/articles/cn8179z199vo
166•1659447091•2d ago•95 comments

Rethinking CLI interfaces for AI

https://www.notcheckmark.com/2025/07/rethinking-cli-interfaces-for-ai/
76•Bogdanp•3h ago•52 comments

Fstrings.wtf

https://fstrings.wtf/
320•darkamaul•9h ago•94 comments

Show HN: Am-I-vibing, detect agentic coding environments

https://github.com/ascorbic/am-i-vibing
17•ascorbic•4h ago•2 comments

Pimping My Casio: Part Deux

https://blog.jgc.org/2025/07/pimping-my-casio-part-deux.html
142•r4um•12h ago•41 comments

Zig Interface Revisited

https://williamw520.github.io/2025/07/13/zig-interface-revisited.html
42•ww520•3d ago•6 comments

The tech that the US Post Office gave us

https://www.theverge.com/report/709749/usps-250th-anniversary-pioneer-modern-technology
13•01-_-•46m ago•0 comments

Linux and Secure Boot certificate expiration

https://lwn.net/SubscriberLink/1029767/08f1d17c020e8292/
202•pabs3•1d ago•231 comments

How we tracked down a Go 1.24 memory regression

https://www.datadoghq.com/blog/engineering/go-memory-regression/
70•gandem•2d ago•6 comments

N78 band 5G NR recordings

https://destevez.net/2025/07/n78-band-5g-nr-recordings/
42•Nokinside•2d ago•0 comments

Hyatt Hotels are using algorithmic Rest “smoking detectors”

https://twitter.com/_ZachGriff/status/1945959030851035223
601•RebeccaTheDev•16h ago•351 comments

A 14kb page can load much faster than a 15kb page (2022)

https://endtimes.dev/why-your-website-should-be-under-14kb-in-size/
387•truxs•11h ago•264 comments

Piramidal (YC W24) is hiring a full stack engineer

https://www.ycombinator.com/companies/piramidal/jobs/JfeI3uE-full-stack-engineer
1•dsacellarius•8h ago

Local LLMs versus Offline Wikipedia

https://evanhahn.com/local-llms-versus-offline-wikipedia/
9•EvanHahn•3h ago•2 comments

Piano Keys

https://www.mathpages.com/home/kmath043.htm
5•gametorch•3d ago•1 comments

My Self-Hosting Setup

https://codecaptured.com/blog/my-ultimate-self-hosting-setup/
489•mirdaki•17h ago•173 comments

What the Internet Was Like in 1998

https://cybercultural.com/p/internet-1998/
38•herbertl•3d ago•25 comments

Postgres to ClickHouse: Data Modeling Tips

https://clickhouse.com/blog/postgres-to-clickhouse-data-modeling-tips-v2
6•saisrirampur•2h ago•0 comments

North America's Oldest Known Pterosaur

https://www.si.edu/newsdesk/releases/smithsonian-led-team-discovers-north-americas-oldest-known-pterosaur
12•gmays•4d ago•4 comments

A CarFax for Used PCs: Hewlett Packard wants to give old laptops new life

https://spectrum.ieee.org/carfax-used-pcs
37•miles•4d ago•35 comments

'Universal cancer vaccine' trains the immune system to kill any tumor

https://newatlas.com/cancer/universal-cancer-vaccine/
14•01-_-•45m ago•0 comments

Valve confirms credit card companies pressured it to delist certain adult games

https://www.pcgamer.com/software/platforms/valve-confirms-credit-card-companies-pressured-it-to-delist-certain-adult-games-from-steam/
811•freedomben•1d ago•792 comments