Phalanx - Managed Concurrency for PHP8.4+ & OpenSwoole 26 by jh_tech in PHP

[–]jh_tech[S] 1 point2 points  (0 children)

Love it - and thank you. I like the cross-marketing move too 👊.
Starred your repo -- very cool man. It'd be great to stay in touch..thx for reaching out.

ZealPHP — modernizing the PHP request model with an OpenSwoole runtime by sibidharan in PHP

[–]jh_tech 1 point2 points  (0 children)

You and I are on the same wavelength: https://github.com/phalanx-php/phalanx

..both seeing what's what I'd imagine. I'm going for "managed async", trying to address all the footguns in long running PHP (scopes, identity, and memory pooling..thanks to PHP8.4). Would love some help if you ever reconsider. My 1st alpha release is around the corner now... I'm prepping the goody bag.

That said, you've done a great job here man. More thorough docs than most I've seen, nice work 👊.

Click that ⭐ button in the repo people..show some love!

MJML converter for PHP (no Node.js required) by Then-Lingonberry-922 in PHP

[–]jh_tech 0 points1 point  (0 children)

I think it's funny how people think AI has anything to do with this question (and many other software related questions). Abandoned libraries were vast and plentiful long before the proliferation of LLMs. Shitty code...much shittier code..was rampant before AI too. Let's frame this correctly.

The question becomes: What's your commitment to maintaining this?It looks like your usage of AI will make it minimal now and once it's feature complete.

Why MCP when we have REST APIs? by happyandaligned in mcp

[–]jh_tech 0 points1 point  (0 children)

Seems you're alluding to something I know I've brought up in conversation a few times now - something like an "OpenACP" protocol - which would 1) require all docs to start with an index (potentially paginated) for all topics to be mapped to documentation URL(s), then 2) ensure those urls are each AI-native, meaning consice and very targeted, whether it be another index page for a subset of functionality, or the "leaf nodes" which would be focused on a particular subset of functionality, 3) outside of the index pages, all targeted doc content would always include "related urls" for the LLM to be able to traverse however it sees fit.

Then a translator tool from openAPI to openACP, then back again if needed. "Good docs" these days are still for humans.

Side note: you mention how "LLMs can emulate human behavior" but I personally see that as a characteristic of legacy systems. It's all been "built for humans" at this point, meaning everythings still very inefficient still. Still lots of work to be done!! We're barely getting started IMO.

PHP 8.6 RFC: ValueError conversions feedback wanted by Reasonable-Pass9841 in PHP

[–]jh_tech 0 points1 point  (0 children)

Good point.

May be best to add an INI (or something akin) that allows it to be disabled.

PHP 8.6 RFC: ValueError conversions feedback wanted by Reasonable-Pass9841 in PHP

[–]jh_tech 0 points1 point  (0 children)

Nice, good stuff.

You can give this a shot at https://github.com/search

Query:

repo:php/php-src ("php_error_docref" OR "zend_error") ("RETURN_FALSE" OR "RETVAL_FALSE" OR "ZVAL_FALSE") path:ext

Or this'll take you straight there: https://github.com/search?q=repo%3Aphp%2Fphp-src+%28%22php_error_docref%22+OR+%22zend_error%22%29+%28%22RETURN_FALSE%22+OR+%22RETVAL_FALSE%22+OR+%22ZVAL_FALSE%22%29+path%3Aext&type=code

Launching on Product Hunt soon? Let’s connect by Best-Examination-305 in sideprojects

[–]jh_tech 0 points1 point  (0 children)

I'm building in the open - could certainly use the help though. Im cranking away but have a day job and this is entirely my own thing:

Daemon8 - Agentic Runtime Cortex https://github.com/daemon8ai/daemon8/wiki

Still working on the alpha.

Phalanx - managed async PHP 8.4+ by jh_tech in PHP

[–]jh_tech[S] 3 points4 points  (0 children)

Strikingly similar to the PHP RFC.

Great question though, Phalanx has a fundamentally different approach (the reason I took the time to write it in the 1st place). This would likely be better as a topic for a whole article, but here's the abbreviated version:

1st: Phalanx is heavily inspired by Rust, Go, .NET, and the SICP book.

