Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEG / String macro for Decapodes #88

Open
lukem12345 opened this issue Jan 31, 2025 · 0 comments · May be fixed by #89
Open

PEG / String macro for Decapodes #88

lukem12345 opened this issue Jan 31, 2025 · 0 comments · May be fixed by #89

Comments

@lukem12345
Copy link
Member

Taken from Dylan and Christian’s design doc:

[The Decapodes DSL is] built using a syntactic macro and a hand-written parser. The core problem with this technique lies in three areas.

Because Julia’s compiler has the unicode star symbol [for example] defined as an operator… we are confined to the set precedence and properties that Julia assumes the star operator to have.

The second problem lies in maintainability. Because we build a hand-written parser for each
DSL, developers have to deal with the complexity and bugs that arise from a complicated
program such as a parser. A small design change could cause hours of head-aches as one
attempts to modify a heavily recursive program, dealing with the mundane bugs that arise from
such.

The third problem lies in extendability. Because each DSL requires a hand-written parser, we are
unable to reuse core components to quickly and easily create new DSLs.

The solution is as follows. Our team will develop parsing expression grammars that will replace
the hand-written parsers and utilize string macros over syntactic macros. A parsing expression
grammar or a PEG is a formal grammar used for recognizing strings in the language defined
(“Parsing expression grammar”, 2024). PEGs are defined by a collection of parsing expressions
that can reference each other. Through this, we can rewrite an existing parser as a PEG where
each recursive parsing function is a parsing expression.

To be closed by PR associated with https://github.com/cscaff/DiagrammaticEquations.jl/tree/PEG-DSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant