3
$\begingroup$

Are grammars programs? That is, are languages for grammar specification programming languages?

Update.

Motivation for the question is follows:

  1. To know whether languages for grammars are programming languages.
  2. Desire to know what words I use mean. Since no precise definition of term "programming language" exists we may bring it close to being by figuring out answers for such a tricky questions.
  3. Which programs can and which can't be written as grammars? (idea by Rehno Lindeque)

Update.

Observation that caused a question was:

  • Language of grammars has executable semantics like a programming language: every grammar relates input to output (sequence of characters of given alphabet to boolean or AST, depends on implementation), deterministically or not. For example, grammars written in PEG are deterministic "programs" while in BNF are not. CFGs are not Turing complete while unrestricted grammars are.
  • Grammar can be designed to carry out a computation on a computer -- actually a parser.
$\endgroup$

closed as off topic by Neel Krishnaswami, Mohammad Al-Turkistany, Dave Clarke May 6 '11 at 16:37

Questions on Theoretical Computer Science Stack Exchange are expected to relate to research-level theoretical computer science within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    $\begingroup$ My explanation of my downvote was almost as long as your entire question. :) $\endgroup$ – Jukka Suomela May 6 '11 at 14:11
  • 2
    $\begingroup$ A downvote simply means "This question is unclear or not useful", and this is exactly what I thought here. The question in the current form does not seem to make any sense – even worse, I actually spent some time trying to figure out what you might mean with the question, double-checking the usual definitions of formal grammars and programming languages, and even after that it did not seem to make any sense. I believe that there is a very good reason for you to ask the question, but you have not revealed it. Why do you think that grammars might be programming languages? $\endgroup$ – Jukka Suomela May 6 '11 at 14:35
  • 2
    $\begingroup$ One of the aspects of asking a good question is motivation. Your motivation appears to be "how do we define programming languages", and personally that motivation is not compelling. I didn't actually vote to close since I'm a moderator and it would be binding, but as a community member that's my opinion. $\endgroup$ – Suresh Venkat May 6 '11 at 15:38
  • 3
    $\begingroup$ The reason the question should be closed is because it is not at the level of research-level theoretical computer science. $\endgroup$ – Dave Clarke May 6 '11 at 16:37
  • 5
    $\begingroup$ David Barbour wrote up some ideas about Generative Grammar-based Computation on Lambda the Ultimate. I think the idea behind this, namely that describing grammars is programming and how far can this idea go, is a good theory B question, and deserves to be reopened. $\endgroup$ – Charles Stewart May 7 '11 at 7:48