Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108039 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87377 invoked from network); 8 Jan 2020 18:05:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jan 2020 18:05:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 85082180505 for ; Wed, 8 Jan 2020 08:10:37 -0800 (PST) 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,SPF_HELO_NONE,SPF_PASS 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-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 8 Jan 2020 08:10:36 -0800 (PST) Received: by mail-oi1-f170.google.com with SMTP id a67so3080155oib.6 for ; Wed, 08 Jan 2020 08:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gpamPzgA5F2b+Z1Rxu26uz+g5a5oOL7Vd95ygv2KV6o=; b=h0dl25fZDzEAFgd19hlvcRsQ29G/yHpGg6v95cXecVzFZsyhQRxfqpEFmxeWnvnI7z DcEw/fPRdy0Lgt/dXEx4vZaFf1Tb1DgtPhavplk58PptixTzfWjCUfOD2WMrUgbyhVCD rqGKrMBGOVlNUexPVoLfc8qgoHGCO0RC0HuLkRyN58eoit5lRRZdgmAcDvTk/zZdfeXe ucllMki+Q/kxvAO+UW/QmvCPZ71oIi9s1iQatXOHprzSyVWQzvJLdw4ISzsSa0EGBfgJ YC1hSPedj4tcY8myA+z7Ro1eG5tsoGtGRnZJ8cn6KGW1Z2ozo5xBLSwt/7wwkkFdO/U2 6Y0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gpamPzgA5F2b+Z1Rxu26uz+g5a5oOL7Vd95ygv2KV6o=; b=GsPoWt182eDtFXdCDm1ztA2dzSFASDsejgCBJHENOt115A7z3HUWtk+JKdZX+2LCmC Vt2GM06biA5MxZaj2IK2+xOteaR5qVTAdLbI/wNLkJCzjdqz7/ol33a2jIlLPbR6vAmt Ztw7QBF+ajkh4CECXBwgjijSeYQUQ3yoNcb7g72oDTXNajTXc2za/accfPOlQKPQtz7t qTzCnXUVcbxk9n7hMk0wWgEbaIlTCn7P2p1+e24J5v4QEIA67BSE+BTumO/UKjjEgP1W Y2KMHTt1dfMBE2l1/zyQwNGIA9fMQdSnAUGsh2fIkk8dWFozytbzYsaa2Qy8A9Dy0iG4 c6tQ== X-Gm-Message-State: APjAAAWVON1aQtIh2BQtC7mXCAL5eWnNBVUKJqbrqSLrSr6LlKfG3lu6 KKo2QV2+ro2MCqpRyVI+X/9EEYRHw/oicQl9Jas= X-Google-Smtp-Source: APXvYqyp9W2mKTnsUauC5bOG8/zkD9tR/9JuPZX3brIqkIOYRiXtg+2dzIi5QbfDEIdjKJIkdu2e28McqIGAv8cX8Uw= X-Received: by 2002:aca:503:: with SMTP id 3mr3474546oif.24.1578499832977; Wed, 08 Jan 2020 08:10:32 -0800 (PST) MIME-Version: 1.0 References: <5e0d723f.1c69fb81.e2ae8.24e2SMTPIN_ADDED_MISSING@mx.google.com> <74F2DBFC-E63C-428C-A37F-2D0CEE15AD0F@newclarity.net> <53556dfb-44ce-f902-204c-9a7da9484a61@gmail.com> <65567C7C-CF0F-4562-8943-F1F302134B07@newclarity.net> <6f20bda1-eff6-631d-915f-d6bb149ee666@gmail.com> <93BA4B49-9D9A-4A41-83B3-8EC2564A70BF@newclarity.net> In-Reply-To: Date: Wed, 8 Jan 2020 16:10:21 +0000 Message-ID: To: Mike Schinkel Cc: Rowan Tommins , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Initializing constants once, with code? From: robehickman@gmail.com (Robert Hickman) > After posting my objection to pre-processing I remembered there was anoth= er reason I object to pre-processors that is even more significant than lac= k of composibility. And my objection extends to all the transpiring being = done with Javascript and CSS too, although I put up with those because the = community has mitigated some of the worst problems and because so many deve= lopers have embraced them. > My suggestion was not a preprocessor, but what others have said already, a 'shim' that goes between the parser/lexer and bytecode generation which allows user code to inspect and modify the AST. This idea is not unusual and Python for example can do this. The idea is the basis of macro systems in Lisps, and Rust has a very nice implementation of it from what I've seen in passing. The system should be fully aware of the syntax, scoping, namespaces etc, the lack of which is the problem with C preprocessor for example. With regards to how JAI does this: https://www.youtube.com/watch?v=3DUTqZNujQOlA https://www.youtube.com/watch?v=3D59lKAlb6cRg&list=3DPLmV5I2fxaiCKfxMBrNsU1= kgKJXD3PkyxO&index=3D20&t=3D0s