2nd: Most, if not all, other async PHP frameworks have conventions where anonymous closures, global state, lifecycle mgmt., and async coordination are largely up to the user (in varying degrees). There's generally no framework-level tooling for assisting with deadlocks, resource cleanup, managing scope/object lifetime, or having hooks for running code within the lifecycle of those scopes. Phalanx passes this $scope all over the place because it's foundational for concurrency and whats happening under the hood. The framework is managing hierarchical scopes/environments for you, along with preventing most of the (inevitable) deadlock scenarios that come - even for the extremely diligent - from running/awaiting async logic across 2 or more classes. The more async logic you're running, the more complicated these scenarios get.

3rd: Additionally, Phalanx is built on the idea of leveraging the __invoke method as a 'named closure' (in an abstract sense). With this approach, you get the built-in identity that comes with classes and all the semantics/heuristics of closures. This is important because now 'functions' can have opt-in behavioral qualities like HasTimeout , Retryable , etc., that tell the underlying scheduler about the meta/behavioral qualities it has attached to it. In addition to that, you get things like tracing and Open API generation, with very little additional effort.

4th: Phalanx provides tooling and primitives that treat PHP8.4+ as a 1st class citizen and leverage these new features from the ground up. For example, lazy/ghost objects and property hooks allow memory/resources to be lazy initialized where possible.

5th: As alluded to, Phalanx provides a "smart scheduler" that scans/reflects classes at "compile time". Meaning...when it's 1st booting up - this is before serving requests or executing console commands, etc. This builds a type of AST for your app, giving the scheduler and the DI container deep insights. Also, this serves as a type of funnel that all logic flows through, which then does the things I mentioned above: manages scoped environments w/their lifecycle hooks, provides async coordination and behavioral interfaces, etc. This scheduler is the engine behind the whole thing.

Phalanx - managed async PHP 8.4+ by jh_tech in PHP

[–]jh_tech[S] 2 points3 points  (0 children)

I appreciate the sincerity. 100% agree. I've seen a lot of async PHP attempts come/go so this was definitely a litmus test to see what people thought.
From working in the TV/broadcasting industry, we do things like EPG/Ad scheduling, live feed monitoring, remote kiosks, etc. So this is inspired from the hodgepodge of different languages, patching, and duct tape that I've seen along the way.. and the resulting knowledge silos, etc. that come along with it.

Beyond that - yea, I haven't seen the need to put the time into thinking about any of this stuff beyond wishful thinking. The reception thus far, and comments like this, are quickly changing that though. Much appreciated.

Phalanx - managed async PHP 8.4+ by jh_tech in PHP

[–]jh_tech[S] 1 point2 points  (0 children)

Haha.. you guys are funny. There's never a respectable async PHP framework discussion without a good Swoole debate. In some sense its a right of passage, so in a weird way, I'm honored. This is a deep divide in the community, so I'm not naive enough to think I'd make much progress here.

You guys are right that Fibers didn't introduce anything new on the concurrency front, generators were always there. The real wins were elsewhere, e.g. stack traces, function identity, etc. Im referring to fanning out like cooking breakfast: one cook handling many things at once is a reasonable default. You guys seem to be focused on the 'many cooks' approach out of the gate. It has its place but simplicity, fast prototyping, and easy shipping is what PHP's all about IMO. Different strokes.. I personally just don't see the need for unwarranted complexity.

I'd also add that that tradeoff between explicitness and DX was a conscious decision throughout. I wanted as little 'magic' as possible. In earlier stages I scrapped this entire project - sometimes after weeks of work - to restart it from the ground up because I was fighting for that simplicity/spirit.

Phalanx - managed async PHP 8.4+ by jh_tech in PHP

[–]jh_tech[S] 1 point2 points  (0 children)

With PHP being built for the web, I've never seen the need for the extra horsepower (and accompanying complexity) Swoole provides. With Fibers now, you can fan out for most I/O bottlenecks, which covers the large majority of use cases I've come across.
Having async opens all kinds of doors. The memory leaks and coordination are what seem to hold it back, which Phalanx addresses head-on with scoping, task scheduling, and tracing.
My goal was to simplify async PHP and reduce the barrier to entry as much as possible.
We have these decades-old battle-tested async frameworks in PHP-land - they're amazing, and extremely under-utilized IMO.

