frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Zig's new I/O: function coloring is inevitable?

https://blog.ivnj.org/post/function-coloring-is-inevitable
12•ivanjermakov•6h ago

Comments

audunw•5h ago
I really don’t agree with the idea that this is functional colouring. Then we have to start talking about function colouring in a whole bunch of new contexts like with Zigs explicit passing of allocator. Or any other parameter that needs to be explicitly passed to use some kind of interface.

I think we should stick to talking about colouring when there is special calling conventions or syntax, which has the consequence of having to write separate libraries/modules for async code and non-async code.

That is the significant problem we have been seeing with many async implementation, and the one which Zig apparently fully solves.

camgunz•1h ago
Look, either you move the program counter to a different place in memory (function call) or you push a task into an event loop. Even if you somehow elide all these differences, they're so different under the hood you'll always have to know in some circumstances. It's honestly wild we conflate them at all.
kristoff_it•56m ago
If you want to go down that route, any function that has, or doesn't have, any given resource is colored then.

   fn foo(db: *Db) !void { ... }
   fn bar() !void { ... }
Would you consider `foo` a blue function and `bar` a red function? That doesn't seem particularly helpful to me.

The virality of async await is that once you mark a function async, then you can only call it from another async function, which forces you to mark more functions async, which in turn means that if you want to use blocking I/O APIs then you just can't because it's incompatible with your execution model because by daring to express asynchronicity of operations, you were forcefully opted into stackless coroutines.

That's what Zig solves, and that's what is real function coloring. People have written reimplementations of the same libraries multiple times because of it.

https://github.com/redis/redis-py https://github.com/jonathanslenders/asyncio-redis

Just as an example. Note also how, coincidentally, this duplication of effort resulted in asyncio-redis being semi-abandoned and looking for maintainers. And you have to have both libraries because the asyncio one can't do blocking, and vice versa the other one can't do async.

Would you write two instances of essentially the same library just because one is missing an argument that gives it access to an `Io` interface? No, because you would just pass that extra argument around and nothing else would have to change.

orphea•56m ago
Related discussion (Zig's New Async I/O): https://news.ycombinator.com/item?id=44545949

Ask HN: Battery Life for Graphical Linux VMs (Or Asahi) on Apple Silicon Laptops

1•evertedsphere•24s ago•0 comments

Single nuclear spin detection and control in a van der Waals material

https://www.nature.com/articles/s41586-025-09258-7
1•Bluestein•2m ago•0 comments

CTE and normal aging are difficult to distinguish

https://news.northwestern.edu/stories/2025/07/cte-and-normal-aging-are-difficult-to-distinguish-new-study-finds/?fj=1
1•geox•8m ago•0 comments

Show HN: A Lisp for code generation and metaprogramming in non-Lisp languages

https://antilisp.com/
1•antilisp•12m ago•0 comments

Ask HN: Business logic that runs everywhere – would you use it?

1•bTal•16m ago•1 comments

AceMagic V1 Vista: Power Efficient Intel N150 Proxmox Setup for Frigate NVR

https://www.michaelstinkerings.org/acemagic-v1-vista-your-tiny-power-efficient-proxmox-server-for-frigate-nvr-and-beyond/
1•transpute•17m ago•0 comments

Bhutan Bets on Binance Pay to Power Crypto-Backed Tourism Economy

https://www.coindesk.com/markets/2025/06/30/bhutan-bets-on-binance-pay-to-power-crypto-backed-tourism-economy
1•PaulHoule•18m ago•0 comments

Let's Learn x86-64 Assembly Part 0 – Setup and First Steps

https://gpfault.net/posts/asm-tut-0.txt.html
8•90s_dev•18m ago•3 comments

Ask HN: How are you reviewing code with Claude Code?

1•learnedbytes•20m ago•0 comments

Ask HN: How do you handle charging users for AI usage?

2•copypaper•21m ago•0 comments

A universal interface connecting you to today's AI models

https://tenzorro.com/en/models
1•paulo20223•23m ago•0 comments

Ask HN: SDETs and SWEs, how do you use AI when writing unit tests?

1•ashbate•27m ago•0 comments

Efficient Document Clustering (2008)

https://patents.google.com/patent/US8200670B1/en
1•sandwichsphinx•29m ago•0 comments

Postman to Bruno: A Weekend Migration That Transformed Our API Workflow

https://ashwch.com/from-postman-to-bruno-how-ai-changed-our-api-workflow.html
2•ashwch•31m ago•1 comments

Fears 'stable' Patagonia glacier in irreversible decline

https://www.theguardian.com/environment/2025/jul/11/glacier-patagonia-perito-moreno-decline
1•littlexsparkee•35m ago•0 comments

Track Aipac

https://www.trackaipac.com
3•i_love_retros•37m ago•0 comments

Generating (almost) equally-spaced points along a parabola

https://arjuns07.github.io/posts/07-2025-equidistant-parabolic-points/
2•sharma-arjun•47m ago•0 comments

Scary Cool Sad Goodbye 77 Up in Northern Michigan's Lynchian Underbelly

https://scarycoolsadgoodbye.substack.com/p/scary-cool-sad-goodbye-77
2•rmason•48m ago•0 comments

Adventures in Data Corruption

https://oxide-and-friends.transistor.fm/episodes/adventures-in-data-corruption
1•davepeck•51m ago•0 comments

Advice on Building Voice AI in June 2025

https://www.daily.co/blog/advice-on-building-voice-ai-in-june-2025/
1•javiercr•51m ago•0 comments

A chrome extension that detects malicious websites

https://cheztrap.com/
1•SuperLordPanda•1h ago•1 comments

State of GPGPU and the JVM

https://www.youtube.com/watch?v=qkr3E27XYbY
1•seinecle•1h ago•0 comments

China Biotech's Advance Is Changing the Drug Pipeline

https://www.bloomberg.com/news/features/2025-07-13/china-drugmakers-catching-up-to-us-big-pharma-with-new-medicine-innovation
1•melling•1h ago•1 comments

Traditional Chinese Medicine Has Not Been Vindicated by Science

https://www.mcgill.ca/oss/article/medical-critical-thinking-health-and-nutrition/no-traditional-chinese-medicine-has-not-been-vindicated-science
26•mgh2•1h ago•2 comments

Lt. Columbo (Peter Falk) Roasts Frank Sinatra (1978) [video]

https://www.youtube.com/watch?v=3_UN2S8SasY
3•B1FF_PSUVM•1h ago•0 comments

Defending Against Prompt Injection with a Few DefensiveTokens

https://arxiv.org/abs/2507.07974
1•belter•1h ago•0 comments

Daily Notes Considered Harmful

https://literallythevoid.com/daily-notes-considered-harmful/
5•FigurativeVoid•1h ago•1 comments

Show HN: Shadow VCS quarantines AI generated commits before they break your repo

https://github.com/AKIFQ/sav
1•akifq•1h ago•0 comments

Tim Cook Has Outpaced Jobs in Shareholder Value, but AI Era Exposes Weaknesses

https://fortune.com/2025/07/12/apple-ceo-tim-cook-leadership-stock-outlook-ai-strategy/
2•geoffbp•1h ago•0 comments

The human harbor: Navigating identity and meaning in the AI age

https://venturebeat.com/ai/the-human-harbor-navigating-identity-and-meaning-in-the-ai-age/
2•Bluestein•1h ago•0 comments