Re: Looking for volunteers for XL

tm <>
Tue, 3 Jan 2012 09:28:24 -0800 (PST)

          From comp.compilers

Related articles
[11 earlier articles]
Re: Looking for volunteers for XL (glen herrmannsfeldt) (2011-11-29)
Re: Looking for volunteers for XL (ardjussi) (2011-11-30)
Re: Looking for volunteers for XL (Kaz Kylheku) (2011-12-01)
Re: Looking for volunteers for XL (Kaz Kylheku) (2011-12-01)
Re: Looking for volunteers for XL (Alex McDonald) (2011-12-01)
Re: Looking for volunteers for XL (2011-12-13)
Re: Looking for volunteers for XL (tm) (2012-01-03)
| List of all articles for this month |

From: tm <>
Newsgroups: comp.compilers
Date: Tue, 3 Jan 2012 09:28:24 -0800 (PST)
Organization: Compilers Central
References: 11-11-048 11-11-053 11-11-054 11-11-058 11-11-060
Keywords: design
Posted-Date: 06 Jan 2012 10:00:44 EST

On Nov 27 2011, 11:24 pm, "BartC" <> wrote:
> A self-extensible language sounds like a good idea and might well
> work. I admit I've never used one ...

AFAIK you tried Seed7 a little bit (Thank you four your
fannkuch-redux benchmark program). So you tied an extensible
language without noticing that it is extensible. :-)

> (although I did play with designing
> one once, then gave up),

The trick is: You need to restrict the possibilities somehow to
"reasonable" features. I know that this depends on the point of

> and have no idea what is and isn't possible;
> could you create a language that has C syntax for example, then add in
> a few Cobol-like statements or APL expressions?

Funny, such things were the original idea, which lead to Seed7.
Later I found that some restrictions really make sense. BTW:
Seed7 could do this, when APL operators are restricted to ASCII. :-)
The braces of C would conflict with existing braces in the
predefined Seed7 language (Seed7 uses them to define set literals).
So some of the existing Seed7 definitions need to be omitted, which
I did for the following example. The example defines a
C if-statement:

$ include "seed7x_05.s7i";

# Define the syntax of a simple C if-statment:
$ syntax expr: .if.().{.().} is -> 25;

# Define the semantic of a simple C if-statement:
const proc: if (in boolean: cond) {
                              (in proc: statement)
                        } is func
                                if cond then
                                end if;
                            end func;

const proc: main is func
        # Use the C if-statement:
        if (TRUE) {
    end func;

I left out COBOL and APL, but you should see the principle.
BTW: I don't think that such a brutal mix of language features
(C, COBOL, APL) makes sense.

> Or is the syntax it's
> capable of rather more limited?

Seed7 is not overengineered, and other extensible languages should
also avoid this pitfall.

Greetings Thomas Mertes

Seed7 Homepage:
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.