frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Async Programming Is Just Inject Time

https://willhbr.net/2026/03/02/async-inject-and-effects/
36•marvinborner•9h ago

Comments

gpderetta•8h ago
> Your CPU doesn’t know or care what functions are [...]

Well, most architectures do not use plain jumps with implicit arguments for function calls, but have explicit call/ret or branch-with-link instructions. Even those that used jumps had branch hints. The reason is that the microarchitecture must know about call/ret pairs to be able to predict the return path as the generic dynamic predictor is just not good enough for such a common path.

Reduced prediction performance compared normal calls is actually a concern for some coroutine and async code.

> in C we don’t have any dynamic lookup inside functions—every dynamic jump comes from an explicit conditional statement

function pointers.

adamnew123456•7h ago
> Well, most architectures do not use plain jumps with implicit arguments for function calls, but have explicit call/ret or branch-with-link instructions.

Anyone who wants to go deeper on this would be well served doing some reading on "return oriented programming" and shadow stacks / control flow integrity. I got turned onto this by a few LWN articles that talk about the subject (https://lwn.net/Articles/940403/ among others).

It turns out that "jump to this pointer" is actually a dangerous construct, and it's not something you get much high-level exposure to since functions as an abstraction are so unleaky.

rdevilla•8h ago
> To start with, you need to remember that functions don’t exist. They’re made up. They’re a social construct.

https://www.felixcloutier.com/x86/call

Sufficiently large distances of abstraction from the concrete, underlying mechanics are indistinguishable from religion and superstitious belief. Expect LLMs to widen this gap in understanding.

We are not far away from the tech priests of the Adeptus Mechanicus.

throwaway27448•7h ago
> Sufficiently large distances of abstraction from the concrete, underlying mechanics are indistinguishable from religion and superstitious belief.

Hell, you can apply this to all culture. Humans are not very rational or observant beings, despite how much some of us insist to the contrary. Basically any abstraction is a) going to be taken at face value, or on an assumption that the world is inherently structural, and b) the assumption is essentially guaranteed to either be inaccurate or tautological.

"Religion" was invented about 500 years ago to distinguish from the secularists, but the distance between them these days is mostly one of chosen ritual and the direction in which arrogance is spewed. After all, the church that persecuted Galileo was hardly any more irrational than the states we entrust nuclear weapons to is today.

hackingonempty•8h ago
> If you want to read more, I’d recommend starting with the Effekt and Koka language tours

Instead of exploring a research language that nobody uses you could try a mature effects system for a semi-popular language. I think Zio is great and runs on the JVM and ScalaJS. https://zio.dev/

tie-in•6h ago
It's also possible to implement a functional effect system in under 30 lines of JavaScript: https://lackofimagination.org/2025/11/managing-side-effects-...
jiehong•4h ago
I heard ocaml had one?
noelwelsh•7h ago
This article would benefit from an introduction that lays out the structure of what is to come. I'm expecting an article on effect systems, but it jumps straight into a chunky section on the implementation of function calls. I'm immediately wondering why this is here, and what is has to do with effect systems.

Also, this is a very operational description: how it works. It's also possible to give a denotational description: what it means. Having both is very useful. I find that people tend to start with the operational and then move to the denotational.

willhbr•7h ago
That's fair feedback, thanks

I focussed on how it works since that's what I set out to understand myself after seeing effects mentioned a few times

jcranmer•6h ago
> Your CPU doesn’t know or care what functions are

This has already been commented on by a couple of people, but yes, your CPU absolutely does care a lot about functions. At the very least, call/ret matching is important for branch prediction, but the big arches nowadays have shadow stacks and CFI checks that require you to use call/rets as regular functions. x86 has a more thoroughly built-in notion of functions, since they have a (since mostly-defunct) infrastructure for doing task switching via regular-ish call instructions.

> The toString method that gets called depends on the type of the receiver object. This isn’t determined at compile time, but instead a lookup that happens at runtime. The compiler effectively generates a switch statement that looks at the result of getClass and then calls the right method. It’s smarter than that for performance I’m sure, but conceptually that’s what it’s doing.

