Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Extracting types of sub-expression in transform
From: Ivan Godard (igodard_at_[hidden])
Date: 2008-10-19 05:46:30


    Eric Niebler wrote:

    I hadn't even considered the notion of a type system for a DSEL, but it
    makes perfect sense. Unfortunately, the only tutorial I found for van
    Wijngaarden grammars is here:

    http://homepages.cwi.nl/~steven/vw.html

    Perhaps it's because I'm tired, but I'm not making heads or tails of it
    at the moment. Can you point me to a gentler introduction?

    (Way back when I started with expression templates, I thought that
    calling them an "embedded language" was just a cute metaphor, but much
    can be gained from taking the serious view that these really *are*
    languages, deserving of grammars, semantic actions, ... type systems,
    too. Once we fully embrace that view, there's decades worth of
    programming language theory we can leverage.)

and:

    Joel Falcou wrote:

    Eric Niebler a ?crit :

> > (Way back when I started with expression templates, I thought that
> > calling them an "embedded language" was just a cute metaphor, but much
> > can be gained from taking the serious view that these really *are*
> > languages, deserving of grammars, semantic actions, ... type systems,
> > too. Once we fully embrace that view, there's decades worth of
> > programming language theory we can leverage.)
> >
>
    You just have described parts of my research plans ;)
    My current work try to get a way using ET and Concept in C++ to have a
    condensed way to describe operationnal and/or denotanionnal semantic for
    C++ DSEL. Guess I'll indeed have to swallow up this typing system rules
    myself.

    Ivan : Thanks for the references.
      

VWG was invented for and used to define Algol68. Personally, I find it
easiest to understand a formal system when I have a worked out example
in front of me. If you're the same way, I suggest starting with:

    http://en.wikipedia.org/wiki/Algol68
    http://burks.brighton.ac.uk/burks/language/other/a68rr/rrtoc.htm
    Lindsey, C.H. and van der Meulen, S.G., /Informal Introduction to
    ALGOL 68/, North-Holland, 1971 (also sometimes known as "Algol68
    without Tears")

I'm biased here - I was on the working group that produced the second
reference above - but I think that the only way to introduce semantics
into a practical and general DSEL system is via formal means. However,
both VWG and its exemplar in Algol68 have a very high intellectual
tractability barrier, akin to the barrier facing newcomers to Functional
Programming or Metaprogramming. But a casual note in Boost has already
turned up three people who at least see the problem. That's a start :-)

Ivan



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net