Re: Proposal for Discussion: Effect Declarations and Capability-Gated Process Execution in PHP

From: Date: Wed, 28 Oct 2026 15:51:29 +0000
Subject: Re: Proposal for Discussion: Effect Declarations and Capability-Gated Process Execution in PHP
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-132949@lists.php.net to get a copy of this message
On Oct 28, 2026, at 12:41 PM, Larry Garfield <larry@garfieldtech.com> wrote: > > 2. "Effect systems" are a very specific thing in comp sci research. I'm not > sure that what is proposed here counts as such. (Think exceptions that return to their point of > throw after the handler completes. It seems mainly useful as a way to keep a routine > technically-pure while still letting it do useful things.) There are some academic Haskell-like > languages with it, but I don't know of anything in widespread use. > > What is described here feels more like gated capabilities, similar to what Wasm does. It is an > interesting concept, but for it to work it would need to integrate at a very low level. The engine > would need to explicitly fail a function that tries calling print without the "I do > output" flag, or opening a process without the "I start processes" flag, or reading > from the file system without the "I read files" flag. The biggest issue there is, > unsurprisingly, backward compatibility. A new PHP release that fails on any function that has a > print or fopen statement in it until you add new syntax not available in earlier versions is a > complete non-starter. Yeah, these don't seem quite like algebraic effects. I think there is some modern interest in them again (i.e. Unison), so I would pick a different term to describe them. Capabilities also imply something more like an object capability system to me, so I would also avoid that term.

« previous php.internals (#132949) next »