Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108041 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46344 invoked from network); 8 Jan 2020 23:20:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jan 2020 23:20:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B433818053C for ; Wed, 8 Jan 2020 13:25:56 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE 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-yw1-f52.google.com (mail-yw1-f52.google.com [209.85.161.52]) (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 13:25:56 -0800 (PST) Received: by mail-yw1-f52.google.com with SMTP id 10so1861157ywv.5 for ; Wed, 08 Jan 2020 13:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DRPhfeH+n2+Js3ovKZzwDkfMZeLC7w4f8Z2v2mUIkJU=; b=SixHxpHVWZuB2zkzmPZCoF3csEIpgCXO5u4ugd3oAnGx+WnqVFE9/A8iVYgcjwPFh4 aDfLIWHt+G1s7lj3KxX+Kg2C7QkS7XPuC0dgTZJmjcYBwtNpRsMgAwyZroaDZk1BgfRa 8EyR0i0PUu4vY2qO2sQ50eOkFImHf04rb4nt2Rr7Rx2gLHIxjbZzOqwQs8Y8s10HffQp fFJkbSlBHQ4wqHh/rab5FLdAC2K9JAQZftf1wj8OT3vmzrXEX6nHqVJB+098uafrTVwO bZHj274DlrCiXMuMu+mz7a6fDnkIbpzZXv7nUaNT5rHFZtm0KDdbaMo++Oq2ZahznNtI uwZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DRPhfeH+n2+Js3ovKZzwDkfMZeLC7w4f8Z2v2mUIkJU=; b=lhXWrZ6PjPD+4Jt8hwOP48p4sZ40WDWRIYwhHPWAgMOoImARTelEQH3PnYhn/I7/2Y S8mFTqfk2HsXBOklvCRPIfcYEZ8L15hDwfiUnpw5odJeMNXcq0rNlRfsrJDV+g75Zww0 Qp5DSafcIPtT3luDMjUGzSwiYwDtYAy71LMJaBvi2qapWiMD4Sf5hZ1UQtMHzwrT7FXb Xx2BgH1ANEmVla1iITHcJhGD4EDELAKPLHk9wUhngmWURHjfUmYBfFwfJFIqlZOTdCla waA2hnjwZOXBl97hwjSBGGvvudDwz8jzImor5tp2aDFGEzTB/6B7gc+QNDrGvWbttZw4 VKFw== X-Gm-Message-State: APjAAAW+KqfTD2cK0RZ9PnAIZJHDPwhtLyHODaMzOESwRdlOyZkTV6Xs DVX8G/PloUX7q4TbAgT+AIc4Og== X-Google-Smtp-Source: APXvYqwp6pP+VxQXoW5gxVXpPLJpvo2qL+AL6R+GiJYoWp99K5sdOogp4B4s46vXXWOwoMGB81GSBQ== X-Received: by 2002:a0d:c905:: with SMTP id l5mr4799541ywd.44.1578518753007; Wed, 08 Jan 2020 13:25:53 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:6036:2cc1:2752:4a78? ([2601:c0:c680:5cc0:6036:2cc1:2752:4a78]) by smtp.gmail.com with ESMTPSA id i17sm2032368ywg.66.2020.01.08.13.25.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2020 13:25:52 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Wed, 8 Jan 2020 16:25:50 -0500 Cc: Rowan Tommins , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <5455D4D6-9B07-4957-BA98-489EE12FEDD8@newclarity.net> 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> To: Robert Hickman X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] Initializing constants once, with code? From: mike@newclarity.net (Mike Schinkel) > On Jan 8, 2020, at 11:10 AM, Robert Hickman = wrote: >=20 > 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. >=20 > With regards to how JAI does this: >=20 > https://www.youtube.com/watch?v=3DUTqZNujQOlA > = https://www.youtube.com/watch?v=3D59lKAlb6cRg&list=3DPLmV5I2fxaiCKfxMBrNsU= 1kgKJXD3PkyxO&index=3D20&t=3D0s Nice! =20 Never heard of JAI but will be checking it out. -Mike=