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

Allow closure as semantic action #41

Closed
ptal opened this Issue Feb 23, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@ptal
Owner

ptal commented Feb 23, 2015

No description provided.

@ptal

This comment has been minimized.

Show comment
Hide comment
@ptal

ptal Jul 11, 2016

Owner

I will close this because I feel we would lose in clarity if we allow this kind of semantic action. Also, I would like to keep the grammar independent from the host language.

Owner

ptal commented Jul 11, 2016

I will close this because I feel we would lose in clarity if we allow this kind of semantic action. Also, I would like to keep the grammar independent from the host language.

@ptal ptal closed this Jul 11, 2016

@pczarn

This comment has been minimized.

Show comment
Hide comment
@pczarn

pczarn Jul 11, 2016

I remember some other author of a parser generator saying he wants to keep the specification language independent from the host language. What's the harm in making them dependent?

You can make more than one version of a parser (for example OMeta/JS, OMeta/Ruby, PyMeta, etc.). Or, when a parser is ported to any other language, that language can just embed Rust.

pczarn commented Jul 11, 2016

I remember some other author of a parser generator saying he wants to keep the specification language independent from the host language. What's the harm in making them dependent?

You can make more than one version of a parser (for example OMeta/JS, OMeta/Ruby, PyMeta, etc.). Or, when a parser is ported to any other language, that language can just embed Rust.

@ptal

This comment has been minimized.

Show comment
Hide comment
@ptal

ptal Jul 11, 2016

Owner

I feel that grammars with code inside are less clear. Also, it doesn't help people to read a grammar if they don't understand the host-language. Another, more practical reason, is that you would need to force the user to annotate the closure with its return type which make things looking even worst. I'm not even sure you wouldn't need to annotate the parameters too.

Summary: Too much pain for little benefits.

Owner

ptal commented Jul 11, 2016

I feel that grammars with code inside are less clear. Also, it doesn't help people to read a grammar if they don't understand the host-language. Another, more practical reason, is that you would need to force the user to annotate the closure with its return type which make things looking even worst. I'm not even sure you wouldn't need to annotate the parameters too.

Summary: Too much pain for little benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment