I CFJ, barring Janet: "confederation with an inanimate object is possible"
It seems to me that:
1. Switches are created on a "type" of entity by bullet 1 in R2162.
2. R2606, which creates Class switches, attempts to limit it to "Proposals
created since the enactment of this rule".
3. This would have had the effect of creating a switch on a set of entities
rather than a
ve never used
it or seen it used; normally, trim($foo)==='' (or trim($foo??'')==='') seems to
be good enough.
Rowan Tommins
[IMSoP]
I announce that snail has more rare stamps than anyone else per Rule 2701/1
(causing the Stamp Scamp switch to flip to that player)
I (re-)register as LegallyBearded
I grant myself a welcome package.
I doubt the Scroll of Agora published on 1 April, which lists Stone Badges
as awarded on 15 Sep 2025, a date in the future.
le $fn, mixed ...$fixedArgs): callable {
return fn(mixed $firstArg) => $fn($firstArg, ...$fixedArgs);
}
// first-arg chaining
$someChain |> array_filter(fn($v, $k) => $k === $v, ARRAY_FILTER_USE_BOTH);
// native partial application
$someChain |> array_filter(?, fn($v, $k) => $k === $v,
ARRAY_FILTER_USE_BOTH);
// workaround
$someChain |> partial_first(array_filter(...), fn($v, $k) => $k === $v,
ARRAY_FILTER_USE_BOTH));
--
Rowan Tommins
[IMSoP]
h of
statements I want to run in a new Coroutine, but they're not worth putting in a
function". So to the user, having all the features of a function isn't
relevant. We don't allow specifying the return type of a match statement, for
example.
Do you have a different scenario in mind?
Rowan Tommins
[IMSoP]
ly implemented extension
methods instead of pipes, and then the new iterator API was
extension-method-only. It feels less like "one of the arguments is
missing" if that argument is *always* expressed as the left-hand side of
an arrow or some sort.
--
Rowan Tommins
[IMSoP]
ded up
how they did.
--
Rowan Tommins
[IMSoP]
he description of traits (they would no longer
just be copied and pasted code), and would lead to additional questions (e.g.
what happens when the target class changes the visibility with an "as" clause?).
Any inconsistent behaviour should have to clear a high bar.
Rowan Tommins
[IMSoP]
or a property.
I see no reason for inheritance to be involved at all. If we want an access
level that means "accessible from any code in this file, or any subclass of the
current type", we can make up a keyword for that as well - "fileprotected", or
"fileprivate_or_protected", or whatever.
Rowan Tommins
[IMSoP]
t.
A "fileprivate"/"samefile" keyword would be pasted into the file it was used
in, and mean accessible within that file; it wouldn't matter what file the
trait was defined in. It would probably be useless, but lots of useless code is
possible in any language.
Besides, all these questions have to be answered for nested classes as well.
Just because you've reused the keyword "private" rather than adding
"private_or_nested", you still have to define exactly what it does and doesn't
allow access from in these new scopes.
Rowan Tommins
[IMSoP]
On 25 March 2025 18:14:21 GMT, Daniel Scherzer
wrote:
>On Tue, Mar 25, 2025 at 11:01 AM Rowan Tommins [IMSoP]
>wrote:
>
>>
>> I don't think the language should pretend to support something that it
>> doesn't
>>
>
>I don't see what the pr
On 25 March 2025 16:42:45 GMT, Robert Chapin wrote:
>On 3/25/2025 4:45 AM, Rowan Tommins [IMSoP] wrote:
>> The implied default in the first is 'off', but in the second it's 'on'.
>I thought the implied default was null.
By "implied", I'm
coalesce($_POST['tick']) != 0) return;
But this doesn't:
if (coalesce($_POST['tick']) !== 0) return;
By specifying the default explicitly, we don't have to examine the expression
carefully to see what's implied.
I don't know if I'd go as far as banning a single-argument coalesce, but I
would definitely discourage its use.
Rowan Tommins
[IMSoP]
choice - { contains, contained by, neither }.
File scope gives us instead the dimension { same file, different file }; and
module scope gives us { same module, different module, no module }, and maybe
some additional relationships between modules.
Rowan Tommins
[IMSoP]
because it's mostly just
reminding you to include a pair of parentheses:
if (($_POST['input'] ?? null) === 'yes') echo 'success';
if (coalesce($_POST['input']) === 'yes') echo 'success';
if (coalesce($_POST['input'], null)
extend current
functions to handle IRIs?", I'd start from the point of "what functions do we
need for handling URI/URL/IRI parts, and what variations of each?"
Rowan Tommins
[IMSoP]
function signature because it used to directly overwrite variables by name.
As a comparison, we didn't extend the shuffle() function with an
algorithm parameter, we added a shuffleArray() method to the new
Randomizer class.
--
Rowan Tommins
[IMSoP]
the contract in a docblock:
/**
* @template T
* @method compareTo(T $other): int;
*/
interface Comparable {
}
/** @implements Comparable */
final class Number implements Comparable {
public function compareTo(Number $other): int { return $this
<=> $other; }
}
--
Rowan Tommins
[IMSoP]
n, though, this could easily be added later when a need becomes
visible, as long as we don't do something weird now that closes the door
on it.
I suggest we leave this sub-thread here; there's plenty of other things
to discuss. :)
--
Rowan Tommins
[IMSoP]
se: it will be used frequently.
Will it? By who, when? Honest question, and comes back to my point about
identifying the use case.
>For example, `spawn fn() => file_get_content()` won’t be, because it
>doesn’t make sense.
If return values end up somewhere, I don't think it would be hard to come up
with examples that were slightly more than one function call, but still fit in
a single-expression closure.
Rowan Tommins
[IMSoP]
f the aim is "a readable way to use a closure", rule #2 is fine.
Yes, it means some extra parentheses if you squeeze it all into one
statement, but it's probably more readable to assign the closure to a
temporary variable anyway:
// Legal under rule #2, but ugly
spawn (function() us
actoring like moving that
declaration into a variable.
If it's going to be a special case for an "inline coroutine", just use a
keyword other than "function", so it doesn't look like an expression when it's
not, like "spawn block { ... }"; or no keyword at all, just "spawn { ... }"
Rowan Tommins
[IMSoP]
eted as if `something` is a PHP constant rather than a
>function.
It's more fundamental than that: function_call and expr are overlapping
grammars, so having a rule that spawn can be followed by either of them, with
different meanings, leads to ambiguities. You can carefully tune the grammar to
avoid those, but then the user has to learn those rules; or you can just use
two keywords, which I don't remember you actually responding to as a suggestion.
Rowan Tommins
[IMSoP]
est("string");
Or forget callables, and anything that looks like it's trying to be one,
because creating a Closure isn't actually the user's aim:
spawn_this_function_call_without_creating_a_closure test("string");
spawn_these_statements_use_a_closure_if_you_like_i_dont_care {
do_something();
do_something_else();
}
--
Rowan Tommins
[IMSoP]
choosing between creating a child within a
narrow scope you've just opened, vs creating a sibling in the scope created
somewhere up the stack.
The "request handler" use case could easily benefit from a "pseudo-global"
scope for each request - i e. "tie this to the current request, but not to
anything else that's started a scope in between".
There were also some concrete examples given in the previous thread of
explicitly managing a context/scope/playpen in a library.
Rowan Tommins
[IMSoP]
expanding recursively to function_call, as in the add(1)(2) form beloved
of Function Programmers
Is there a reason to redefine all of this and make fresh decisions about
what to allow?
I would argue for "principle of least surprise": reuse or emulate as
much of the existing grammar as possible, even if you personally would
never use it.
--
Rowan Tommins
[IMSoP]
rsonally, I would be equally happy with either \ or :: and less happy with
anything that required us choosing yet another set of punctuation, for what is
otherwise quite a minor feature in its language impact.
Rowan Tommins
[IMSoP]
al
syntax might make more sense - there would be a very specific
relationship between the inner and outer classes. I don't think "has
special visibility of members, like a friend-class or file-private
feature" needs to be highlighted in the syntax that way.
--
Rowan Tommins
[IMSoP]
ead.
> So, maybe, it could be useful to use \ but in the long run, I’m not sure it
> makes sense.
I rather think the other way round: in the short term, a new separator would
save users a bit of pain with autoloading, but in the long run it will look
like a weird anomaly that no other language needs.
Rowan Tommins
[IMSoP]
e application malfunctions.
This and other special behaviours suggest that this should inherit from
Error rather than Exception, or possibly directly from Throwable
That's all for now. To reiterate: thank you so much for working on this,
and I really like the shape it's beginning to take :)
--
Rowan Tommins
[IMSoP]
\InnerClass" }
The quadrupled namespace separator is still just about readable, but
could you tell me at a glance if I have the right number of backslashes
for the proposed inner class separator?
If we can't use "::", I'm confident we can find one that's more
convenient to use than double-backslash.
--
Rowan Tommins
[IMSoP]
firewalls" in the application, where any accidentally orphaned
coroutines can be automatically awaited before declaring a particular task
"done". But Daniil is probably right to ask for concrete use cases, and I have
not used enough existing async code (in PHP or any other language) to answer
that confidently.
Rowan Tommins
[IMSoP]
des")->build();
The "User" class would have a "file private" or "namespace private"
constructor, callable from the "User\Builder" class but not elsewhere; the
build() method would return the "User" instance.
I think I'm coming to the conclusion that we should use backslash: nested types
can be viewed as a shorthand way of having a class and namespace with the same
name, plus applying some visibility rules to that namespace.
Rowan Tommins
[IMSoP]
mming-language/accesscontrol/
The example of a nested enum also demonstrates a nice shorthand syntax,
where the ".ace" in "BlackjackCard(rank: .ace, suit: .spades)" is short
for BlackjackCard.Rank.ace, inferred from the parameter type.
I don't have any specific conclusions, but I think with features like
this it's always worth examining other people's ideas, to see if we want
to include (or avoid) any of them.
--
Rowan Tommins
[IMSoP]
dered wrong here: https://externals.io/message/126589#126741 (compare
here: https://news-web.php.net/php.internals/126741)
The other thing I wonder is whether the original reason why `::` wasn't
used as the namespace separator still applies, and needs to be accounted
for here?
--
Rowan Tommins
[IMSoP]
t proposals complement rather
than blocking each other: iterator functions make pipes more efficient to use,
and pipes make iterator functions more pleasant to use. I'd like both please. :)
Rowan Tommins
[IMSoP]
, and give
every annual release equal status. This is the approach that PostgreSQL
has taken, I believe.
We'd probably still want some kind of deprecation policy - some changes
should be deprecated for X releases before removal/change. Which brings
us back to some kind of criteria for which changes need that, so doesn't
really solve the problem.
--
Rowan Tommins
[IMSoP]
letely new API to eliminate) and "this is bad, and there
are concrete plans to change it" (e.g. it will become an error, or start
doing something different, in the next major version).
--
Rowan Tommins
[IMSoP]
we should be very wary of how far we bend the difference between
"minor" and "major" releases.
For these changes, I'd like to hear the argument *against* starting with a
Warning. Is there any significant burden to waiting until 9.0 for these to
become errors?
Rowan Tommins
[IMSoP]
the currently running OS: they don't actually start a new
Scheduler, but they mark a namespace of related coroutines, that can be
treated specially in some way.
Alternatively, it could simply be an error, like trying to run the
kernel as a userland program.
--
Rowan Tommins
[IMSoP]
;spawn managed" and "spawn detached",
the "detached" mode would be overwhelmingly more common (i.e. users and
library authors would want to manage the lifecycle of their coroutines
manually), so the "spawn managed" mode isn't worth implementing.
Would that be a fair summary of your opinion?
--
Rowan Tommins
[IMSoP]
lso note that the concept of parent and child fibers is also useful
for other proposed features, such as cascading cancellations, and having
environment-variable style inherited context data. None of those is
*essential*, but unless there are major *implementation* concerns, they seem
like useful features to offer the user.
Rowan Tommins
[IMSoP]
isolation in userland, by marking a checkpoint in the code.
As I've said repeatedly, it doesn't necessarily need to be a mandatory
restriction, it can be a feature to help users write code without having to
worry about *accidentally* leaving a background fiber running.
Rowan Tommins
[IMSoP]
ge, we're not limited to expressing
things with functions and objects, and a block syntax makes it trivial for the
compiler to detect a mismatched start and end.
Regards,
Rowan Tommins
[IMSoP]
rder to use async facilities in its *body*.
If the body can say "get current nursery", it can be called even if its
*immediate* caller has no knowledge of async code, as long as we have
some reasonable definition of "current".
--
Rowan Tommins
[IMSoP]
{
$child = asyncChild foo();
$bgTask = asyncDetached bar();
}
// foo() guaranteed to be completed or cancelled, bar() continuing as an
independent fiber
(all names and syntax picked for fast illustration, not an exact proposal)
--
Rowan Tommins
[IMSoP]
hed colours. As a user,
I find it really hard to pick out what PHP code I'll actually write to
make use of this - or even whether I'm the target audience at all, or
whether this is all likely to be hidden by higher-level libraries.
--
Rowan Tommins
[IMSoP]
awn a fiber in the
currently active nursery, the child's lifetime guaranteed to be no longer than
its parent, and that lifetime is defined rigidly in the source code.
Rowan Tommins
[IMSoP]
Async\Context class should have, because that whole class can be added
later, or just implemented in userland.
If we strip down the solution initially, we can concentrate on the
fundamental design - things like "Fibers have parents", and what that
implies for how they're started and used.
--
Rowan Tommins
[IMSoP]
task into? Or would we prefer, at least in the minimum
implementation, to say "when you spawn a task, it spawns in the current
async context, and if there is no current async context, an error is
thrown"?
--
Rowan Tommins
[IMSoP]
On 05/03/2025 23:10, Rowan Tommins [IMSoP] wrote:
This is roughly what happened with Closures themselves in PHP: first,
decide that "$foo = function(){};" will be valid syntax, and define
Closure as the type of $foo; then over time, add additional behaviour
to the Closure class, the
to
the Closure class, the ability to add __invoke() hooks on other classes, etc
Regards,
--
Rowan Tommins
[IMSoP]
but every one of them deserves its own
discussion, and several can be left to userland or as future scope in an
initial implementation.
Rowan Tommins
[IMSoP]
l decisions which should be our focus first.
To re-iterate: this is really exciting, and thanks for getting it to
this stage!
--
Rowan Tommins
[IMSoP]
nough that you could
only have both if the language had multiple enum-like things which the
user could choose between.
--
Rowan Tommins
[IMSoP]
On 25 February 2025 23:31:25 GMT, tight.fork3...@fastmail.com wrote:
>On 2/25/25 4:51 PM, Rowan Tommins [IMSoP] wrote:
>> I actually started writing an RFC to rationalise some of this behaviour
>
>I'm glad I'm not the only one who considers this an issue worth pursuin
sounds simple when you look at a
single use case, but actually specify the behaviour in all cases is
going to be a lot of work.
--
Rowan Tommins
[IMSoP]
be clear:
$decision = Decision::createFromId($a, $b);
$decision = Decision::createFromMail($a, $b);
Even if someone were to come up with a working implementation of overloading in
PHP's type system, I would probably oppose it, because I think it makes code
harder to read and reason about.
Regards,
Rowan Tommins
[IMSoP]
ater be optimized and start warning could be very confusing, and given the
backwards compatibility issue, users will need something other than "(void)"
which is reliable.
My other thought reading the proposal is that if this can be done efficiently,
can we use the same approach to warn
bolishing it completely, or replacing it with some
form of *local* setting (maybe *only* on SplFileInfo). I would probably vote
against adding an ini setting.
Regards,
Rowan Tommins
[IMSoP]
rue);
do_something();
$after = new SplFileInfo($name, snapshot: true);
if ( $before->getSize() !== $after->getSize() ) { ... }
Inheritance of constructors isn't restricted, so that would not be a BC
break, and seems both more powerful and easier to understand than the
current feature.
Regards,
--
Rowan Tommins
[IMSoP]
nother" after what? Adding either an INI setting or an optional parameter is
not a BC break, unless and until the default is changed, at which point there
is exactly one BC break.
Regards,
Rowan Tommins
[IMSoP]
somehow, but it would make the behaviour much more explicit.
Regards,
Rowan Tommins
[IMSoP]
all the way back in 2004:
<https://bugs.php.net/bug.php?id=28790>
I have no doubt there are various other duplicates and discussions; clearly
this has always been a contentious topic.
Regards,
Rowan Tommins
[IMSoP]
>> +++ b/tests/tcg/plugins/inject.c
>
> Could we find a better name?
For sure, maybe "hypercalls.c" since that's really what it's mostly about.
>> @@ -0,0 +1,206 @@
>> +/*
>> + * Copyright (C) 2024, Rowan Hart
>> + *
>> + * Licen
arguments -- I don't know if I'm the right person
to make that call.
Glad to hear you're for this idea!
-Rowan
From: novafacing
---
gdbstub/gdbstub.c | 2 +-
include/exec/gdbstub.h | 14 ++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index b1def7e71d..7d87a3324c 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -536,7 +536
tests/tcg/plugins/inject.c
create mode 100644 tests/tcg/x86_64/inject-target.c
diff --git a/tests/tcg/plugins/inject.c b/tests/tcg/plugins/inject.c
new file mode 100644
index 00..9edc2cd34e
--- /dev/null
+++ b/tests/tcg/plugins/inject.c
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2024, Rowan
From: novafacing
---
include/qemu/qemu-plugin.h | 116 +
plugins/api.c | 66 -
2 files changed, 168 insertions(+), 14 deletions(-)
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index 0fba36ae02..b812593
This patch set follows a previous patch which added the
qemu_plugin_read_memory_vaddr function and adds a set of similar
functions to read and write registers, virtual memory, and
physical memory.
The use case I have in mind is for use of QEMU for program analysis and
testing. For example, a fuzze
From: novafacing
---
include/qemu/qemu-plugin.h | 116 +
plugins/api.c | 66 -
2 files changed, 168 insertions(+), 14 deletions(-)
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index 0fba36ae02..b812593
This patch set follows a previous patch which added the
qemu_plugin_read_memory_vaddr function and adds a set of similar
functions to read and write registers, virtual memory, and
physical memory.
The use case I have in mind is for use of QEMU for program analysis and
testing. For example, a fuzze
From: novafacing
---
gdbstub/gdbstub.c | 2 +-
include/exec/gdbstub.h | 14 ++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index b1def7e71d..7d87a3324c 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -536,7 +536
lt;0, 0, >0, so no CPU time
is spent normalising the result to specific values.
The documentation is simply mistaken in saying "-1" instead of "a value
less than zero" and "1" instead of "a value more than zero".
Regards,
--
Rowan Tommins
[IMSoP]
overloading the operator to mean
"identity" rather than applying a strict value comparison.
Example: https://3v4l.org/udOoU
If we introduce some new "value type", it seems very reasonable to use
the same recursive definition of strict equality used for arrays.
--
Rowan Tommins
[IMSoP]
$this refers to the desired result of the mutation
In fact, it's a bit like __construct or __clone, where $this refers to
the newly created/copied object, before anything else points to it.
--
Rowan Tommins
[IMSoP]
truct(public int $x) {}
public mutating function inc(): void {
$this->x++;
}
}
$foo = new Example(0);
$foo->x++;
$foo->inc!(); // copy-on-write triggered *before* the method is called
echo $foo->x; // 2
--
Rowan Tommins
[IMSoP]
cts / records would have to prohibit defining one.
--
Rowan Tommins
[IMSoP]
the proposals would end up? Either
way, this looks like ripe ground for collaboration, unless there is some
fundamental disagreement about the approach.
--
Rowan Tommins
[IMSoP]
d when pre-compiling, and can be declared exactly once by passing
include/require the pre-compiled file. Making functions match that behaviour is
what Ilija is proposing.
Rowan Tommins
[IMSoP]
ould also be interested to know if you think the difference in behaviour
between classes and functions is explicitly useful, or just neutral to your use
case.
Regards,
Rowan Tommins
[IMSoP]
might seem strange, for me it is the message
landing that FOSS4G and big business can coexist and that it ultimately
benefits from an independent development community.
Hope this perspective helps.
Kind regards,
Rowan
On Thu, Nov 21, 2024 at 4:55 AM, Violaine via Oceania
<[ocea
ot;, it's "dev mode", and it it's running under Apache, it's "live
mode"; if so, you can look at PHP_SAPI / php_sapi_name(). But maybe you
do run Apache on a dev server; or you have separate debug and QA modes.
--
Rowan Tommins
[IMSoP]
s as a special kind of object, keeping as much behaviour
and syntax from classes as we can; that means no "inline constructor",
and probably no "pull a cached instance from memory"
- structs/records as a brand new thing, with new syntax that only allows
the parts that fit the model; that means no non-constructor properties,
and no constructor bodies
Regards,
--
Rowan Tommins
[IMSoP]
how?
I wonder what prior art there is in this area, in both the theory of type
systems, and the practice of language implementations?
Regards,
Rowan Tommins
[IMSoP]
take any action based on speculation.
Regards,
Rowan Tommins
[IMSoP]
first version works because the fn() closure captures $data
by-value, effectively cloning it.]
Regards,
--
Rowan Tommins
[IMSoP]
Hi all,
I've recently completed the accreditation for ISO 27001. (First new qual in
many years).
As an external auditor I have to find a company to work under (the
company has to be accredited too).
As an internal auditor or putting together an ISMS that is not a barrier.
FOSS/Linux isn't new t
e
correct "disposal" of an object rather than hooking entry to and exit from a
"context":
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using
Regards,
--
Rowan Tommins
[IMSoP]
guage integrations", but that
didn't carry across when they rewrote it last summer:
http://web.archive.org/web/20230608040408/https://docs.wasmer.io/ They
may be intending to come back to it later, but at the moment it seems
they are not dedicating any resources to it.
Regards,
--
Rowan Tommins
[IMSoP]
u can upload native binaries already) on the other.
Regards,
--
Rowan Tommins
[IMSoP]
at an RFC could realistically propose right now. So I
say again, to those of you interested in the topic: contribute to the projects
already building the extensions, that's where the next steps are, not here.
Regards,
Rowan Tommins
[IMSoP]
projects like extism develop, making use of those runtimes to run alongside
other languages. But as far as PHP, or Python, or Java, is concerned, those
runtimes are an external process or library that is being interfaced.
Integrating with them is no different, in principle, from integrating the
driver for some new kind of database.
Which is great; it means you don't need any approval from this list, or to
write up an RFC, you can get involved in building that integration right now,
wherever people are working on an extension to enable it.
Regards,
Rowan Tommins
[IMSoP]
VM - like running Scala and Java code in the same JVM; or Hack and
PHP in (older versions of) HHVM.
Regards,
--
Rowan Tommins
[IMSoP]
that the *resolution* of PHP's operators aren't
currently determined by their left-hand side, e.g. int + float and float + int
both return a float, which certainly feels like "preferring the float
implementation regardless of order", even if PHP doesn't technically implement
it that way.
Regards,
--
Rowan Tommins
[IMSoP]
re, and it seemed beneficial to move it into the php-src repository rather
than releasing it separately.
Regards,
--
Rowan Tommins
[IMSoP]
>
> See:
>
> tests/tcg/i386/system/boot.S
> tests/tcg/alpha/system/boot.S
> tests/tcg/loongarch64/system/boot.S
> tests/tcg/aarch64/system/boot.S
> tests/tcg/x86_64/system/boot.S
> tests/tcg/arm/system/boot.S
>
> for what is needed (basically a MMU-enabled flat memory map and some
>
eed as current PHP.
This is where gathering a good catalogue of use cases would come in
handy: which of them would be impossible, or annoyingly difficult, with
a more restrictive resolution method?
Regards,
--
Rowan Tommins
[IMSoP]
1 - 100 of 2413 matches
Mail list logo