Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121083 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26238 invoked from network); 18 Sep 2023 05:01:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Sep 2023 05:01:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6DD4B1804DF for ; Sun, 17 Sep 2023 22:01:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 17 Sep 2023 22:01:05 -0700 (PDT) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-68fcb4dc8a9so3674700b3a.2 for ; Sun, 17 Sep 2023 22:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695013264; x=1695618064; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pBGhOfCQVZmLNgBVTdf+8Hw5pYKzE3IcNUboiKo45wY=; b=lVrZ9Yay58zzSIYywtGWX3ToCX2J9pP1QEavvY9NFa1/lPCSzLBWPVdycM+S4RSawh i/HYuQDObt14Ji7CcNaOaVYBe8z7Nh7jPNWpZX7kHVdW39y1fzfkNrRPy0eFJ19sMy6W 6+oEAOQpjIZJizFSXeb0Dsx6pb2uPDa6IWvM5znqKeCLajD3buZSdpEMrOK5/GM40loc avD/9XIEhPqjyH+EYCIvD1Xyue+cbu6i1T75CeqWfG8ouoX3y9VAVIQ6N2Rs8XxlFog1 1GegTz8+FtCSktK9ynwZWuowol+0tvFHn1iVGTV1a19mYtuGQ/mDtAOUUxnlYoG1iyRe xV1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695013264; x=1695618064; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pBGhOfCQVZmLNgBVTdf+8Hw5pYKzE3IcNUboiKo45wY=; b=PZBLCYla8nXy8R9H2qZTDw6PCEZeellNTwF401NUlv5LVSbn3z6yeAIB138UDLkvdw 6HCaVZgm36Q7RZLfs9+bPpWfSgs8n9hlOxT1IGf+w07a3C8hoKDBDbONi7cOG1EwhwoY ssVF/TKVLjAbUVcAzNeqlzIvcwTutVDCzdrJFH8U3QutA/rdjEdmtMTtoOWzpnTo6GK0 UnSCbRVhggS94/oNU0bRSRz3iw1EkBRS3DAvHncZiRX++a/+fup6PcIS9dEF2pZP85R3 gONomRDOrlXXIqDi4u53fXvbYD95eS/AAwFSJ02weU4Uudd6cefpjtyOMtUM8bVEH7PX fPHg== X-Gm-Message-State: AOJu0YxHv0yMaAPyXrjoiYuYjJy1kRVOuviC2VTZAwX+aijoiJ/aCH9b bRL3Ly0CSRa2qWNdrq+hmgzSY36P7b8VkumrwKE= X-Google-Smtp-Source: AGHT+IHxPrhYmITMBbyGg+0itR6kP2tUv0PE6kAG7pu1jgD8yiAQdFgdB0smQ+c+Xz8Qfea1r3wfIEx6m6lCmQoOqXA= X-Received: by 2002:a05:6a20:1442:b0:157:b453:dbb9 with SMTP id a2-20020a056a20144200b00157b453dbb9mr8272937pzi.6.1695013263695; Sun, 17 Sep 2023 22:01:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 18 Sep 2023 12:00:52 +0700 Message-ID: To: Dmitry Stogov Cc: PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] A new JIT engine for PHP-8.4/9 From: pierre.php@gmail.com (Pierre Joye) Hello :) Posting again, I just realized I used "reply" not "reply all" On Mon, Sep 11, 2023 at 4:29=E2=80=AFPM Dmitry Stogov wrote: > > Hi internals, > > I'm glad to present a new JIT engine that is going to be used in the next > major PHP version. Now it's a real optimizing compiler with Intermediate > Representation similar to Java HotSpot server compiler. > > It makes a base for future improvements and eliminates many low-level > details of the existing PHP JIT. Instead of supporting assembler code for > different CPUs, now PHP generates a single IR and passes it to a > PHP-independent JIT engine. Great work! This is a massive jump for PHP. Thank you :) I don't have much concerns about the license etc as the ZE is already under Zend the ZE license (never updated since Perforce acquired them, tho'): https://github.com/php/php-src/blob/master/Zend/LICENSE I do really like the IR addition. This opens huge new opportunity, not only for optimization and JIT but to move forward into bringing new technology support to PHP (WASM f.e.). There are big challenges and I am not sure yet it can be ever be fully possible to target WASM. however, having the ability to do it with a subset of PHP, f.e. some business logic classes etc., would already be amazing. I can't imagine a php9 without taking this into account tbh. That would be kill php in any way but that would definitively puts it in less competitive area than others (JS, go, rust, ocaml f.e.), for another few years. I have a simple php function working (just a small go app to parse the IR text output and convert it. But that's not remotely a POC :). I discussed with Dmitry and the idea would be to add a WASM target to libIR (partial support or whatever is possible). This is the part I would like to see more discussions or feedback as it will define what could become possible or not. A certain level of similarity or compatibility could make other targets much easier. > The old JIT implementation is going to be kept for a while. I like the idea too. The sooner this work can be available as experimental, the sooner it will get stable. Best, --=20 Pierre @pierrejoye