archives

generating interpreters, IDEs, etc., from simple specifications?

I've been wondering about this for a while, google and LtU archives didn't bring up anything:
Is it posssible to generate an interpreter and an IDE for a language by providing a simple BNF type specification?

My understanding is that BNF (or EBNF) as it is usually used by parser-generators is not strong enough for this task because:
1. The specification has to deviate from its simple language representation due to problems such as left recursion.
2. CFG, by definition, can't do context based analysis, doesn't know anything about typing rules, in other words, doesn't know about the semantics of a language.

Regarding the first problem, I found the following from CTM (p. 641, last paragraph) interesting:
"Relational programs can be written to parse highly ambiguous grammars. This is one of the most flexible ways to do parsing. It can parse grammars with absolutely no restriction on the form of the grammar. The disadvantage is that if the grammar is highly ambiguous, the parser can be extremely slow."

Doesn't this mean that we can describe a general grammar which is good not only for parsing, but also for extracting a simple, clean AST (let's say we accept the slow speed for the sake of building an easy language-prototyping system).

Regarding the semantics of a language: why couldn't we use some sort of operational semantics, the way they are described in Pierce's TAPL (actually PVR has has an SOS in CTM...lol :) )

In other words, given the following:
--A simple logic language with a context, well integrated with an EBNF syntax (an 'extended' EBNF),
--A way to tell this 'system' where to find existing source code files (so the generated IDE can parse those 'libraries' to provide code-completion)
--Typical OS interface routines (to print to screen, read from keyboard, read/write HD, etc.)
What else is required? Would this scale to non-[OO, procedural, functional] languages?

(I understand that many existing languages are not easy to define using TAPL type rules...perhaps a system such as this, with all its benefits, will encourage non-expert language creators to put more thought into semantics)

Declarative Networking: Language, Execution and Optimization

Declarative Networking: Language, Execution and Optimization, Boon Thau Loo, Tyson Condie, Minos Garofalakis, David A. Gay, Joseph M. Hellerstein, Petros Maniatis, Raghu Ramakrishnan, Timothy Roscoe and Ion Stoica.

First, we motivate and formally define the Network Datalog (NDlog) language for declarative network specifications.
Second, we introduce and prove correct relaxed versions of the traditional semi-naive query evaluation technique, to overcome fundamental problems of the traditional technique in an asynchronous distributed setting. Third, we consider the dynamics of network state, and formalize the “eventual consistency” of our programs even when bursts of updates can arrive in the midst of query execution. Fourth, we present a number of query optimization opportunities that arise in the declarative networking context, including applications of traditional techniques as well as new optimizations. Last, we present evaluation results of the above ideas implemented in our P2 declarative networking system, running on 100 machines over the Emulab network testbed.

I will be the first to admit that I somehow fundamentally do not get the logic programming style, but presenting a routing discovery protocol in about eight lines of code is pretty cool.