> After posting my objection to pre-processing I remembered there was another 
> reason I object to pre-processors that is even more significant than lack 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 
> developers 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=UTqZNujQOlA
https://www.youtube.com/watch?v=59lKAlb6cRg&list=PLmV5I2fxaiCKfxMBrNsU1kgKJXD3PkyxO&index=20&t=0s

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to