You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I know one reason that original CoffeeScript is almost impossible to extend is generation of grammar at compile-time instead of runtime.
It seems that CoffeeScriptRedux also uses grammar rules defined as PEG grammar and generates the JS processor at compile-time. Is it possible to extend those grammar rules at runtime?
Thanks, Alex.
The text was updated successfully, but these errors were encountered:
This was a decision that had to be made very early on in the project. I could use a PEG to generate a parser with some very desirable properties or use parser combinators to define a parser with other desirable properties (namely, the runtime extensibility you mention). I went with the PEG and its linear-time parsing guarantee when memoised. Compiler/optimiser extensibility were important, so those have very versatile hooks built in. But, unfortunately, if you want to extend the syntax, you're going to need to fork it and modify the grammar.
I looked into doing this with Redux last night. I expect just additions to grammar, compiler, and nodes files. These kinds of modifications could be abstracted if it's a common use case? I expect you have a vision for plugins though.
As far as I know one reason that original CoffeeScript is almost impossible to extend is generation of grammar at compile-time instead of runtime.
It seems that CoffeeScriptRedux also uses grammar rules defined as PEG grammar and generates the JS processor at compile-time. Is it possible to extend those grammar rules at runtime?
Thanks, Alex.
The text was updated successfully, but these errors were encountered: