> I'm stopping right there. I've watched people make proclamations like that, 
> execute the code, crash servers costing thousands of dollars in downtime and 
> promptly get fired.

It isn't a proclamation, it's checkable, and I linked the check.
`list($a, $b)`, `array($a, $b)`, and `[$a, $b]` compile to identical
opcodes: https://3v4l.org/rlQa6/vld#v

The people who crashed servers weren't undone by verifiable
equivalences like this one; they ran transformations they hadn't
verified. This is the opposite: two forms the compiler cannot
distinguish. If you think that's wrong, open the link and show me
where the opcodes differ.

And if the objection is specifically `ast-grep`, fair enough, it's a
general-purpose tool. But the migration doesn't depend on it. Mago
linter already implements exactly this rewrite, on a PHP-specific
parser, you can read the whole thing, it's about thirty lines:
https://github.com/carthage-software/mago/blob/072933fda228a4c52d3858fd4b1797624aa31ac9/crates/linter/src/rule/consistency/array_style.rs#L101-L133

Mago is a full linter with over a hundred rules. If you'd rather have
something with zero config and zero surface area, I'll build you a
single-purpose binary that does only this one transformation. It's at
most 30 minutes of work. The point is that the rewrite is so
mechanically simple that the tooling is almost incidental.

> You've never been in a position of authority to make a pragmatic decision. No 
> one with that burden would type what you've typed.

You don't know what I do, so I'll set the personal framing aside and
give you the relevant part: I build static analyzers, linters,
compilers, and rewrite tooling for a living.

I've written a compiler that migrated a multi-million-line codebase
from one language to another, automatically, overnight. Swapping one
AST node for another that is *literally equivalent to the compiler* is
not a feat of engineering courage. That's the basis for what I said.
Technical claims aren't settled by operational burden.

> I've stated my reasoning. I don't need to repeat it to deaf ears.

Sure. I disagreed on the merits and said why.

Cheers,
Seifeddine

Reply via email to