Re: [Boost-users] [Proto] Extracting types of sub-expression in transform
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
Ivan Godard wrote:
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:
I don't see any discussion there of van Wijngaarden grammars, or even anything that is recognizable as a formal grammar. What am I supposed to be looking at on that page?
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 see a large table of contents there. Care to narrow it down for me?
I'm biased here - I was on the working group that produced the second reference above -
Very cool.
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
Confirmed. ;-)
, 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 :-)
I want to learn this stuff, but the references you've provided so far haven't helped. How badly do you want to see something like this in Boost? Badly enough to jump in and get your hands dirty with some code? Maybe you could help me to add two-level grammar support to Proto. -- Eric Niebler BoostPro Computing http://www.boostpro.com
Eric Niebler a écrit : I want to learn this stuff, but the references you've provided so far haven't helped. How badly do you want to see something like this in Boost? Badly enough to jump in and get your hands dirty with some code? Maybe you could help me to add two-level grammar support to Proto. Well, is there room for *yet another guy* in this stuff cause I'm really interested to get somethign out of this. -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
Eric Niebler wrote:
I want to learn this stuff, but the references you've provided so far haven't helped. How badly do you want to see something like this in Boost? Badly enough to jump in and get your hands dirty with some code? Maybe you could help me to add two-level grammar support to Proto.
FWIW, there's an annex on this in the ISO EBNF documentation. Here's the final draft: http://www.cl.cam.ac.uk/~mgk25/iso-14977.pdf Annex A suggests how Extended BNF might be extended to define a two-level grammar. I've had interest on this when I came across that part. Nothing much there, just FYI... Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (4)
-
Eric Niebler
-
Ivan Godard
-
Joel de Guzman
-
joel falcou