2 comments

  • cynicalsecurity3 hours ago
    Interesting project, writing a useful PHP extension is an every web developer&#x27;s dream.<p>However, the licence choice is weird. It&#x27;s really asking to be MIT. Any company bigger than 2 people pays attention to that. Most web projects are proprietary. GPL‑v3-or-later is not appropriate for proprietary&#x2F;closed-source.<p>Also, the README is lacking a nicely looking comparison chart, motivating people why they should use your project instead of just running grep in shell_exec. I&#x27;m very unlikely to run the benchmarking scripts myself. You have to convince me why your project is better than the established industry practice.
    • fishgoesblub3 hours ago
      &gt; GPL‑v3-or-later is not appropriate for proprietary&#x2F;closed-source.<p>Perhaps that&#x27;s the intent of the author. Not everyone is a fan of allowing companies to use your project for their closed source, proprietary garbage.<p>It&#x27;s refreshing to see a project that <i>isn&#x27;t</i> MIT.
    • cdcarter3 hours ago
      The plugin directly adapts code from GNU Grep, so they MUST release it under the GPL, as far as I understand.
    • hparadiz2 hours ago
      Thank you for your thoughts.<p>I made this as a joke with AI in about two hours because I kept seeing this pattern where code bases were grepping for classes because it was faster than anything else available to PHP userspace.<p>This is a runtime extension so it doesn&#x27;t preclude you from using it as it would not be considered part of your proprietary code. Similar to how running grep through shell_exec is not the same as incorporating GPL code in your code. I suppose that is a matter of philosophical and legal opinion but I believe my interpretation is the de facto reality.<p>As for benchmarks there is a thing in the docs folder talking about that. I spend some time on it. The tldr is the PHP runtime is slower to startup so the overall slowness for PHP was 20% slower compared to the grep CLI but that&#x27;s an apples to oranges comparison because if you already have a php thread running doing an extra ggrep call in userspace is going to be <i>faster</i> then grep because the binary doesn&#x27;t need time to load into memory.<p>I just wanted to throw this code out there in case it&#x27;s useful to anyone but I was considering write a new one for ripgrep or ag because they are both faster than GNU&#x2F;Grep.