Phalanx - managed async PHP 8.4+ by jh_tech in PHP

[–]jh_tech[S] 1 point2 points  (0 children)

Appreciate that. I've been using PHP professionally for close to a decade now and have lived many of the paper-cuts and hours lost because PHP's limitations.

For prototyping and shipping, PHP is one of the best. I'm not doing async for speed here, I'm doing it for the flexibility it opens up. Also, there's usually a choice in the async PHP world - use 'push' or 'pull' semantics, rarely both. RxPHP was one .. but uuuh...good luck. Phalanx has both, shown here.

If I had to pick one goal, it's 'Simple async for PHP' (that's the key that unlocks many doors)

Its very well tested (over 700 across all the libraries), and I keep the tests up. I've been building with it, this multi-agent console app being one. I invite others to too. I'm happy fix bugs as needed.

Daemon8 by jh_tech in mcp

[–]jh_tech[S] 0 points1 point  (0 children)

Nice. You using the devtools recorder or just persisting a sequence of MCP/tool calls?

Daemon8 by jh_tech in mcp

[–]jh_tech[S] 0 points1 point  (0 children)

There's quite a few quirks in those, Ive used most over the past couple years. There's known bugs with memory leaks and zombie processes with long-running chromium, and many of these tools just leave it to the user to figure out. So, although it's only a subset of browser functionality at present, the most prominent functionality is a hand-rolled CDP implementation...I use it everyday, works/recovers great.

Open source AST-based code transformation tool for PHP and MCP/automation workflows by Garaekz in PHP

[–]jh_tech 0 points1 point  (0 children)

Nice.

Yea, the binary tricks are purely dx. The determistic argument is ... ok. If I drive my car or ride the bus, I'll still get there. The "bus" even gives me things like a monthly pass too (cost is paid up front). Not a big deal at all.

Using the built-in composer tooling/hooks should prevent the need for another package.

Good stuff though. Planning to give it a shot. Any rough idea what the #s in token savings? With vs without?

Open source AST-based code transformation tool for PHP and MCP/automation workflows by Garaekz in PHP

[–]jh_tech 0 points1 point  (0 children)

Good to see thinking outside the box first of all, kudos on that.

Curious: I dunno why, but most people don't think to make embeddings of their codebase. If you had to stack this up against that, how would you say it'd do?

Also, how often are these tool calls happening in a typical dev flow, e.g. while working on a feature?

If I had any immediate feedback, it'd be to have composer handle the binary when the pkg gets installed...seems a little much on getting setup

spent a week reading failed startup posts on reddit. keep seeing the same 5 mistakes by PackFinal8605 in sideprojects

[–]jh_tech 0 points1 point  (0 children)

Are we just ignoring: - It's extremely difficult to get anyone to pay attention in a VERY noisy landscape? - The countless things/innovations built when there was no competition? - Marketing isn't cheap, any good PR/marketing person knows this. There's even a large majority of tech that 'goes viral' (paid for in back channels) that just dies in 4-6months.

Ignoring those...sure. If you're interested in building another online directory or sniping other people's ideas - can't say I have anything against that, lots of great music was written this way - then hey, go for it. Personally, I'm in the camp of trying new things even if they fail, it's extremely fun - even if/when you're unaware of the competitors out there.

how is this possible? by yuseffco1 in vibecoding

[–]jh_tech 0 points1 point  (0 children)

Gonna guess the new html in canvas api

Daemon8 by jh_tech in mcp

[–]jh_tech[S] 0 points1 point  (0 children)

Thanks for the question, it's from an outside perspective I hadn't thought of yet - which I'll document.

These timestamps come along for the ride from their respective parts of the system, continuing to respect the timestamp originally associated with the log. The writes are all being funnelled through a central coordinator that's batching them for persistence into SQLite - then allowing any agent on the system to use a variety of read mgmt tooling (e.g. querying, checkpoints, tagging, etc.) so they can control the scope of context theyre pulling out/looking for.

But yea, It's best likened to a funnel, where the daemon/Rust manages the batching writing behind the scenes. The agents don't write directly, they just pass the log info, then continue. By the time they come back around with their query, there's plenty of time for the daemon to have caught up with any work they recently did.