No, it's conceptually doing the exact opposite. Class objects have a vtable pointer, a pointer to a list of functions, and the compiler is reading the vtable and calling the n'th function via function pointer. The difference is quite important: vtables are an inherently open system (anyone can define their own vtable, if they're sufficiently crazy), but switches are inherently closed (the complete set of possible targets has to be known at compile-time). Not that I've written it up anywhere, but I've come to think of the closed nature of switch statements as fundamentally anathema to the ideals of object-oriented programming.

fanf2•5h ago
The vtable vs switch dichotomy was called the “expression problem” by Philip Wadler https://en.wikipedia.org/wiki/Expression_problem
jiehong•4h ago
> having to add IO effects to all functions

Sound like Haskell, and its Monads. I think it does end up being very similar in the end.

Would you compare effects and monads?

yunnpp•4h ago
I came here to ask the same question; did somebody just reinvent monads?

Also note that much of Haskell now uses MonadIO, so you are no longer constrained to IO or having to manually lift IO into your monad, so long as your monad instances MonadIO. This makes code reuse across libraries trivial. I say this because their div() example says that it can only be called from an Exception effect context, which is like old-school IO-everywhere Haskell. It seems to me like they're going to run into the function colour problem.

Ada 2022

https://www.adaic.org/ada-resources/standards/ada22/
53•tosh•1h ago•4 comments

Why it takes you and an elephant the same amount of time to poop (2017)

https://www.pbs.org/newshour/health/takes-elephant-amount-time-poop
39•Tomte•1h ago•33 comments

Anthropic, Please Make a New Slack

https://www.fivetran.com/blog/anthropic-please-make-a-new-slack
50•georgewfraser•1h ago•26 comments

Tech employment now significantly worse than the 2008 or 2020 recessions

https://twitter.com/JosephPolitano/status/2029916364664611242
455•enraged_camel•3h ago•314 comments

Show HN: Moongate – Ultima Online server emulator in .NET 10 with Lua scripting

https://github.com/moongate-community/moongatev2
189•squidleon•6h ago•111 comments

Hardening Firefox with Anthropic's Red Team

https://www.anthropic.com/news/mozilla-firefox-security
365•todsacerdoti•9h ago•109 comments

Open Camera is a FOSS Camera App for Android

https://opencamera.org.uk/
167•tetris11•4d ago•75 comments

Launch HN: Palus Finance (YC W26): Better yields on idle cash for startups, SMBs

25•sam_palus•2h ago•33 comments

Apache Otava

https://otava.apache.org/
32•djoldman•5d ago•2 comments

Payphone Go

https://walzr.com/payphone-go/
261•walz•4d ago•56 comments

CT Scans of Health Wearables

https://www.lumafield.com/scan-of-the-month/health-wearables
150•radeeyate•7h ago•33 comments

Triplet Superconductor

https://www.sciencedaily.com/releases/2026/02/260221000252.htm
25•jonbaer•4d ago•6 comments

Astra: An open-source observatory control software

https://github.com/ppp-one/astra
65•pppone•5h ago•17 comments

Entomologists use a particle accelerator to image ants at scale

https://spectrum.ieee.org/3d-scanning-particle-accelerator-antscan
65•gmays•5h ago•6 comments

Multifactor (YC F25) Is Hiring an Engineering Lead

https://www.ycombinator.com/companies/multifactor/jobs/lcpd60A-engineering-lead
1•multifactor•4h ago

LibreSprite – open-source pixel art editor

https://libresprite.github.io/
222•nicoloren•12h ago•73 comments

Workers who love ‘synergizing paradigms’ might be bad at their jobs

https://news.cornell.edu/stories/2026/03/workers-who-love-synergizing-paradigms-might-be-bad-thei...
450•Anon84•7h ago•259 comments

Analytic Fog Rendering with Volumetric Primitives (2025)

https://matejlou.blog/2025/02/11/analytic-fog-rendering-with-volumetric-primitives/
74•surprisetalk•1d ago•3 comments

Good Bad ISPs

https://community.torproject.org/relay/community-resources/good-bad-isps/
80•rzk•7h ago•25 comments

A tool that removes censorship from open-weight LLMs

https://github.com/elder-plinius/OBLITERATUS
55•mvdwoord•6h ago•26 comments

TSA leaves passenger needing surgery after illegally forcing her through scanner

https://www.thetravel.com/tsa-leaves-passenger-needing-surgery-after-illegally-forcing-her-throug...
16•SunshineTheCat•2h ago•3 comments

Global warming has accelerated significantly

https://www.researchsquare.com/article/rs-6079807/v1
836•morsch•7h ago•818 comments

Show HN: Claude-replay – A video-like player for Claude Code sessions

https://github.com/es617/claude-replay
40•es617•5h ago•19 comments

Show HN: A trainable, modular electronic nose for industrial use

https://sniphi.com/
24•kwitczak•3d ago•10 comments

Paul Brainerd, founder of Aldus PageMaker, has died

https://blog.adafruit.com/2026/03/04/pagemaker-and-aldus-founder-pioneer-paul-brainerd-1947-2026/
107•fortran77•5h ago•22 comments

We might all be AI engineers now

https://yasint.dev/we-might-all-be-ai-engineers-now/
133•sn0wflak3s•12h ago•193 comments

Show HN: Reconstruct any image using primitive shapes, runs in-browser via WASM

https://github.com/taiseiue/primitive-playground
6•taiseiue•3d ago•0 comments

Supertoast tables

https://hatchet.run/blog/supertoast-tables
42•abelanger•4h ago•5 comments

It took four years until 2011’s iOS 5 gave everyone an emoji keyboard

https://unsung.aresluna.org/im-obviously-taking-a-risk-here-by-advertising-emoji-directly/
116•tobr•13h ago•69 comments

TypeScript 6.0 RC

https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-rc/
19•johnz•1h ago•3 comments