Topic: Generalizing constexpr to an AST macro system


Author: snk_kid <korcan.hussein@googlemail.com>
Date: Fri, 7 Nov 2014 03:15:03 -0800 (PST)
Raw View
------=_Part_139_1997219794.1415358903474
Content-Type: text/plain; charset=UTF-8

Hi, it seems to me to that constexpr functions could be an excellent base
to add support for a real solution to meta-programming one which allows C++
programmers to not just execute code at compile-time but also transform &
generate code all in the same language as code written for run-time
execution.

The advantages over template/pre-processor meta-programming would be:

   - The object and meta-language are the same (well one being a slightly
   larger super-set) instead of a completely different arcane language that
   only the 1% understand and *willing *to use.
   - More easily readable, maintainable, debug-able to the 99% of C++
   programmers.
   - Should be more easier to add debugging support for stepping macro
   expansions.
   - Keeps C++ templates more simple by not requiring various extensions or
   hacks for the sake of meta-programming support.
   - No limitations for code generation compared to using templates.
   Imagine going as far as querying a DB to generate code at compile-time,
   that's the kind of expressive power that languages like
   Lisp/Nermele/Template Haskell have.
   - Is Type safe.
   - Constexpr macros which would respect and work with modules/namespaces
   and may have better build times than the equivalent template based solution.
   - Maybe used as a base for user-defined C++ attributes. Nermele does
   this for user-defined .NET attributes.
   - Maybe used as a base for syntax extensions. This may actually make the
   language simpler because then people could add features they would like
   very simply as library, could be used as way to start proposals for adding
   to the standard too (either as language features or libraries).
   - Better, cleaner solution to compile-time reflection/introspection.

In terms of what is needed to add such support to language I think you only
need to add about 3 new language features:

   - Code quotation operator - tells the compiler to convert a C++
   expression into an AST instead of being executed at compile-time.
   - Splicing operator - to decompose/compose ASTs.
   - Hygienic Identifier generator - generate & use variables names inside
   of code gen.

Additionally support for case/match pattern matching may simplify the
manipulation of ASTs.

I believe the hardest and biggest part of adding this is not the language
additions part but actually standardizing a library for the abstract-syntax
tree plus some more libraries features.

Nemerle maybe a good place to take inspiration from as it has an excellent
type-safe AST macro system designed to work with a hybrid OO-functional
language, used for user-defined attributes, syntax extensions, etc check
here if interested:

https://github.com/rsdn/nemerle/wiki/Macros-tutorial

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_139_1997219794.1415358903474
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi, it seems to me to that constexpr functions could be an=
 excellent base to add support for a real solution to meta-programming one =
which allows C++ programmers to not just execute code at compile-time but a=
lso transform &amp; generate code all in the same language as code written =
for run-time execution.<br><br>The advantages over template/pre-processor m=
eta-programming would be:<br><ul><li>The object and meta-language are the s=
ame (well one being a slightly larger super-set) instead of a completely di=
fferent arcane language that only the 1% understand and <b>willing </b>to u=
se.</li><li>More easily readable, maintainable, debug-able to the 99% of C+=
+ programmers.</li><li>Should be more easier to add debugging support for s=
tepping macro expansions.<br></li><li>Keeps C++ templates more simple by no=
t requiring various extensions or hacks for the sake of meta-programming su=
pport.<br></li><li>No limitations for code generation compared to using tem=
plates. Imagine going as far as querying a DB to generate code at compile-t=
ime, that's the kind of expressive power that languages like Lisp/Nermele/T=
emplate Haskell have.</li><li>Is Type safe.<br></li><li>Constexpr macros wh=
ich would respect and work with modules/namespaces and may have better buil=
d times than the equivalent template based solution.<br></li><li>Maybe used=
 as a base for user-defined C++ attributes. Nermele does this for user-defi=
ned .NET attributes.<br></li><li>Maybe used as a base for syntax extensions=
.. This may actually make the language simpler because then people could add=
 features they would like very simply as library, could be used as way to s=
tart proposals for adding to the standard too (either as language features =
or libraries).</li><li>Better, cleaner solution to compile-time reflection/=
introspection.</li></ul><p>In terms of what is needed to add such support t=
o language I think you only need to add about 3 new language features:</p><=
ul><li>Code quotation operator - tells the compiler to convert a C++ expres=
sion into an AST instead of being executed at compile-time.<br></li><li>Spl=
icing operator - to decompose/compose ASTs.</li><li>Hygienic Identifier gen=
erator - generate &amp; use variables names inside of code gen.</li></ul><p=
>Additionally support for case/match pattern matching may simplify the mani=
pulation of ASTs.<br></p><p> I believe the hardest and biggest part of addi=
ng this is not the language additions part but actually standardizing a lib=
rary for the abstract-syntax tree plus some more libraries features.<br></p=
><p></p><p>Nemerle maybe a good place to take inspiration from as it has an=
 excellent type-safe AST macro system designed to work with a hybrid OO-fun=
ctional language, used for user-defined attributes, syntax extensions, etc =
check here if interested:</p><p>https://github.com/rsdn/nemerle/wiki/Macros=
-tutorial<br></p></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_139_1997219794.1415358903474--

.


Author: Joel FALCOU <joel.falcou@gmail.com>
Date: Fri, 07 Nov 2014 12:41:32 +0100
Raw View
This is a multi-part message in MIME format.
--------------030303020105040302090203
Content-Type: text/plain; charset=UTF-8; format=flowed

I am very interested by this ideas. As an avid expression
tempalte/meta-programming (ab)user, such a work could make those
techniques first class citizen of the language.
One good entry point for this library of ast is maybe reusing/recycling
what Eric Niebler's Proto is achieving.

Anyway, I am up for discussign this further.


On 07/11/2014 12:15, snk_kid wrote:
> Hi, it seems to me to that constexpr functions could be an excellent
> base to add support for a real solution to meta-programming one which
> allows C++ programmers to not just execute code at compile-time but
> also transform & generate code all in the same language as code
> written for run-time execution.In terms of what is needed to add such
> support to language I think you only need to add about 3 new language
> features:
>
>   * Code quotation operator - tells the compiler to convert a C++
>     expression into an AST instead of being executed at compile-time.
>   * Splicing operator - to decompose/compose ASTs.
>   * Hygienic Identifier generator - generate & use variables names
>     inside of code gen.
>
> Additionally support for case/match pattern matching may simplify the
> manipulation of ASTs.
>
> I believe the hardest and biggest part of adding this is not the
> language additions part but actually standardizing a library for the
> abstract-syntax tree plus some more libraries features.
>
> Nemerle maybe a good place to take inspiration from as it has an
> excellent type-safe AST macro system designed to work with a hybrid
> OO-functional language, used for user-defined attributes, syntax
> extensions, etc check here if interested:
>
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
>
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--------------030303020105040302090203
Content-Type: text/html; charset=UTF-8

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I am very interested by this ideas. As an avid expression
    tempalte/meta-programming (ab)user, such a work could make those
    techniques first class citizen of the language.<br>
    One good entry point for this library of ast is maybe
    reusing/recycling what Eric Niebler's Proto is achieving.<br>
    <br>
    Anyway, I am up for discussign this further.<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 07/11/2014 12:15, snk_kid wrote:<br>
    </div>
    <blockquote
      cite="mid:2c19c531-ac1e-4374-bfb5-357a794a71e1@isocpp.org"
      type="cite">
      <div dir="ltr">Hi, it seems to me to that constexpr functions
        could be an excellent base to add support for a real solution to
        meta-programming one which allows C++ programmers to not just
        execute code at compile-time but also transform &amp; generate
        code all in the same language as code written for run-time
        execution.In terms of what is needed to add such support to
        language I think you only need to add about 3 new language
        features:
        <ul>
          <li>Code quotation operator - tells the compiler to convert a
            C++ expression into an AST instead of being executed at
            compile-time.<br>
          </li>
          <li>Splicing operator - to decompose/compose ASTs.</li>
          <li>Hygienic Identifier generator - generate &amp; use
            variables names inside of code gen.</li>
        </ul>
        <p>Additionally support for case/match pattern matching may
          simplify the manipulation of ASTs.<br>
        </p>
        <p> I believe the hardest and biggest part of adding this is not
          the language additions part but actually standardizing a
          library for the abstract-syntax tree plus some more libraries
          features.<br>
        </p>
        <p>Nemerle maybe a good place to take inspiration from as it has
          an excellent type-safe AST macro system designed to work with
          a hybrid OO-functional language, used for user-defined
          attributes, syntax extensions, etc check here if interested:</p>
        <p><a class="moz-txt-link-freetext" href="https://github.com/rsdn/nemerle/wiki/Macros-tutorial">https://github.com/rsdn/nemerle/wiki/Macros-tutorial</a><br>
        </p>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

--------------030303020105040302090203--

.


Author: snk_kid <korcan.hussein@googlemail.com>
Date: Thu, 13 Nov 2014 02:33:30 -0800 (PST)
Raw View
------=_Part_83_973458461.1415874810608
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=20

Not to say that Proto is bad but I do think it would be overly complicated=
=20
than it needs to be for an AST library (one that compiler vendors would=20
have to implement). To me Proto solves a different (but kind of related)=20
problem.

For the AST/compiler internals library I don=E2=80=99t know you need to use=
 any=20
template meta-programming and/or expression templates just that all the=20
classes/functions should be constexpr so that they can be used in constexpr=
=20
functions.

I think maybe a simplified subset of Clang=E2=80=99s AST APIs could be used=
 for=20
standardization.

Standardizing such a library may have other benefits; maybe it could double=
=20
up as an API for runtime reflection and tooling.

Imagine 1 library for both compile-time and run-time introspection and=20
reflection.
On Monday, November 10, 2014 2:23:45 AM UTC, Joel Falcou wrote:
>
>  I am very interested by this ideas. As an avid expression=20
> tempalte/meta-programming (ab)user, such a work could make those techniqu=
es=20
> first class citizen of the language.
> One good entry point for this library of ast is maybe reusing/recycling=
=20
> what Eric Niebler's Proto is achieving.
>
> Anyway, I am up for discussign this further.
>
>
> On 07/11/2014 12:15, snk_kid wrote:
> =20
> Hi, it seems to me to that constexpr functions could be an excellent base=
=20
> to add support for a real solution to meta-programming one which allows C=
++=20
> programmers to not just execute code at compile-time but also transform &=
=20
> generate code all in the same language as code written for run-time=20
> execution.In terms of what is needed to add such support to language I=20
> think you only need to add about 3 new language features:=20
>   =20
>    - Code quotation operator - tells the compiler to convert a C++=20
>    expression into an AST instead of being executed at compile-time.
>     - Splicing operator - to decompose/compose ASTs.=20
>    - Hygienic Identifier generator - generate & use variables names=20
>    inside of code gen.=20
>
> Additionally support for case/match pattern matching may simplify the=20
> manipulation of ASTs.
> =20
> I believe the hardest and biggest part of adding this is not the language=
=20
> additions part but actually standardizing a library for the abstract-synt=
ax=20
> tree plus some more libraries features.
> =20
> Nemerle maybe a good place to take inspiration from as it has an excellen=
t=20
> type-safe AST macro system designed to work with a hybrid OO-functional=
=20
> language, used for user-defined attributes, syntax extensions, etc check=
=20
> here if interested:
>
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
> =20
> =20
>=20

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_83_973458461.1415874810608
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]-->

<p class=3D"MsoNormal">Not to say that Proto is bad but I do think it would=
 be
overly complicated than it needs to be for an AST library (one that compile=
r
vendors would have to implement). To me Proto solves a different (but kind =
of
related) problem.</p>

<p class=3D"MsoNormal">For the AST/compiler internals library I don=E2=80=
=99t know you need
to use any template meta-programming and/or expression templates just that =
all
the classes/functions should be constexpr so that they can be used in const=
expr
functions.</p>

<p class=3D"MsoNormal">I think maybe a simplified subset of Clang=E2=80=99s=
 AST APIs could
be used for standardization.</p>

<p class=3D"MsoNormal">Standardizing such a library may have other benefits=
; maybe
it could double up as an API for runtime reflection and tooling.</p>

<p class=3D"MsoNormal">Imagine 1 library for both compile-time and run-time
introspection and reflection.<br></p>On Monday, November 10, 2014 2:23:45 A=
M UTC, Joel Falcou wrote:<blockquote class=3D"gmail_quote" style=3D"margin:=
 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    I am very interested by this ideas. As an avid expression
    tempalte/meta-programming (ab)user, such a work could make those
    techniques first class citizen of the language.<br>
    One good entry point for this library of ast is maybe
    reusing/recycling what Eric Niebler's Proto is achieving.<br>
    <br>
    Anyway, I am up for discussign this further.<br>
    <br>
    <br>
    <div>On 07/11/2014 12:15, snk_kid wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">Hi, it seems to me to that constexpr functions
        could be an excellent base to add support for a real solution to
        meta-programming one which allows C++ programmers to not just
        execute code at compile-time but also transform &amp; generate
        code all in the same language as code written for run-time
        execution.In terms of what is needed to add such support to
        language I think you only need to add about 3 new language
        features:
        <ul>
          <li>Code quotation operator - tells the compiler to convert a
            C++ expression into an AST instead of being executed at
            compile-time.<br>
          </li>
          <li>Splicing operator - to decompose/compose ASTs.</li>
          <li>Hygienic Identifier generator - generate &amp; use
            variables names inside of code gen.</li>
        </ul>
        <p>Additionally support for case/match pattern matching may
          simplify the manipulation of ASTs.<br>
        </p>
        <p> I believe the hardest and biggest part of adding this is not
          the language additions part but actually standardizing a
          library for the abstract-syntax tree plus some more libraries
          features.<br>
        </p>
        <p>Nemerle maybe a good place to take inspiration from as it has
          an excellent type-safe AST macro system designed to work with
          a hybrid OO-functional language, used for user-defined
          attributes, syntax extensions, etc check here if interested:</p>
        <p><a href=3D"https://github.com/rsdn/nemerle/wiki/Macros-tutorial"=
 target=3D"_blank" onmousedown=3D"this.href=3D'https://www.google.com/url?q=
\75https%3A%2F%2Fgithub.com%2Frsdn%2Fnemerle%2Fwiki%2FMacros-tutorial\46sa\=
75D\46sntz\0751\46usg\75AFQjCNG19gp5j5nDGMk31QWmrf6Wdgoo_g';return true;" o=
nclick=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.=
com%2Frsdn%2Fnemerle%2Fwiki%2FMacros-tutorial\46sa\75D\46sntz\0751\46usg\75=
AFQjCNG19gp5j5nDGMk31QWmrf6Wdgoo_g';return true;">https://github.com/rsdn/<=
wbr>nemerle/wiki/Macros-tutorial</a><br>
        </p>
      </div>
      <br>
    </blockquote>
    <br>
  </div>

</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_83_973458461.1415874810608--

.


Author: snk_kid <korcanh@gmail.com>
Date: Sun, 16 Nov 2014 02:48:22 -0800 (PST)
Raw View
------=_Part_1940_737249717.1416134902396
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



What would you like to discuss about it?

Regarding your comment about Proto as a base for an AST/Compiler internals=
=20
library, not to say that Proto is bad but I do think it would be overkill=
=20
for a such a library (one which every compiler vendor would have to=20
implement).

For me Proto solves a different but very related problem, I don=E2=80=99t t=
hink it=20
is necessary (or even desirable) for an AST/Compiler internals library to=
=20
need any template metaprogramming and/or expressions templates so long as=
=20
all the classes/functions are constexpr so they can be used in constexpr=20
functions (which act as AST macros). Not to say that it shouldn't use=20
templates just that any template meta-programming magic shouldn't be=20
necessary.

I think maybe a simplified subset of Clang=E2=80=99s AST library could be u=
sed as a=20
base for standardization.

Another potential benefit of standardizing such a library that it could=20
also be used (as base) for run-time reflection, language tooling, etc.

Imagine a 1 library that is used both for compile-time and runtime=20
introspection/reflection and not being an overly complicated API.


On Monday, November 10, 2014 2:23:45 AM UTC, Joel Falcou wrote:
>
>  I am very interested by this ideas. As an avid expression=20
> tempalte/meta-programming (ab)user, such a work could make those techniqu=
es=20
> first class citizen of the language.
> One good entry point for this library of ast is maybe reusing/recycling=
=20
> what Eric Niebler's Proto is achieving.
>
> Anyway, I am up for discussign this further.
>
>
> On 07/11/2014 12:15, snk_kid wrote:
> =20
> Hi, it seems to me to that constexpr functions could be an excellent base=
=20
> to add support for a real solution to meta-programming one which allows C=
++=20
> programmers to not just execute code at compile-time but also transform &=
=20
> generate code all in the same language as code written for run-time=20
> execution.In terms of what is needed to add such support to language I=20
> think you only need to add about 3 new language features:=20
>   =20
>    - Code quotation operator - tells the compiler to convert a C++=20
>    expression into an AST instead of being executed at compile-time.
>     - Splicing operator - to decompose/compose ASTs.=20
>    - Hygienic Identifier generator - generate & use variables names=20
>    inside of code gen.=20
>
> Additionally support for case/match pattern matching may simplify the=20
> manipulation of ASTs.
> =20
> I believe the hardest and biggest part of adding this is not the language=
=20
> additions part but actually standardizing a library for the abstract-synt=
ax=20
> tree plus some more libraries features.
> =20
> Nemerle maybe a good place to take inspiration from as it has an excellen=
t=20
> type-safe AST macro system designed to work with a hybrid OO-functional=
=20
> language, used for user-defined attributes, syntax extensions, etc check=
=20
> here if interested:
>
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
> =20
> =20
>=20

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_1940_737249717.1416134902396
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt;" id=3D"docs-internal-guid-4b16b38e-b834-a979-8ff9-5f9f5898=
20ab"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;">What would you like to d=
iscuss about it?</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;mar=
gin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:A=
rial;color:#000000;background-color:transparent;font-weight:normal;font-sty=
le:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;=
">Regarding your comment about Proto as a base for an AST/Compiler internal=
s library, not to say that Proto is bad but I do think it would be overkill=
 for a such a library (one which every compiler vendor would have to implem=
ent).</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:=
#000000;background-color:transparent;font-weight:normal;font-style:normal;f=
ont-variant:normal;text-decoration:none;vertical-align:baseline;">For me Pr=
oto solves a different but very related problem, I don=E2=80=99t think it i=
s necessary (or even desirable) for an AST/Compiler internals library to ne=
ed any template metaprogramming and/or expressions templates so long as all=
 the classes/functions are constexpr so they can be used in constexpr funct=
ions (which act as AST macros). Not to say that it shouldn't use templates =
just that any template meta-programming magic shouldn't be necessary.<br></=
span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000=
;background-color:transparent;font-weight:normal;font-style:normal;font-var=
iant:normal;text-decoration:none;vertical-align:baseline;">I think maybe a =
simplified subset of Clang=E2=80=99s AST library could be used as a base fo=
r standardization.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;m=
argin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family=
:Arial;color:#000000;background-color:transparent;font-weight:normal;font-s=
tyle:normal;font-variant:normal;text-decoration:none;vertical-align:baselin=
e;">Another potential benefit of standardizing such a library that it could=
 also be used (as base) for run-time reflection, language tooling, etc.</sp=
an></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;b=
ackground-color:transparent;font-weight:normal;font-style:normal;font-varia=
nt:normal;text-decoration:none;vertical-align:baseline;">Imagine a 1 librar=
y that is used both for compile-time and runtime introspection/reflection a=
nd not being an overly complicated API.</span></p><br><br>On Monday, Novemb=
er 10, 2014 2:23:45 AM UTC, Joel Falcou wrote:<blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padd=
ing-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    I am very interested by this ideas. As an avid expression
    tempalte/meta-programming (ab)user, such a work could make those
    techniques first class citizen of the language.<br>
    One good entry point for this library of ast is maybe
    reusing/recycling what Eric Niebler's Proto is achieving.<br>
    <br>
    Anyway, I am up for discussign this further.<br>
    <br>
    <br>
    <div>On 07/11/2014 12:15, snk_kid wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">Hi, it seems to me to that constexpr functions
        could be an excellent base to add support for a real solution to
        meta-programming one which allows C++ programmers to not just
        execute code at compile-time but also transform &amp; generate
        code all in the same language as code written for run-time
        execution.In terms of what is needed to add such support to
        language I think you only need to add about 3 new language
        features:
        <ul>
          <li>Code quotation operator - tells the compiler to convert a
            C++ expression into an AST instead of being executed at
            compile-time.<br>
          </li>
          <li>Splicing operator - to decompose/compose ASTs.</li>
          <li>Hygienic Identifier generator - generate &amp; use
            variables names inside of code gen.</li>
        </ul>
        <p>Additionally support for case/match pattern matching may
          simplify the manipulation of ASTs.<br>
        </p>
        <p> I believe the hardest and biggest part of adding this is not
          the language additions part but actually standardizing a
          library for the abstract-syntax tree plus some more libraries
          features.<br>
        </p>
        <p>Nemerle maybe a good place to take inspiration from as it has
          an excellent type-safe AST macro system designed to work with
          a hybrid OO-functional language, used for user-defined
          attributes, syntax extensions, etc check here if interested:</p>
        <p><a href=3D"https://github.com/rsdn/nemerle/wiki/Macros-tutorial"=
 target=3D"_blank" onmousedown=3D"this.href=3D'https://www.google.com/url?q=
\75https%3A%2F%2Fgithub.com%2Frsdn%2Fnemerle%2Fwiki%2FMacros-tutorial\46sa\=
75D\46sntz\0751\46usg\75AFQjCNG19gp5j5nDGMk31QWmrf6Wdgoo_g';return true;" o=
nclick=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.=
com%2Frsdn%2Fnemerle%2Fwiki%2FMacros-tutorial\46sa\75D\46sntz\0751\46usg\75=
AFQjCNG19gp5j5nDGMk31QWmrf6Wdgoo_g';return true;">https://github.com/rsdn/<=
wbr>nemerle/wiki/Macros-tutorial</a><br>
        </p>
      </div>
      <br>
    </blockquote>
    <br>
  </div>

</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1940_737249717.1416134902396--

.


Author: snk_kid <korcanh@gmail.com>
Date: Sun, 16 Nov 2014 02:51:22 -0800 (PST)
Raw View
------=_Part_2104_1931540919.1416135082324
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

What would you like to discuss about it?

Regarding your comment about Proto as a base for an AST/Compiler internals=
=20
library, not to say that Proto is bad but I do think it would be overkill=
=20
for a such a library (one which every compiler vendor would have to=20
implement).

For me Proto solves a different but very related problem, I don=E2=80=99t t=
hink it=20
is necessary (or even desirable) for an AST/Compiler internals library to=
=20
need any template meta-programming and/or expressions templates so long as=
=20
all the classes/functions are constexpr so they can be used in constexpr=20
functions (which act as AST macros).

I think maybe a simplified subset of Clang=E2=80=99s AST library could be u=
sed as a=20
base for standardization.

Another potential benefit of standardizing such a library that it could=20
also be used (as base) for run-time reflection, language tooling, etc.

Imagine a 1 library that is used both compile-time and runtime=20
introspection/reflection and not being an overly complicated API.

On Monday, November 10, 2014 2:23:45 AM UTC, Joel Falcou wrote:
>
>  I am very interested by this ideas. As an avid expression=20
> tempalte/meta-programming (ab)user, such a work could make those techniqu=
es=20
> first class citizen of the language.
> One good entry point for this library of ast is maybe reusing/recycling=
=20
> what Eric Niebler's Proto is achieving.
>
> Anyway, I am up for discussign this further.
>
>
> On 07/11/2014 12:15, snk_kid wrote:
> =20
> Hi, it seems to me to that constexpr functions could be an excellent base=
=20
> to add support for a real solution to meta-programming one which allows C=
++=20
> programmers to not just execute code at compile-time but also transform &=
=20
> generate code all in the same language as code written for run-time=20
> execution.In terms of what is needed to add such support to language I=20
> think you only need to add about 3 new language features:=20
>   =20
>    - Code quotation operator - tells the compiler to convert a C++=20
>    expression into an AST instead of being executed at compile-time.
>    - Splicing operator - to decompose/compose ASTs.
>    - Hygienic Identifier generator - generate & use variables names=20
>    inside of code gen.
>
> Additionally support for case/match pattern matching may simplify the=20
> manipulation of ASTs.
> =20
> I believe the hardest and biggest part of adding this is not the language=
=20
> additions part but actually standardizing a library for the abstract-synt=
ax=20
> tree plus some more libraries features.
> =20
> Nemerle maybe a good place to take inspiration from as it has an excellen=
t=20
> type-safe AST macro system designed to work with a hybrid OO-functional=
=20
> language, used for user-defined attributes, syntax extensions, etc check=
=20
> here if interested:
>
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
> =20
> =20
>=20

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_2104_1931540919.1416135082324
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">What would you like to discuss about it?<br><br>Regarding =
your comment about Proto as a base for an AST/Compiler internals library, n=
ot to say that Proto is bad but I do think it would be overkill for a such =
a library (one which every compiler vendor would have to implement).<br><br=
>For me Proto solves a different but very related problem, I don=E2=80=99t =
think it is necessary (or even desirable) for an AST/Compiler internals lib=
rary to need any template meta-programming and/or expressions templates so =
long as all the classes/functions are constexpr so they can be used in cons=
texpr functions (which act as AST macros).<br><br>I think maybe a simplifie=
d subset of Clang=E2=80=99s AST library could be used as a base for standar=
dization.<br><br>Another potential benefit of standardizing such a library =
that it could also be used (as base) for run-time reflection, language tool=
ing, etc.<br><br>Imagine a 1 library that is used both compile-time and run=
time introspection/reflection and not being an overly complicated API.<br><=
br>On Monday, November 10, 2014 2:23:45 AM UTC, Joel Falcou wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF">
    I am very interested by this ideas. As an avid expression
    tempalte/meta-programming (ab)user, such a work could make those
    techniques first class citizen of the language.<br>
    One good entry point for this library of ast is maybe
    reusing/recycling what Eric Niebler's Proto is achieving.<br>
    <br>
    Anyway, I am up for discussign this further.<br>
    <br>
    <br>
    <div>On 07/11/2014 12:15, snk_kid wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">Hi, it seems to me to that constexpr functions
        could be an excellent base to add support for a real solution to
        meta-programming one which allows C++ programmers to not just
        execute code at compile-time but also transform &amp; generate
        code all in the same language as code written for run-time
        execution.In terms of what is needed to add such support to
        language I think you only need to add about 3 new language
        features:
        <ul><li>Code quotation operator - tells the compiler to convert a
            C++ expression into an AST instead of being executed at
            compile-time.<br>
          </li><li>Splicing operator - to decompose/compose ASTs.</li><li>H=
ygienic Identifier generator - generate &amp; use
            variables names inside of code gen.</li></ul>
        <p>Additionally support for case/match pattern matching may
          simplify the manipulation of ASTs.<br>
        </p>
        <p> I believe the hardest and biggest part of adding this is not
          the language additions part but actually standardizing a
          library for the abstract-syntax tree plus some more libraries
          features.<br>
        </p>
        <p>Nemerle maybe a good place to take inspiration from as it has
          an excellent type-safe AST macro system designed to work with
          a hybrid OO-functional language, used for user-defined
          attributes, syntax extensions, etc check here if interested:</p>
        <p><a href=3D"https://github.com/rsdn/nemerle/wiki/Macros-tutorial"=
 target=3D"_blank">https://github.com/rsdn/<wbr>nemerle/wiki/Macros-tutoria=
l</a><br>
        </p>
      </div>
      <br>
    </blockquote>
    <br>
  </div>

</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2104_1931540919.1416135082324--

.


Author: snk_kid <korcan.hussein@googlemail.com>
Date: Thu, 13 Nov 2014 06:02:09 -0800 (PST)
Raw View
------=_Part_3107_1014768941.1415887329856
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=20

Not to say that Proto is bad but I do think it would be overly complicated=
=20
than it needs to be for an AST library (one that compiler vendors would=20
have to implement). To me Proto solves a different (but kind of related)=20
problem.

For the AST/compiler internals library I don=E2=80=99t know you need to use=
 any=20
template meta-programming and/or expression templates just that all the=20
classes/functions should be constexpr so that they can be used in constexpr=
=20
functions.

I think maybe a simplified subset of Clang=E2=80=99s AST APIs could be used=
 for=20
standardization.

Standardizing such a library may have other benefits; maybe it could double=
=20
up as an API for runtime reflection and tooling.

Imagine 1 library for both compile-time and run-time introspection and=20
reflection.


On Monday, November 10, 2014 2:23:45 AM UTC, Joel Falcou wrote:
>
>  I am very interested by this ideas. As an avid expression=20
> tempalte/meta-programming (ab)user, such a work could make those techniqu=
es=20
> first class citizen of the language.
> One good entry point for this library of ast is maybe reusing/recycling=
=20
> what Eric Niebler's Proto is achieving.
>
> Anyway, I am up for discussign this further.
>
>
> On 07/11/2014 12:15, snk_kid wrote:
> =20
> Hi, it seems to me to that constexpr functions could be an excellent base=
=20
> to add support for a real solution to meta-programming one which allows C=
++=20
> programmers to not just execute code at compile-time but also transform &=
=20
> generate code all in the same language as code written for run-time=20
> execution.In terms of what is needed to add such support to language I=20
> think you only need to add about 3 new language features:=20
>   =20
>    - Code quotation operator - tells the compiler to convert a C++=20
>    expression into an AST instead of being executed at compile-time.
>    - Splicing operator - to decompose/compose ASTs.
>    - Hygienic Identifier generator - generate & use variables names=20
>    inside of code gen.
>
> Additionally support for case/match pattern matching may simplify the=20
> manipulation of ASTs.
> =20
> I believe the hardest and biggest part of adding this is not the language=
=20
> additions part but actually standardizing a library for the abstract-synt=
ax=20
> tree plus some more libraries features.
> =20
> Nemerle maybe a good place to take inspiration from as it has an excellen=
t=20
> type-safe AST macro system designed to work with a hybrid OO-functional=
=20
> language, used for user-defined attributes, syntax extensions, etc check=
=20
> here if interested:
>
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
> =20
> =20
>=20

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_3107_1014768941.1415887329856
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]-->

<p class=3D"MsoNormal">Not to say that Proto is bad but I do think it would=
 be
overly complicated than it needs to be for an AST library (one that compile=
r
vendors would have to implement). To me Proto solves a different (but kind =
of
related) problem.</p>

<p class=3D"MsoNormal">For the AST/compiler internals library I don=E2=80=
=99t know you need
to use any template meta-programming and/or expression templates just that =
all
the classes/functions should be constexpr so that they can be used in const=
expr
functions.</p>

<p class=3D"MsoNormal">I think maybe a simplified subset of Clang=E2=80=99s=
 AST APIs could
be used for standardization.</p>

<p class=3D"MsoNormal">Standardizing such a library may have other benefits=
; maybe
it could double up as an API for runtime reflection and tooling.</p>

<p class=3D"MsoNormal">Imagine 1 library for both compile-time and run-time
introspection and reflection.</p>

<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:TrackMoves/>
  <w:TrackFormatting/>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:DoNotPromoteQF/>
  <w:LidThemeOther>EN-GB</w:LidThemeOther>
  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:SplitPgBreakAndParaMark/>
   <w:EnableOpenTypeKerning/>
   <w:DontFlipMirrorIndents/>
   <w:OverrideTableStyleHps/>
  </w:Compatibility>
  <m:mathPr>
   <m:mathFont m:val=3D"Cambria Math"/>
   <m:brkBin m:val=3D"before"/>
   <m:brkBinSub m:val=3D"&#45;-"/>
   <m:smallFrac m:val=3D"off"/>
   <m:dispDef/>
   <m:lMargin m:val=3D"0"/>
   <m:rMargin m:val=3D"0"/>
   <m:defJc m:val=3D"centerGroup"/>
   <m:wrapIndent m:val=3D"1440"/>
   <m:intLim m:val=3D"subSup"/>
   <m:naryLim m:val=3D"undOvr"/>
  </m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState=3D"false" DefUnhideWhenUsed=3D"true"
  DefSemiHidden=3D"true" DefQFormat=3D"false" DefPriority=3D"99"
  LatentStyleCount=3D"267">
  <w:LsdException Locked=3D"false" Priority=3D"0" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Normal"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"heading 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 7"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 8"/>
  <w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 9"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 7"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 8"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 9"/>
  <w:LsdException Locked=3D"false" Priority=3D"35" QFormat=3D"true" Name=3D=
"caption"/>
  <w:LsdException Locked=3D"false" Priority=3D"10" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Title"/>
  <w:LsdException Locked=3D"false" Priority=3D"1" Name=3D"Default Paragraph=
 Font"/>
  <w:LsdException Locked=3D"false" Priority=3D"11" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtitle"/>
  <w:LsdException Locked=3D"false" Priority=3D"22" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Strong"/>
  <w:LsdException Locked=3D"false" Priority=3D"20" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Emphasis"/>
  <w:LsdException Locked=3D"false" Priority=3D"59" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Table Grid"/>
  <w:LsdException Locked=3D"false" UnhideWhenUsed=3D"false" Name=3D"Placeho=
lder Text"/>
  <w:LsdException Locked=3D"false" Priority=3D"1" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"No Spacing"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 1"/>
  <w:LsdException Locked=3D"false" UnhideWhenUsed=3D"false" Name=3D"Revisio=
n"/>
  <w:LsdException Locked=3D"false" Priority=3D"34" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"List Paragraph"/>
  <w:LsdException Locked=3D"false" Priority=3D"29" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Quote"/>
  <w:LsdException Locked=3D"false" Priority=3D"30" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Quote"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 1"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 2"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 3"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 4"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 5"/>
  <w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light List Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 6"/>
  <w:LsdException Locked=3D"false" Priority=3D"19" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtle Emphasis"/>
  <w:LsdException Locked=3D"false" Priority=3D"21" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Emphasis"/>
  <w:LsdException Locked=3D"false" Priority=3D"31" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtle Reference"/>
  <w:LsdException Locked=3D"false" Priority=3D"32" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Reference"/>
  <w:LsdException Locked=3D"false" Priority=3D"33" SemiHidden=3D"false"
   UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Book Title"/>
  <w:LsdException Locked=3D"false" Priority=3D"37" Name=3D"Bibliography"/>
  <w:LsdException Locked=3D"false" Priority=3D"39" QFormat=3D"true" Name=3D=
"TOC Heading"/>
 </w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:"Table Normal";
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-priority:99;
 mso-style-parent:"";
 mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
 mso-para-margin-top:0cm;
 mso-para-margin-right:0cm;
 mso-para-margin-bottom:10.0pt;
 mso-para-margin-left:0cm;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-fareast-language:EN-US;}
</style>
<![endif]--><br><br>On Monday, November 10, 2014 2:23:45 AM UTC, Joel Falco=
u wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF">
    I am very interested by this ideas. As an avid expression
    tempalte/meta-programming (ab)user, such a work could make those
    techniques first class citizen of the language.<br>
    One good entry point for this library of ast is maybe
    reusing/recycling what Eric Niebler's Proto is achieving.<br>
    <br>
    Anyway, I am up for discussign this further.<br>
    <br>
    <br>
    <div>On 07/11/2014 12:15, snk_kid wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">Hi, it seems to me to that constexpr functions
        could be an excellent base to add support for a real solution to
        meta-programming one which allows C++ programmers to not just
        execute code at compile-time but also transform &amp; generate
        code all in the same language as code written for run-time
        execution.In terms of what is needed to add such support to
        language I think you only need to add about 3 new language
        features:
        <ul><li>Code quotation operator - tells the compiler to convert a
            C++ expression into an AST instead of being executed at
            compile-time.<br>
          </li><li>Splicing operator - to decompose/compose ASTs.</li><li>H=
ygienic Identifier generator - generate &amp; use
            variables names inside of code gen.</li></ul>
        <p>Additionally support for case/match pattern matching may
          simplify the manipulation of ASTs.<br>
        </p>
        <p> I believe the hardest and biggest part of adding this is not
          the language additions part but actually standardizing a
          library for the abstract-syntax tree plus some more libraries
          features.<br>
        </p>
        <p>Nemerle maybe a good place to take inspiration from as it has
          an excellent type-safe AST macro system designed to work with
          a hybrid OO-functional language, used for user-defined
          attributes, syntax extensions, etc check here if interested:</p>
        <p><a href=3D"https://github.com/rsdn/nemerle/wiki/Macros-tutorial"=
 target=3D"_blank">https://github.com/rsdn/<wbr>nemerle/wiki/Macros-tutoria=
l</a><br>
        </p>
      </div>
      <br>
    </blockquote>
    <br>
  </div>

</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_3107_1014768941.1415887329856--

.


Author: Joel FALCOU <joel.falcou@gmail.com>
Date: Mon, 17 Nov 2014 21:14:18 +0100
Raw View
This is a multi-part message in MIME format.
--------------010600030109060805070900
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable


On 13/11/2014 11:33, snk_kid wrote:
>
> Not to say that Proto is bad but I do think it would be overly=20
> complicated than it needs to be for an AST library (one that compiler=20
> vendors would have to implement). To me Proto solves a different (but=20
> kind of related) problem.
>
I was more keen to look at the kind of problem library developper fixes=20
using proto. Proto itself is big and can be robabyl recosntructed from=20
the groudn up if you idea takes shape.

> For the AST/compiler internals library I don=E2=80=99t know you need to u=
se=20
> any template meta-programming and/or expression templates just that=20
> all the classes/functions should be constexpr so that they can be used=20
> in constexpr functions.

For me, this ASt feature should provide basic way to grab the AST of an=20
expression or statement and give ou a standardized AST object
we can manipulate. Somethign Proto can't do without lookign strange is=20
capturing statements for ex.

My rough idea was to be able to say that

constexpr ??? x =3D a +b*3;

where ??? is to be defined, give you an x of some type representing the=20
a+b*3 AST.
The constexpr side of x give you access to the AST structure while non=20
constexpr access to x allow you to grab the value
trapped inside the AST.

AS for statement capture as AST, maybe a rule stating that lambda are=20
AST transparent may help

constexpr ??? some_loop =3D  [=3D]() { for(int i=3D0;i<n;i+=3D2) std::cout =
<< i=20
<< "\n"; }

Capture the ast of the for loop inside.

The question is what should ??? be ?
It can probably be a new keyword (liek lazy or something) but it feel=20
strange and tacked on. My other idea is that it coudl just be auto by=20
making the generalization that
what constexpr auto cpatures when it is feeded non-constexpr expression=20
is the AST of the expression, cause this is the ony constexpr "value"
we can extract. This is a breakign change as currently doing so raise an=20
error.

Once  have a synta for AST capture and a standardized AST type, other=20
AST related tools can be built as library element working on this type.

This is some raw thoughts, and probably need refinement

> I think maybe a simplified subset of Clang=E2=80=99s AST APIs could be us=
ed=20
> for standardization.
>
Something like that


--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--------------010600030109060805070900
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <br>
    <div class=3D"moz-cite-prefix">On 13/11/2014 11:33, snk_kid wrote:<br>
    </div>
    <blockquote
      cite=3D"mid:636b04ac-0647-4f09-aa7f-8a8608e5aae4@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr"><!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]-->
        <p class=3D"MsoNormal">Not to say that Proto is bad but I do think
          it would be
          overly complicated than it needs to be for an AST library (one
          that compiler
          vendors would have to implement). To me Proto solves a
          different (but kind of
          related) problem.</p>
      </div>
    </blockquote>
    I was more keen to look at the kind of problem library developper
    fixes using proto. Proto itself is big and can be robabyl
    recosntructed from the groudn up if you idea takes shape.<br>
    <br>
    <blockquote
      cite=3D"mid:636b04ac-0647-4f09-aa7f-8a8608e5aae4@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">For the AST/compiler internals library I don=E2=80=
=99t know
        you need
        to use any template meta-programming and/or expression templates
        just that all
        the classes/functions should be constexpr so that they can be
        used in constexpr
        functions.
      </div>
    </blockquote>
    <br>
    For me, this ASt feature should provide basic way to grab the AST of
    an expression or statement and give ou a standardized AST object<br>
    we can manipulate. Somethign Proto can't do without lookign strange
    is capturing statements for ex.<br>
    <br>
    My rough idea was to be able to say that<br>
    <br>
    constexpr ??? x =3D a +b*3;<br>
    <br>
    where ??? is to be defined, give you an x of some type representing
    the a+b*3 AST.<br>
    The constexpr side of x give you access to the AST structure while
    non constexpr access to x allow you to grab the value<br>
    trapped inside the AST.<br>
    <br>
    AS for statement capture as AST, maybe a rule stating that lambda
    are AST transparent may help<br>
    <br>
    constexpr ??? some_loop =3D=C2=A0 [=3D]() { for(int i=3D0;i&lt;n;i+=3D2=
)
    std::cout &lt;&lt; i &lt;&lt; "\n"; }<br>
    <br>
    Capture the ast of the for loop inside.<br>
    <br>
    The question is what should ??? be ?<br>
    It can probably be a new keyword (liek lazy or something) but it
    feel strange and tacked on. My other idea is that it coudl just be
    auto by making the generalization that<br>
    what constexpr auto cpatures when it is feeded non-constexpr
    expression is the AST of the expression, cause this is the ony
    constexpr "value"<br>
    we can extract. This is a breakign change as currently doing so
    raise an error.<br>
    <br>
    Once=C2=A0 have a synta for AST capture and a standardized AST type,
    other AST related tools can be built as library element working on
    this type.<br>
    <br>
    This is some raw thoughts, and probably need refinement<br>
    <br>
    <blockquote
      cite=3D"mid:636b04ac-0647-4f09-aa7f-8a8608e5aae4@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <p class=3D"MsoNormal">I think maybe a simplified subset of
          Clang=E2=80=99s AST APIs could
          be used for standardization.</p>
      </div>
    </blockquote>
    Something like that<br>
    <br>
    <br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--------------010600030109060805070900--

.


Author: snk_kid <korcan.hussein@googlemail.com>
Date: Mon, 17 Nov 2014 16:10:53 -0800 (PST)
Raw View
------=_Part_1758_1801220512.1416269453152
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


>
> =20
> On 13/11/2014 11:33, snk_kid wrote:
> =20
>  Not to say that Proto is bad but I do think it would be overly=20
> complicated than it needs to be for an AST library (one that compiler=20
> vendors would have to implement). To me Proto solves a different (but kin=
d=20
> of related) problem.
> =20
> I was more keen to look at the kind of problem library developper fixes=
=20
> using proto. Proto itself is big and can be robabyl recosntructed from th=
e=20
> groudn up if you idea takes shape.
>
>  For the AST/compiler internals library I don=E2=80=99t know you need to =
use any=20
> template meta-programming and/or expression templates just that all the=
=20
> classes/functions should be constexpr so that they can be used in constex=
pr=20
> functions.=20
>
>
> For me, this ASt feature should provide basic way to grab the AST of an=
=20
> expression or statement and give ou a standardized AST object
> we can manipulate. Somethign Proto can't do without lookign strange is=20
> capturing statements for ex.
>

I think we are basically saying the same thing here, getting a real=20
solution into C++ so that you wouldn't need libraries such as Proto (which=
=20
are always going to be servery limited and look intimidating compared to=20
real meta-programming support).

So yeah that's what I'm mean, add a few language features to be able to do=
=20
stuff like quote C++ code (which tells the compiler to create an AST from a=
=20
C++ expression) for which you can pass/return from constexpr functions (an=
=20
"AST macro") for manipulating the AST and generating new/different code.=20

My rough idea was to be able to say that
>
> constexpr ??? x =3D a +b*3;
>
> where ??? is to be defined, give you an x of some type representing the=
=20
> a+b*3 AST.
> The constexpr side of x give you access to the AST structure while non=20
> constexpr access to x allow you to grab the value
> trapped inside the AST.
>

Yeah that's the idea (although I'm abit unsure what you mean about getting=
=20
a value out part), one thing missing is quoting the C++ expression. You=20
want to be able to seperate out the parts of expressions that get evaluated=
=20
at compile-time and the parts that get converted into an AST (unevaluated).

In Lisp the code quotation operator is the back-tick symbol `, in nermele=
=20
it's a pair of <[ ... ]>, Template Haskell it's [| ... |] so your example=
=20
would look something like this:

constexpr Expr<int> x =3D [| a +b*3 |];

That's a basic example, an AST macro (constexpr function) would typically=
=20
have a mix of quoted & unquoted C++ code.

If you're concerned about having to quote code because for example you're=
=20
trying to implement an embedded DSL but want better syntactic sugar that's=
=20
where syntax extensions on top of AST macros would come in although that=20
might be going to far for the first iteration for some people. I don't know=
=20
what other people in the community think about this, there will probably be=
=20
people who will be strongly against the idea of syntax extension support.


> AS for statement capture as AST, maybe a rule stating that lambda are AST=
=20
> transparent may help
>
> constexpr ??? some_loop =3D  [=3D]() { for(int i=3D0;i<n;i+=3D2) std::cou=
t << i <<=20
> "\n"; }
>
> Capture the ast of the for loop inside.
>

I'm not fond of the idea of re-purposing lambda expressions for quoting=20
code, there may be times when you want to quote lambda expressions.=20
(almost) any piece of C++ should be quotable and get an AST representation=
=20
of.=20

I think the code quotation operator should be a new unique syntax as it is=
=20
in other languages that have AST macro systems, I mentioned a few examples=
=20
earlier.


> The question is what should ??? be ?
> It can probably be a new keyword (liek lazy or something) but it feel=20
> strange and tacked on. My other idea is that it coudl just be auto by=20
> making the generalization that
> what constexpr auto cpatures when it is feeded non-constexpr expression i=
s=20
> the AST of the expression, cause this is the ony constexpr "value"
> we can extract. This is a breakign change as currently doing so raise an=
=20
> error.
>

I don't think there needs to be any special syntax or context sensitive=20
rules added to the declaration of (constexpr) variables (lhs part) so long=
=20
as there is new operator for quoting C++ expressions. It will be needed=20
anyway because you want to be able to pass them into constexpr functions, a=
=20
hypothetical example:

template < typename T >
constexpr Expr<T> foo(const Expr<T>& expr) { ... } // something roughly=20
like this.

foo(*[|* a +b*3 *|]*); // the *[| c++-expr |]* syntax is just rough idea.
=20

>
> Once  have a synta for AST capture and a standardized AST type, other AST=
=20
> related tools can be built as library element working on this type.
>

Definitely, with support for syntax extensions on top of this you could=20
implement say a lazy keyword, the syntax for stackless resumable functions=
=20
all as library.

It's important to note that these ideas aren't new, there are quite a few=
=20
programming languages with (type-safe) AST macro systems to take=20
inspiration from. So I don't think there is much that has to be re-invented=
=20
here except for figuring out suitable new syntax and the best way to=20
implement an AST library that can be used in constexprs if it is possible.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_1758_1801220512.1416269453152
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div>
    <br>
    <div>On 13/11/2014 11:33, snk_kid wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">
        <p class=3D"MsoNormal">Not to say that Proto is bad but I do think
          it would be
          overly complicated than it needs to be for an AST library (one
          that compiler
          vendors would have to implement). To me Proto solves a
          different (but kind of
          related) problem.</p>
      </div>
    </blockquote>
    I was more keen to look at the kind of problem library developper
    fixes using proto. Proto itself is big and can be robabyl
    recosntructed from the groudn up if you idea takes shape.<br>
    <br>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">For the AST/compiler internals library I don=E2=80=
=99t know
        you need
        to use any template meta-programming and/or expression templates
        just that all
        the classes/functions should be constexpr so that they can be
        used in constexpr
        functions.
      </div>
    </blockquote>
    <br>
    For me, this ASt feature should provide basic way to grab the AST of
    an expression or statement and give ou a standardized AST object<br>
    we can manipulate. Somethign Proto can't do without lookign strange
    is capturing statements for ex.<br></div></blockquote><div><br>I think =
we are basically saying the same thing here, getting a real solution into C=
++ so that you wouldn't need libraries such as Proto (which are always goin=
g to be servery limited and look intimidating compared to real meta-program=
ming support).<br><br>So yeah that's what I'm mean, add a few language feat=
ures to be able to do stuff like quote C++ code (which tells the compiler t=
o create an AST from a C++ expression) for which you can pass/return from c=
onstexpr functions (an "AST macro") for manipulating the AST and generating=
 new/different code. <br><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#000000">
    My rough idea was to be able to say that<br>
    <br>
    constexpr ??? x =3D a +b*3;<br>
    <br>
    where ??? is to be defined, give you an x of some type representing
    the a+b*3 AST.<br>
    The constexpr side of x give you access to the AST structure while
    non constexpr access to x allow you to grab the value<br>
    trapped inside the AST.<br></div></blockquote><div><br>Yeah that's the =
idea (although I'm abit unsure what you mean about getting a value out part=
), one thing missing is quoting the C++ expression. You want to be able to =
seperate out the parts of expressions that get evaluated at compile-time an=
d the parts that get converted into an AST (unevaluated).<br><br>In Lisp th=
e code quotation operator is the back-tick symbol `, in nermele it's a pair=
 of &lt;[ ... ]&gt;, Template Haskell it's [| ... |] so your example would =
look something like this:<br><br>constexpr Expr&lt;int&gt; x =3D [| a +b*3 =
|];<br><br>That's a basic example, an AST macro (constexpr function) would =
typically have a mix of quoted &amp; unquoted C++ code.<br><br>If you're co=
ncerned about having to quote code because for example you're trying to imp=
lement an embedded DSL but want better syntactic sugar that's where syntax =
extensions on top of AST macros would come in although that might be going =
to far for the first iteration for some people. I don't know what other peo=
ple in the community think about this, there will probably be people who wi=
ll be strongly against the idea of syntax extension support.<br><br></div><=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF" text=
=3D"#000000">
    <br>
    AS for statement capture as AST, maybe a rule stating that lambda
    are AST transparent may help<br>
    <br>
    constexpr ??? some_loop =3D&nbsp; [=3D]() { for(int i=3D0;i&lt;n;i+=3D2=
)
    std::cout &lt;&lt; i &lt;&lt; "\n"; }<br>
    <br>
    Capture the ast of the for loop inside.<br></div></blockquote><div><br>=
I'm not fond of the idea of re-purposing lambda expressions for quoting cod=
e, there may be times when you want to quote lambda expressions. (almost) a=
ny piece of C++ should be quotable and get an AST representation of. <br><b=
r>I think the code quotation operator should be a new unique syntax as it i=
s in other languages that have AST macro systems, I mentioned a few example=
s earlier.<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div b=
gcolor=3D"#FFFFFF" text=3D"#000000">
    <br>
    The question is what should ??? be ?<br>
    It can probably be a new keyword (liek lazy or something) but it
    feel strange and tacked on. My other idea is that it coudl just be
    auto by making the generalization that<br>
    what constexpr auto cpatures when it is feeded non-constexpr
    expression is the AST of the expression, cause this is the ony
    constexpr "value"<br>
    we can extract. This is a breakign change as currently doing so
    raise an error.<br></div></blockquote><div><br>I don't think there need=
s to be any special syntax or context sensitive rules added to the declarat=
ion of (constexpr) variables (lhs part) so long as there is new operator fo=
r quoting C++ expressions. It will be needed anyway because you want to be =
able to pass them into constexpr functions, a hypothetical example:<br><br>=
<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); b=
order-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; wo=
rd-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettypr=
int"><span style=3D"color: #008;" class=3D"styled-by-prettify">template</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> T </span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">constexpr</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><code class=3D"prettyprint"><span style=3D"color: =
#606;" class=3D"styled-by-prettify">Expr</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span></code><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">foo</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">const</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #606;" class=3D"styled-by-prettify">Expr</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&gt;&amp;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> expr</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">...</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> // something roughly like this.<br=
><br>foo</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(<=
b>[|</b></span><span style=3D"color: #000;" class=3D"styled-by-prettify"> a=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">+</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">b</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">*</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">3</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify"><b>|]</b>);</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> // the <b>[| c++-expr |]</b> syntax is just rough =
idea.<br></span></div></code></div>&nbsp;</div><blockquote class=3D"gmail_q=
uote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pad=
ding-left: 1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <br>
    Once&nbsp; have a synta for AST capture and a standardized AST type,
    other AST related tools can be built as library element working on
    this type.<br></div></blockquote><div><br>Definitely, with support for =
syntax extensions on top of this you could implement say a lazy keyword, th=
e syntax for stackless resumable functions all as library.<br><br>It's impo=
rtant to note that these ideas aren't new, there are quite a few programmin=
g languages with (type-safe) AST macro systems to take inspiration from. So=
 I don't think there is much that has to be re-invented here except for fig=
uring out suitable new syntax and the best way to implement an AST library =
that can be used in constexprs if it is possible.<br><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1758_1801220512.1416269453152--

.


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Tue, 18 Nov 2014 03:37:33 -0800 (PST)
Raw View
------=_Part_184_437551221.1416310654018
Content-Type: text/plain; charset=UTF-8

Would such a change limit a compiler vendor to implementing the *exact*
production rules stated in the standard, rather than an equivalent, though
possibly more convenient, set of rules?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_184_437551221.1416310654018
Content-Type: text/html; charset=UTF-8

<div dir="ltr">Would such a change limit a compiler vendor to implementing the <EM>exact</EM> production rules stated in the standard, rather than an equivalent, though possibly more convenient, set of rules?</div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

------=_Part_184_437551221.1416310654018--

.


Author: joel falcou <joel.falcou@gmail.com>
Date: Tue, 18 Nov 2014 16:47:54 +0100
Raw View
This is a multi-part message in MIME format.
--------------040200060400050409050008
Content-Type: text/plain; charset=UTF-8; format=flowed


On 18/11/2014 01:10, snk_kid wrote:
>
>     I think we are basically saying the same thing here, getting a
>     real solution into C++ so that you wouldn't need libraries such as
>     Proto (which are always going to be servery limited and look
>     intimidating compared to real meta-programming support).
>

I like being in a violent agreement :)

> Yeah that's the idea (although I'm abit unsure what you mean about
> getting a value out part), one thing missing is quoting the C++
> expression. You want to be able to seperate out the parts of
> expressions that get evaluated at compile-time and the parts that get
> converted into an AST (unevaluated).
>
> In Lisp the code quotation operator is the back-tick symbol `, in
> nermele it's a pair of <[ ... ]>, Template Haskell it's [| ... |] so
> your example would look something like this:
>
> constexpr Expr<int> x = [| a +b*3 |];
>
> That's a basic example, an AST macro (constexpr function) would
> typically have a mix of quoted & unquoted C++ code.

Isn't ` enough ? [| |] is a mouthful to type. But that's probably
bikeshedding.

> If you're concerned about having to quote code because for example
> you're trying to implement an embedded DSL but want better syntactic
> sugar that's where syntax extensions on top of AST macros would come
> in although that might be going to far for the first iteration for
> some people. I don't know what other people in the community think
> about this, there will probably be people who will be strongly against
> the idea of syntax extension support.

Exactly. My short experience in metaOCAML shows that you can actually
just wrap quoted code into some arbitrary type and ship it.
The main stuff you learn from Proto is that you want 2 different stuff :
capturign AST using quotation and giving your captured AST some
semantic driven by the syntax you want to give to your DSL.

let's focus on the quote piece for now, rest is probably library work.

>
> I'm not fond of the idea of re-purposing lambda expressions for
> quoting code, there may be times when you want to quote lambda
> expressions. (almost) any piece of C++ should be quotable and get an
> AST representation of.
>
> I think the code quotation operator should be a new unique syntax as
> it is in other languages that have AST macro systems, I mentioned a
> few examples earlier.

OK

> I don't think there needs to be any special syntax or context
> sensitive rules added to the declaration of (constexpr) variables (lhs
> part) so long as there is new operator for quoting C++ expressions. It
> will be needed anyway because you want to be able to pass them into
> constexpr functions, a hypothetical example:
>
> |
> template<typenameT >
> constexpr|Expr<T>|foo(constExpr<T>&expr){...}// something roughly like
> this.
>
> foo(*[|*a +b*3*|]*);// the *[| c++-expr |]* syntax is just rough idea.
> |
>
>
>     Once  have a synta for AST capture and a standardized AST type,
>     other AST related tools can be built as library element working on
>     this type.
>
>
> Definitely, with support for syntax extensions on top of this you
> could implement say a lazy keyword, the syntax for stackless resumable
> functions all as library.
OK

>
> It's important to note that these ideas aren't new, there are quite a
> few programming languages with (type-safe) AST macro systems to take
> inspiration from. So I don't think there is much that has to be
> re-invented here except for figuring out suitable new syntax and the
> best way to implement an AST library that can be used in constexprs if
> it is possible.
Indeed.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--------------040200060400050409050008
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <br>
    <div class=3D"moz-cite-prefix">On 18/11/2014 01:10, snk_kid wrote:<br>
    </div>
    <blockquote
      cite=3D"mid:7a41f709-af19-4812-a771-019bb75cc25b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
          0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I think
          we are basically saying the same thing here, getting a real
          solution into C++ so that you wouldn't need libraries such as
          Proto (which are always going to be servery limited and look
          intimidating compared to real meta-programming support).<br>
        </blockquote>
      </div>
    </blockquote>
    <br>
    I like being in a violent agreement :)<br>
    <br>
    <blockquote
      cite=3D"mid:7a41f709-af19-4812-a771-019bb75cc25b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>Yeah that's the idea (although I'm abit unsure what you
          mean about getting a value out part), one thing missing is
          quoting the C++ expression. You want to be able to seperate
          out the parts of expressions that get evaluated at
          compile-time and the parts that get converted into an AST
          (unevaluated).<br>
          <br>
          In Lisp the code quotation operator is the back-tick symbol `,
          in nermele it's a pair of &lt;[ ... ]&gt;, Template Haskell
          it's [| ... |] so your example would look something like this:<br=
>
          <br>
          constexpr Expr&lt;int&gt; x =3D [| a +b*3 |];<br>
          <br>
          That's a basic example, an AST macro (constexpr function)
          would typically have a mix of quoted &amp; unquoted C++ code.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Isn't ` enough ? [| |] is a mouthful to type. But that's probably
    bikeshedding.<br>
    <br>
    <blockquote
      cite=3D"mid:7a41f709-af19-4812-a771-019bb75cc25b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>If you're concerned about having to quote code because for
          example you're trying to implement an embedded DSL but want
          better syntactic sugar that's where syntax extensions on top
          of AST macros would come in although that might be going to
          far for the first iteration for some people. I don't know what
          other people in the community think about this, there will
          probably be people who will be strongly against the idea of
          syntax extension support.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Exactly. My short experience in metaOCAML shows that you can
    actually just wrap quoted code into some arbitrary type and ship it.<br=
>
    The main stuff you learn from Proto is that you want 2 different
    stuff : capturign AST using quotation and giving your captured AST
    some<br>
    semantic driven by the syntax you want to give to your DSL.<br>
    <br>
    let's focus on the quote piece for now, rest is probably library
    work.<br>
    <br>
    <blockquote
      cite=3D"mid:7a41f709-af19-4812-a771-019bb75cc25b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr"><br>
        <div>I'm not fond of the idea of re-purposing lambda expressions
          for quoting code, there may be times when you want to quote
          lambda expressions. (almost) any piece of C++ should be
          quotable and get an AST representation of. <br>
          <br>
          I think the code quotation operator should be a new unique
          syntax as it is in other languages that have AST macro
          systems, I mentioned a few examples earlier.<br>
        </div>
      </div>
    </blockquote>
    <br>
    OK<br>
    <br>
    <blockquote
      cite=3D"mid:7a41f709-af19-4812-a771-019bb75cc25b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">I don't think there needs to be any special syntax
        or context sensitive rules added to the declaration of
        (constexpr) variables (lhs part) so long as there is new
        operator for quoting C++ expressions. It will be needed anyway
        because you want to be able to pass them into constexpr
        functions, a hypothetical example:<br>
        <div><br>
          <div class=3D"prettyprint" style=3D"background-color: rgb(250,
            250, 250); border-color: rgb(187, 187, 187); border-style:
            solid; border-width: 1px; word-wrap: break-word;"><code
              class=3D"prettyprint">
              <div class=3D"subprettyprint"><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">template</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&lt;<=
/span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">typen=
ame</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> T </=
span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&gt;<=
/span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                </span><span style=3D"color: #008;"
                  class=3D"styled-by-prettify">constexpr</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><code
                  class=3D"prettyprint"><span style=3D"color: #606;"
                    class=3D"styled-by-prettify">Expr</span><span
                    style=3D"color: #660;" class=3D"styled-by-prettify">&lt=
;</span><span
                    style=3D"color: #000;" class=3D"styled-by-prettify">T</=
span><span
                    style=3D"color: #660;" class=3D"styled-by-prettify">&gt=
;</span><span
                    style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span></code><span
                  style=3D"color: #000;" class=3D"styled-by-prettify">foo</=
span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
                  style=3D"color: #008;" class=3D"styled-by-prettify">const=
</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #606;" class=3D"styled-by-prettify">Expr<=
/span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&lt;<=
/span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify">T</sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&=
amp;</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> expr=
</span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">)</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">...</=
span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">}</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> //
                  something roughly like this.<br>
                  <br>
                  foo</span><span style=3D"color: #660;"
                  class=3D"styled-by-prettify">(<b>[|</b></span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> a </=
span><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">+</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify">b</sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify">*</sp=
an><span
                  style=3D"color: #066;" class=3D"styled-by-prettify">3</sp=
an><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
                  style=3D"color: #660;" class=3D"styled-by-prettify"><b>|]=
</b>);</span><span
                  style=3D"color: #000;" class=3D"styled-by-prettify"> //
                  the <b>[| c++-expr |]</b> syntax is just rough idea.<br>
                </span></div>
            </code></div>
          =C2=A0</div>
        <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
          0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
          <div bgcolor=3D"#FFFFFF" text=3D"#000000"> <br>
            Once=C2=A0 have a synta for AST capture and a standardized AST
            type, other AST related tools can be built as library
            element working on this type.<br>
          </div>
        </blockquote>
        <div><br>
          Definitely, with support for syntax extensions on top of this
          you could implement say a lazy keyword, the syntax for
          stackless resumable functions all as library.<br>
        </div>
      </div>
    </blockquote>
    OK<br>
    <br>
    <blockquote
      cite=3D"mid:7a41f709-af19-4812-a771-019bb75cc25b@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div><br>
          It's important to note that these ideas aren't new, there are
          quite a few programming languages with (type-safe) AST macro
          systems to take inspiration from. So I don't think there is
          much that has to be re-invented here except for figuring out
          suitable new syntax and the best way to implement an AST
          library that can be used in constexprs if it is possible.<br>
        </div>
      </div>
    </blockquote>
    Indeed.<br>
    <br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--------------040200060400050409050008--

.


Author: Nicola Gigante <nicola.gigante@gmail.com>
Date: Tue, 18 Nov 2014 19:45:09 +0100
Raw View
--Apple-Mail=_34426258-A4A7-40E9-9D52-7311571C9342
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


Il giorno 07/nov/2014, alle ore 12:15, snk_kid <korcan.hussein@googlemail.c=
om> ha scritto:

> Hi, it seems to me to that constexpr functions could be an excellent base=
 to add support for a real solution to meta-programming one which allows C+=
+ programmers to not just execute code at compile-time but also transform &=
 generate code all in the same language as code written for run-time execut=
ion.
>=20
> The advantages over template/pre-processor meta-programming would be:
> The object and meta-language are the same (well one being a slightly larg=
er super-set) instead of a completely different arcane language that only t=
he 1% understand and willing to use.
> More easily readable, maintainable, debug-able to the 99% of C++ programm=
ers.
> Should be more easier to add debugging support for stepping macro expansi=
ons.
> Keeps C++ templates more simple by not requiring various extensions or ha=
cks for the sake of meta-programming support.
> No limitations for code generation compared to using templates. Imagine g=
oing as far as querying a DB to generate code at compile-time, that's the k=
ind of expressive power that languages like Lisp/Nermele/Template Haskell h=
ave.
> Is Type safe.
> Constexpr macros which would respect and work with modules/namespaces and=
 may have better build times than the equivalent template based solution.
> Maybe used as a base for user-defined C++ attributes. Nermele does this f=
or user-defined .NET attributes.
> Maybe used as a base for syntax extensions. This may actually make the la=
nguage simpler because then people could add features they would like very =
simply as library, could be used as way to start proposals for adding to th=
e standard too (either as language features or libraries).
> Better, cleaner solution to compile-time reflection/introspection.
> In terms of what is needed to add such support to language I think you on=
ly need to add about 3 new language features:
>=20
> Code quotation operator - tells the compiler to convert a C++ expression =
into an AST instead of being executed at compile-time.
> Splicing operator - to decompose/compose ASTs.
> Hygienic Identifier generator - generate & use variables names inside of =
code gen.
> Additionally support for case/match pattern matching may simplify the man=
ipulation of ASTs.
>=20
> I believe the hardest and biggest part of adding this is not the language=
 additions part but actually standardizing a library for the abstract-synta=
x tree plus some more libraries features.
>=20
>=20
> Nemerle maybe a good place to take inspiration from as it has an excellen=
t type-safe AST macro system designed to work with a hybrid OO-functional l=
anguage, used for user-defined attributes, syntax extensions, etc check her=
e if interested:
>=20
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
>=20
>=20

Hi everybody.

Somebody already mentioned the Template Haskell syntax, and I want to
say that it would be wonderful to have a similar facility in C++.

What I want to point out is that Template Haskell is really more than just
quoting code to process it at compile time. Of course that=E2=80=99s one of=
 the main
applications, but the point is that you can quote _anything_, not only code=
,
and what you do with the quoted string is more or less all in your hands.

The _result_ of this process is always a piece of AST, that then is compile=
d
with the rest of the code, not the _input_. The input is a piece of AST onl=
y
if you quote code and give it to the Template Haskell parser.

The generality of this mechanism opens the door to a lot of other use cases=
,
for example type-safe template engines for web frameworks, see Yesod.

http://www.yesodweb.com/book/shakespearean-templates

That link above is quite on of the main reasons why web development in Hask=
ell
is both cool and really safe.

In respect to haskell, however, the problem for C++ would be what one would=
 be
able to achieve, given the result of the quoting. Template Haskell code hav=
e
access to the full language without pretty much any limitation, while here =
we=E2=80=99re
talking about constexpr functions, which even in C++14 are pretty limited, =
given
the absence of dynamic memory allocation.

Anyway I think it=E2=80=99s worth investigating this idea.

Bye,
Nicola

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_34426258-A4A7-40E9-9D52-7311571C9342
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>Il giorn=
o 07/nov/2014, alle ore 12:15, snk_kid &lt;<a href=3D"mailto:korcan.hussein=
@googlemail.com">korcan.hussein@googlemail.com</a>&gt; ha scritto:</div><br=
 class=3D"Apple-interchange-newline"><blockquote type=3D"cite"><div dir=3D"=
ltr">Hi, it seems to me to that constexpr functions could be an excellent b=
ase to add support for a real solution to meta-programming one which allows=
 C++ programmers to not just execute code at compile-time but also transfor=
m &amp; generate code all in the same language as code written for run-time=
 execution.<br><br>The advantages over template/pre-processor meta-programm=
ing would be:<br><ul><li>The object and meta-language are the same (well on=
e being a slightly larger super-set) instead of a completely different arca=
ne language that only the 1% understand and <b>willing </b>to use.</li><li>=
More easily readable, maintainable, debug-able to the 99% of C++ programmer=
s.</li><li>Should be more easier to add debugging support for stepping macr=
o expansions.<br></li><li>Keeps C++ templates more simple by not requiring =
various extensions or hacks for the sake of meta-programming support.<br></=
li><li>No limitations for code generation compared to using templates. Imag=
ine going as far as querying a DB to generate code at compile-time, that's =
the kind of expressive power that languages like Lisp/Nermele/Template Hask=
ell have.</li><li>Is Type safe.<br></li><li>Constexpr macros which would re=
spect and work with modules/namespaces and may have better build times than=
 the equivalent template based solution.<br></li><li>Maybe used as a base f=
or user-defined C++ attributes. Nermele does this for user-defined .NET att=
ributes.<br></li><li>Maybe used as a base for syntax extensions. This may a=
ctually make the language simpler because then people could add features th=
ey would like very simply as library, could be used as way to start proposa=
ls for adding to the standard too (either as language features or libraries=
).</li><li>Better, cleaner solution to compile-time reflection/introspectio=
n.</li></ul><p>In terms of what is needed to add such support to language I=
 think you only need to add about 3 new language features:</p><ul><li>Code =
quotation operator - tells the compiler to convert a C++ expression into an=
 AST instead of being executed at compile-time.<br></li><li>Splicing operat=
or - to decompose/compose ASTs.</li><li>Hygienic Identifier generator - gen=
erate &amp; use variables names inside of code gen.</li></ul><p>Additionall=
y support for case/match pattern matching may simplify the manipulation of =
ASTs.<br></p><p> I believe the hardest and biggest part of adding this is n=
ot the language additions part but actually standardizing a library for the=
 abstract-syntax tree plus some more libraries features.<br></p><div><br cl=
ass=3D"webkit-block-placeholder"></div><p>Nemerle maybe a good place to tak=
e inspiration from as it has an excellent type-safe AST macro system design=
ed to work with a hybrid OO-functional language, used for user-defined attr=
ibutes, syntax extensions, etc check here if interested:</p><p><a href=3D"h=
ttps://github.com/rsdn/nemerle/wiki/Macros-tutorial">https://github.com/rsd=
n/nemerle/wiki/Macros-tutorial</a><br></p></div><div><br class=3D"webkit-bl=
ock-placeholder"></div></blockquote><div><br></div><div>Hi everybody.</div>=
<div><br></div><div>Somebody already mentioned the Template Haskell syntax,=
 and I want to</div><div>say that it would be wonderful to have a similar f=
acility in C++.</div><div><br></div><div>What I want to point out is that T=
emplate Haskell is really more than just</div><div>quoting code to process =
it at compile time. Of course that=E2=80=99s one of the main</div><div>appl=
ications, but the point is that you can quote _anything_, not only code,</d=
iv><div>and what you do with the quoted string is more or less all in your =
hands.</div><div><br></div><div>The _result_ of this process is always a pi=
ece of AST, that then is compiled</div><div>with the rest of the code, not =
the _input_. The input is a piece of AST only</div><div>if you quote code a=
nd give it to the Template Haskell parser.</div><div><br></div><div>The gen=
erality of this mechanism opens the door to a lot of other use cases,</div>=
<div>for example type-safe template engines for web frameworks, see Yesod.<=
/div><div><br></div><div><a href=3D"http://www.yesodweb.com/book/shakespear=
ean-templates">http://www.yesodweb.com/book/shakespearean-templates</a></di=
v><div><br></div><div>That link above is quite on of the main reasons why w=
eb development in Haskell</div><div>is both cool and really safe.</div><div=
><br></div><div>In respect to haskell, however, the problem for C++ would b=
e what one would be</div><div>able to achieve, given the result of the quot=
ing. Template Haskell code have</div><div>access to the full language witho=
ut pretty much any limitation, while here we=E2=80=99re</div><div>talking a=
bout constexpr functions, which even in C++14 are pretty limited, given</di=
v><div>the absence of dynamic memory allocation.</div></div><br><div>Anyway=
 I think it=E2=80=99s worth investigating this idea.</div><div><br></div><d=
iv>Bye,</div><div>Nicola</div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_34426258-A4A7-40E9-9D52-7311571C9342--

.


Author: masse.nicolas@gmail.com
Date: Tue, 18 Nov 2014 14:09:53 -0800 (PST)
Raw View
------=_Part_2736_1513966468.1416348593415
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,
I don't know if this correpond to what you want, but did you had a look at =
N4147=20
- Inline variables, or encapsulated expressions=20
<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4147.pdf> ?

Le lundi 10 novembre 2014 03:23:45 UTC+1, Joel Falcou a =C3=A9crit :
>
>  I am very interested by this ideas. As an avid expression=20
> tempalte/meta-programming (ab)user, such a work could make those techniqu=
es=20
> first class citizen of the language.
> One good entry point for this library of ast is maybe reusing/recycling=
=20
> what Eric Niebler's Proto is achieving.
>
> Anyway, I am up for discussign this further.
>
>
> On 07/11/2014 12:15, snk_kid wrote:
> =20
> Hi, it seems to me to that constexpr functions could be an excellent base=
=20
> to add support for a real solution to meta-programming one which allows C=
++=20
> programmers to not just execute code at compile-time but also transform &=
=20
> generate code all in the same language as code written for run-time=20
> execution.In terms of what is needed to add such support to language I=20
> think you only need to add about 3 new language features:=20
>   =20
>    - Code quotation operator - tells the compiler to convert a C++=20
>    expression into an AST instead of being executed at compile-time.
>     - Splicing operator - to decompose/compose ASTs.=20
>    - Hygienic Identifier generator - generate & use variables names=20
>    inside of code gen.=20
>
> Additionally support for case/match pattern matching may simplify the=20
> manipulation of ASTs.
> =20
> I believe the hardest and biggest part of adding this is not the language=
=20
> additions part but actually standardizing a library for the abstract-synt=
ax=20
> tree plus some more libraries features.
> =20
> Nemerle maybe a good place to take inspiration from as it has an excellen=
t=20
> type-safe AST macro system designed to work with a hybrid OO-functional=
=20
> language, used for user-defined attributes, syntax extensions, etc check=
=20
> here if interested:
>
> https://github.com/rsdn/nemerle/wiki/Macros-tutorial
> =20
> =20
>=20

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_2736_1513966468.1416348593415
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,<br></div><div>I don't know if this correpond to w=
hat you want, but did you had a look at <a href=3D"http://www.open-std.org/=
JTC1/SC22/WG21/docs/papers/2014/n4147.pdf">N4147 - Inline variables, or enc=
apsulated expressions</a> ?</div><br>Le lundi 10 novembre 2014 03:23:45 UTC=
+1, Joel Falcou a =C3=A9crit&nbsp;:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    I am very interested by this ideas. As an avid expression
    tempalte/meta-programming (ab)user, such a work could make those
    techniques first class citizen of the language.<br>
    One good entry point for this library of ast is maybe
    reusing/recycling what Eric Niebler's Proto is achieving.<br>
    <br>
    Anyway, I am up for discussign this further.<br>
    <br>
    <br>
    <div>On 07/11/2014 12:15, snk_kid wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">Hi, it seems to me to that constexpr functions
        could be an excellent base to add support for a real solution to
        meta-programming one which allows C++ programmers to not just
        execute code at compile-time but also transform &amp; generate
        code all in the same language as code written for run-time
        execution.In terms of what is needed to add such support to
        language I think you only need to add about 3 new language
        features:
        <ul>
          <li>Code quotation operator - tells the compiler to convert a
            C++ expression into an AST instead of being executed at
            compile-time.<br>
          </li>
          <li>Splicing operator - to decompose/compose ASTs.</li>
          <li>Hygienic Identifier generator - generate &amp; use
            variables names inside of code gen.</li>
        </ul>
        <p>Additionally support for case/match pattern matching may
          simplify the manipulation of ASTs.<br>
        </p>
        <p> I believe the hardest and biggest part of adding this is not
          the language additions part but actually standardizing a
          library for the abstract-syntax tree plus some more libraries
          features.<br>
        </p>
        <p>Nemerle maybe a good place to take inspiration from as it has
          an excellent type-safe AST macro system designed to work with
          a hybrid OO-functional language, used for user-defined
          attributes, syntax extensions, etc check here if interested:</p>
        <p><a href=3D"https://github.com/rsdn/nemerle/wiki/Macros-tutorial"=
 target=3D"_blank" onmousedown=3D"this.href=3D'https://www.google.com/url?q=
\75https%3A%2F%2Fgithub.com%2Frsdn%2Fnemerle%2Fwiki%2FMacros-tutorial\46sa\=
75D\46sntz\0751\46usg\75AFQjCNG19gp5j5nDGMk31QWmrf6Wdgoo_g';return true;" o=
nclick=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.=
com%2Frsdn%2Fnemerle%2Fwiki%2FMacros-tutorial\46sa\75D\46sntz\0751\46usg\75=
AFQjCNG19gp5j5nDGMk31QWmrf6Wdgoo_g';return true;">https://github.com/rsdn/n=
emerle/wiki/Macros-tutorial</a><br>
        </p>
      </div>
      <br>
    </blockquote>
    <br>
  </div>

</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2736_1513966468.1416348593415--

.


Author: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
Date: Wed, 19 Nov 2014 14:13:31 -0800 (PST)
Raw View
------=_Part_4405_1641749071.1416435211765
Content-Type: multipart/alternative;
 boundary="----=_Part_4406_2006739641.1416435211765"

------=_Part_4406_2006739641.1416435211765
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Tuesday, November 18, 2014 10:45:15 AM UTC-8, Nicola Gigante wrote:
>
>
> Somebody already mentioned the Template Haskell syntax, and I want to
> say that it would be wonderful to have a similar facility in C++.
>
> What I want to point out is that Template Haskell is really more than jus=
t
> quoting code to process it at compile time. Of course that=E2=80=99s one =
of the=20
> main
> applications, but the point is that you can quote _anything_, not only=20
> code,
> and what you do with the quoted string is more or less all in your hands.
>
>
I want to say that I fully support adding such facilities to C++.  You make=
=20
a good point, that for full functionality we really need both a mechanism=
=20
for "quoting", to obtain objects representing ASTs, and a mechanism for=20
telling the compiler to evaluate/process/insert an AST in a given context.

One important consideration, which relates to Joel Falcou's comments=20
earlier about capturing both the AST and the "values" in the expression, is=
=20
how this facility interacts with templates.  If all of this AST stuff=20
happens entirely before template instantiation, then everything it does=20
will be still limited to being purely syntactic.  It would be much more=20
powerful to be able to see the actual template arguments (rather than just=
=20
the template parameters), such that the result may depend on the specific=
=20
template arguments with which the template is instantiated.

I'm sure some will complain that adding this power will make certain IDE=20
functionality less reliable or more difficult to implement, which was the=
=20
main objection for the (IMO extremely useful static if proposal), but=20
preprocessor macros and template metaprogramming already pose problems for=
=20
such tools.  A user can always just not use this functionality if it=20
interferes with a desired IDE function.

=20

> In respect to haskell, however, the problem for C++ would be what one=20
> would be
> able to achieve, given the result of the quoting. Template Haskell code=
=20
> have
> access to the full language without pretty much any limitation, while her=
e=20
> we=E2=80=99re
> talking about constexpr functions, which even in C++14 are pretty limited=
,=20
> given
> the absence of dynamic memory allocation.
>

I think it is clear that we must further reduce the restrictions on=20
constexpr functions to pretty much the same level as D.  Dynamic memory=20
allocation at compile time poses some challenges, but given the enormous=20
utility of it, the added language complexity of resolving them is well=20
worth it.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_4406_2006739641.1416435211765
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, November 18, 2014 10:45:15 AM UTC-8, Nicola Gi=
gante wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"word=
-wrap:break-word"><div><br><div>Somebody already mentioned the Template Has=
kell syntax, and I want to</div><div>say that it would be wonderful to have=
 a similar facility in C++.</div><div><br></div><div>What I want to point o=
ut is that Template Haskell is really more than just</div><div>quoting code=
 to process it at compile time. Of course that=E2=80=99s one of the main</d=
iv><div>applications, but the point is that you can quote _anything_, not o=
nly code,</div><div>and what you do with the quoted string is more or less =
all in your hands.</div><br></div></div></blockquote><div><br>I want to say=
 that I fully support adding such facilities to C++.&nbsp; You make a good =
point, that for full functionality we really need both a mechanism for "quo=
ting", to obtain objects representing ASTs, and a mechanism for telling the=
 compiler to evaluate/process/insert an AST in a given context.<br><br>One =
important consideration, which relates to Joel Falcou's comments earlier ab=
out capturing both the AST and the "values" in the expression, is how this =
facility interacts with templates.&nbsp; If all of this AST stuff happens e=
ntirely before template instantiation, then everything it does will be stil=
l limited to being purely syntactic.&nbsp; It would be much more powerful t=
o be able to see the actual template arguments (rather than just the templa=
te parameters), such that the result may depend on the specific template ar=
guments with which the template is instantiated.<br><br>I'm sure some will =
complain that adding this power will make certain IDE functionality less re=
liable or more difficult to implement, which was the main objection for the=
 (IMO extremely useful static if proposal), but preprocessor macros and tem=
plate metaprogramming already pose problems for such tools.&nbsp; A user ca=
n always just not use this functionality if it interferes with a desired ID=
E function.<br><br>&nbsp;<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div style=3D"word-wrap:break-word"><div><div>In respect to haskell, =
however, the problem for C++ would be what one would be</div><div>able to a=
chieve, given the result of the quoting. Template Haskell code have</div><d=
iv>access to the full language without pretty much any limitation, while he=
re we=E2=80=99re</div><div>talking about constexpr functions, which even in=
 C++14 are pretty limited, given</div><div>the absence of dynamic memory al=
location.</div></div></div></blockquote><div><br>I think it is clear that w=
e must further reduce the restrictions on constexpr functions to pretty muc=
h the same level as D.&nbsp; Dynamic memory allocation at compile time pose=
s some challenges, but given the enormous utility of it, the added language=
 complexity of resolving them is well worth it.<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_4406_2006739641.1416435211765--
------=_Part_4405_1641749071.1416435211765--

.


Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Wed, 19 Nov 2014 15:03:10 -0800 (PST)
Raw View
------=_Part_4607_68768130.1416438190041
Content-Type: multipart/alternative;
 boundary="----=_Part_4608_439758824.1416438190041"

------=_Part_4608_439758824.1416438190041
Content-Type: text/plain; charset=UTF-8

I very strongly disagree with this feature and think it's a very regressive
approach.

Tools first.

How would a refactoring tool look? Find Symbol References? Rename? Goto
Definition? How would you debug the expansion? How would an as-you-type
linter work? etc.

Even on systems without highly-intelligent IDEs, tools like ctags and the
like are quite common. They have a hard enough time with C macros, and
there's still so much work to do to make templates easier to debug (e.g.,
being able to step through template instantiations during compilation). A
C++ `eval` is a massive regression for the tools-accessibility of the
language.

Splatting strings together is not the best way to programmatically compose
code. There are Better Ways(tm). Such tools should work with the semantic
constructs of the language, not with the textual encoding of those
semantics represented by programmer-authored source code. These code
generation facilities should be explored in the context of tools rather
than text (and there has been at least one paper on one such way recently
via the reflection SG work).

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_4608_439758824.1416438190041
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I very strongly disagree with this feature and think =
it's a very regressive approach.<br></div><div><br></div><div>Tools first.<=
/div><div><br></div><div>How would a refactoring tool look? Find Symbol Ref=
erences? Rename? Goto Definition? How would you debug the expansion? How wo=
uld an as-you-type linter work? etc.</div><div><br></div><div>Even on syste=
ms without highly-intelligent IDEs, tools like ctags and the like are quite=
 common. They have a hard enough time with C macros, and there's still so m=
uch work to do to make templates easier to debug (e.g., being able to step =
through template instantiations during compilation). A C++ `eval` is a mass=
ive regression for the tools-accessibility of the language.</div><div><br><=
/div><div>Splatting strings together is not the best way to programmaticall=
y compose code. There are Better Ways(tm). Such tools should work with the =
semantic constructs of the language, not with the textual encoding of those=
 semantics represented by programmer-authored source code. These code gener=
ation facilities should be explored in the context of tools rather than tex=
t (and there has been at least one paper on one such way recently via the r=
eflection SG work).</div><div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_4608_439758824.1416438190041--
------=_Part_4607_68768130.1416438190041--

.


Author: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
Date: Wed, 19 Nov 2014 15:57:14 -0800
Raw View
--001a1135ed8e8e04b705083ef832
Content-Type: text/plain; charset=UTF-8

On Wed, Nov 19, 2014 at 3:03 PM, Sean Middleditch <
sean.middleditch@gmail.com> wrote:

> I very strongly disagree with this feature and think it's a very
> regressive approach.
>
> Tools first.
>
> How would a refactoring tool look? Find Symbol References? Rename? Goto
> Definition? How would you debug the expansion? How would an as-you-type
> linter work? etc.
>

All of these would require some consideration, but hardly seem like
intractable problems.  I imagine that the existing tool support for other
languages with similar AST functionality would provide a lot of
inspiration.  But let's just consider the existing language for a moment:
In the context of a template definition, some of these operations are
inherently not well-defined anyway, and the approach has to be heuristic.
Ignoring templates, C++ preprocessor macros also make some of these
operations tricky; in principle you can always find the references, but you
can't necessarily change them automatically.  Certainly allowing AST
manipulations would introduce additional cases to which some of these
operations might either be blind or have to rely on a heuristic approach,
but that hardly seems like a fundamental blocker.

Even on systems without highly-intelligent IDEs, tools like ctags and the
> like are quite common. They have a hard enough time with C macros, and
> there's still so much work to do to make templates easier to debug (e.g.,
> being able to step through template instantiations during compilation). A
> C++ `eval` is a massive regression for the tools-accessibility of the
> language.
>

It wouldn't be a regression because no existing code, in particular the
standard library, need be changed to make use of it.  Users who don't like
how the feature interacts with some tool can simply avoid using it.  This
is already the case with C++ preprocessor macros, for instance.

In what situation would adding these facilities actually result in a worse
experience for the programmer?  Let's consider the alternatives available
present:
1. Writing repetitive code: maybe easier for tools to handle, but likely a
maintenance nightmare for the programmer.
2. Using preprocessor macros: almost certainly more difficult to manage for
programmers and tools
3. Using an external code generation system: even more difficult for both
tools and programmers than using preprocessor macros.
4. Using template metaprogramming trickery to make definitions, struct
members, etc. conditionally present: much more cumbersome for the
programmer than proper AST facilities, or static if.  If full types aren't
known, i.e. in a template, tools have no way to handle this, and this would
be the same with AST manipulation/static if.  If full types are known, then
(sufficiently smart) tools can handle it perfectly well both with template
metaprogramming and with AST manipulation or static if.

Splatting strings together is not the best way to programmatically compose
> code. There are Better Ways(tm). Such tools should work with the semantic
> constructs of the language, not with the textual encoding of those
> semantics represented by programmer-authored source code. These code
> generation facilities should be explored in the context of tools rather
> than text (and there has been at least one paper on one such way recently
> via the reflection SG work).
>

Splattering strings together is what we *currently* have to rely on with
C++ preprocessor macros and other code generation facilities that are run
before the compiler.  Handling of ASTs at compile time via constexpr
functions *is* the better way that works with the semantic constructs of
the language.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a1135ed8e8e04b705083ef832
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wed, Nov 19, 2014 at 3:03 PM, Sean Middleditch <span di=
r=3D"ltr">&lt;<a href=3D"mailto:sean.middleditch@gmail.com" target=3D"_blan=
k">sean.middleditch@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_=
extra"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div>I very strongly disagree with this feature and think it&#39;s=
 a very regressive approach.<br></div><div><br></div><div>Tools first.</div=
><div><br></div><div>How would a refactoring tool look? Find Symbol Referen=
ces? Rename? Goto Definition? How would you debug the expansion? How would =
an as-you-type linter work? etc.</div></div></blockquote><div><br></div><di=
v>All of these would require some consideration, but hardly seem like intra=
ctable problems.=C2=A0 I imagine that the existing tool support for other l=
anguages with similar AST functionality would provide a lot of inspiration.=
=C2=A0 But let&#39;s just consider the existing language for a moment: In t=
he context of a template definition, some of these operations are inherentl=
y not well-defined anyway, and the approach has to be heuristic.=C2=A0 Igno=
ring templates, C++ preprocessor macros also make some of these operations =
tricky; in principle you can always find the references, but you can&#39;t =
necessarily change them automatically.=C2=A0 Certainly allowing AST manipul=
ations would introduce additional cases to which some of these operations m=
ight either be blind or have to rely on a heuristic approach, but that hard=
ly seems like a fundamental blocker.<br></div><br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><div>Even on systems without highly-intelligent IDEs=
, tools like ctags and the like are quite common. They have a hard enough t=
ime with C macros, and there&#39;s still so much work to do to make templat=
es easier to debug (e.g., being able to step through template instantiation=
s during compilation). A C++ `eval` is a massive regression for the tools-a=
ccessibility of the language.<br></div></div></blockquote><div><br></div><d=
iv></div><div>It wouldn&#39;t be a regression because no existing code, in =
particular the standard library, need be changed to make use of it.=C2=A0 U=
sers who don&#39;t like how the feature interacts with some tool can simply=
 avoid using it.=C2=A0 This is already the case with C++ preprocessor macro=
s, for instance.=C2=A0 </div></div><br></div><div class=3D"gmail_extra">In =
what situation would adding these facilities actually result in a worse exp=
erience for the programmer?=C2=A0 Let&#39;s consider the alternatives avail=
able present:<br></div><div class=3D"gmail_extra">1. Writing repetitive cod=
e: maybe easier for tools to handle, but likely a maintenance nightmare for=
 the programmer.<br></div><div class=3D"gmail_extra">2. Using preprocessor =
macros: almost certainly more difficult to manage for programmers and tools=
<br></div><div class=3D"gmail_extra">3. Using an external code generation s=
ystem: even more difficult for both tools and programmers than using prepro=
cessor macros.<br></div><div class=3D"gmail_extra">4. Using template metapr=
ogramming trickery to make definitions, struct members, etc. conditionally =
present: much more cumbersome for the programmer than proper AST facilities=
, or static if.=C2=A0 If full types aren&#39;t known, i.e. in a template, t=
ools have no way to handle this, and this would be the same with AST manipu=
lation/static if.=C2=A0 If full types are known, then (sufficiently smart) =
tools can handle it perfectly well both with template metaprogramming and w=
ith AST manipulation or static if.<br></div><div class=3D"gmail_extra"><br>=
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
<div></div><div>Splatting strings together is not the best way to programma=
tically compose code. There are Better Ways(tm). Such tools should work wit=
h the semantic constructs of the language, not with the textual encoding of=
 those semantics represented by programmer-authored source code. These code=
 generation facilities should be explored in the context of tools rather th=
an text (and there has been at least one paper on one such way recently via=
 the reflection SG work).</div></div></blockquote><div><br></div><div>Splat=
tering strings together is what we *currently* have to rely on with C++ pre=
processor macros and other code generation facilities that are run before t=
he compiler.=C2=A0 Handling of ASTs at compile time via constexpr functions=
 *is* the better way that works with the semantic constructs of the languag=
e.<br></div></div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a1135ed8e8e04b705083ef832--

.


Author: snk_kid <korcan.hussein@googlemail.com>
Date: Wed, 19 Nov 2014 16:16:11 -0800 (PST)
Raw View
------=_Part_5914_1572628023.1416442571379
Content-Type: multipart/alternative;
 boundary="----=_Part_5915_2077938932.1416442571379"

------=_Part_5915_2077938932.1416442571379
Content-Type: text/plain; charset=UTF-8

On Tuesday, November 18, 2014 3:48:38 PM UTC, Joel Falcou wrote:
>
>  Yeah that's the idea (although I'm abit unsure what you mean about
> getting a value out part), one thing missing is quoting the C++ expression.
> You want to be able to seperate out the parts of expressions that get
> evaluated at compile-time and the parts that get converted into an AST
> (unevaluated).
>
> In Lisp the code quotation operator is the back-tick symbol `, in nermele
> it's a pair of <[ ... ]>, Template Haskell it's [| ... |] so your example
> would look something like this:
>
> constexpr Expr<int> x = [| a +b*3 |];
>
> That's a basic example, an AST macro (constexpr function) would typically
> have a mix of quoted & unquoted C++ code.
>
>
> Isn't ` enough ? [| |] is a mouthful to type. But that's probably
> bikeshedding.
>

Sure it doesn't have to be that, it was just an example but I think having
only a single back-tick may make it harder to scope/mark out
sub-expressions in a bigger expression (like in a single line).

On Tuesday, November 18, 2014 10:09:53 PM UTC, masse....@gmail.com wrote:
>
> Hi,
> I don't know if this correpond to what you want, but did you had a look at N4147
> - Inline variables, or encapsulated expressions
> <http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4147.pdf> ?
>

it's unrelated, we are talking about adding a proper solution to
meta-programming beyond compile-time functions so not just executing C++ at
compile-time but also being able to transform and/or generate C++ code all
in the same language as the object language (C++) and in a type-safe manner.

C preprocessor isn't good enough because; it only provides textual
substitution and has no knowledge of C/C++ code, the meta-language is
different from the object language, it is very limited without hacky
workarounds (like how to do loops/recursion).

Template meta-programming isn't quite good enough because; templates where
not originally designed to be used for meta-programming, the meta-language
is different from the object language, it is very limited when it comes to
code generation capabilities without obscure hacky workarounds (and even
then it has limitations).

Basically what we are talking about is an extension of constexpr
capabilities.

On Wednesday, November 19, 2014 11:03:10 PM UTC, Sean Middleditch wrote:
>
> I very strongly disagree with this feature and think it's a very
> regressive approach.
>

Could you please explain why think it is regressive compared to the other
approaches in C++ (preprocessor/template metaprogramming). We talking about
(gradually) extending the capabilities of constexpr beyond compile-time
functions in a type-safe manner that does understand the language.

Basically replacing all kinds of meta-programming currently done with
templates with normal C++ code that 99% of all C++ programmers can
understand immediately because it's not a different language with
limitations.

Say you wanted to write a meta-function which did some compile-time
arithmetic in C++11/14, which would rather prefer to write this with
constexpr functions or templates? now if you could which would you rather
use for compile-time code generation?

On Wednesday, November 19, 2014 11:03:10 PM UTC, Sean Middleditch wrote:

> Tools first.
>
> How would a refactoring tool look? Find Symbol References? Rename? Goto
> Definition? How would you debug the expansion? How would an as-you-type
> linter work? etc.
>
Even on systems without highly-intelligent IDEs, tools like ctags and the
> like are quite common. They have a hard enough time with C macros, and
> there's still so much work to do to make templates easier to debug (e.g.,
> being able to step through template instantiations during compilation). A
> C++ `eval` is a massive regression for the tools-accessibility of the
> language.
>


Nothing really changes here, you're writing meta-code with the C++ language
(a tiny super-set of C++ actually) not a secondary different language. In
fact such tools would have a much better chance than meta-code written with
the preprocessor or templates, there wouldn't be a need for any guess work
as long as the tools know the few additional language features added such
as a code quotation operator.

We are not talking about textual substation or meta-programming with
strings.

On Wednesday, November 19, 2014 11:03:10 PM UTC, Sean Middleditch wrote:

>
> Splatting strings together is not the best way to programmatically compose
> code. There are Better Ways(tm).
>

I don't think anybody said anything about string meta-programming, we are
definitely not suggesting that and we are talking about the better way! it
is a (mostly) solved problem that quite a few languages (Lisp/Scheme, Rust,
Nermele, Nimrod, Template Haskell, MetaOcaml etc) have and some have had it
for a long time.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_5915_2077938932.1416442571379
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, November 18, 2014 3:48:38 PM UTC, Joel Falcou =
wrote:
    <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF"><=
blockquote type=3D"cite">
      <div dir=3D"ltr">
        <div>Yeah that's the idea (although I'm abit unsure what you
          mean about getting a value out part), one thing missing is
          quoting the C++ expression. You want to be able to seperate
          out the parts of expressions that get evaluated at
          compile-time and the parts that get converted into an AST
          (unevaluated).<br>
          <br>
          In Lisp the code quotation operator is the back-tick symbol `,
          in nermele it's a pair of &lt;[ ... ]&gt;, Template Haskell
          it's [| ... |] so your example would look something like this:<br=
>
          <br>
          constexpr Expr&lt;int&gt; x =3D [| a +b*3 |];<br>
          <br>
          That's a basic example, an AST macro (constexpr function)
          would typically have a mix of quoted &amp; unquoted C++ code.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Isn't ` enough ? [| |] is a mouthful to type. But that's probably
    bikeshedding.<br></div></blockquote><br>Sure it doesn't have to
 be that, it was just an example but I think having only a single=20
back-tick may make it harder to scope/mark out sub-expressions in a=20
bigger expression (like in a single line).<br><br>On Tuesday, November 18, =
2014 10:09:53 PM UTC, masse....@gmail.com wrote:<blockquote class=3D"gmail_=
quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pa=
dding-left: 1ex;"><div dir=3D"ltr"><div>Hi,<br></div><div>I don't know if t=
his correpond to what you want, but did you had a look at <a href=3D"http:/=
/www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4147.pdf" target=3D"_bla=
nk">N4147 - Inline variables, or encapsulated expressions</a> ?</div></div>=
</blockquote><div>&nbsp;<br>it's unrelated, we are talking about adding a p=
roper solution to meta-programming beyond compile-time functions so not jus=
t executing C++ at compile-time but also being able to transform and/or gen=
erate C++ code all in the same language as the object language (C++) and in=
 a type-safe manner.<br><br>C preprocessor isn't good enough because; it on=
ly provides textual substitution and has no knowledge of C/C++ code, the me=
ta-language is different from the object language, it is very limited witho=
ut hacky workarounds (like how to do loops/recursion).<br><br>Template meta=
-programming isn't quite good enough because; templates where not originall=
y designed to be used for meta-programming, the meta-language is different =
from the object language, it is very limited when it comes to code generati=
on capabilities without obscure hacky workarounds (and even then it has lim=
itations).<br><br>Basically what we are talking about is an extension of co=
nstexpr capabilities.<br><br>On Wednesday, November 19, 2014 11:03:10 PM UT=
C, Sean Middleditch wrote:<blockquote class=3D"gmail_quote" style=3D"margin=
: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div=
 dir=3D"ltr"><div>I very strongly disagree with this feature and think it's=
 a very regressive approach.<br></div></div></blockquote><div><br>Could
 you please explain why think it is regressive compared to the other=20
approaches in C++ (preprocessor/template metaprogramming). We talking=20
about (gradually) extending the capabilities of constexpr beyond=20
compile-time functions in a type-safe manner that does understand the=20
language.<br><br>Basically replacing all kinds of meta-programming=20
currently done with templates with normal C++ code that 99% of all C++=20
programmers can understand immediately because it's not a different=20
language with limitations.<br><br>Say you wanted to write a=20
meta-function which did some compile-time arithmetic in C++11/14, which=20
would rather prefer to write this with constexpr functions or templates?
 now if you could which would you rather use for compile-time code=20
generation?<br><br>On Wednesday, November 19, 2014 11:03:10 PM UTC, Sean Mi=
ddleditch wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div=
 dir=3D"ltr"><div>Tools first.</div><div><br></div><div>How
 would a refactoring tool look? Find Symbol References? Rename? Goto=20
Definition? How would you debug the expansion? How would an as-you-type=20
linter work? etc. <br></div></div></blockquote><blockquote class=3D"gmail_q=
uote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pad=
ding-left: 1ex;"><div dir=3D"ltr"><div>Even on systems without highly-intel=
ligent IDEs,=20
tools like ctags and the like are quite common. They have a hard enough=20
time with C macros, and there's still so much work to do to make=20
templates easier to debug (e.g., being able to step through template=20
instantiations during compilation). A C++ `eval` is a massive regression
 for the tools-accessibility of the language.</div></div></blockquote><div>=
&nbsp;</div><div><br>Nothing
 really changes here, you're writing meta-code with the C++ language (a=20
tiny super-set of C++ actually) not a secondary different language. In fact
 such tools would have a much better chance than meta-code written with=20
the preprocessor or templates, there wouldn't be a need for any guess=20
work as long as the tools know the few additional language features=20
added such as a code quotation operator.<br><br>We are not talking about te=
xtual substation or meta-programming with strings.<br>&nbsp;<br>On Wednesda=
y, November 19, 2014 11:03:10 PM UTC, Sean Middleditch wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><div>Splattin=
g strings together is not the best way to programmatically compose code. Th=
ere are Better Ways(tm).</div></div></blockquote><div><br>I
 don't think anybody said anything about string meta-programming, we are
 definitely not suggesting that and we are talking about the better way!
 it is a (mostly) solved problem that quite a few languages=20
(Lisp/Scheme, Rust, Nermele, Nimrod, Template Haskell, MetaOcaml etc)=20
have and some have had it for a long time.<br></div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5915_2077938932.1416442571379--
------=_Part_5914_1572628023.1416442571379--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Fri, 21 Nov 2014 18:40:17 -0500
Raw View
--001a11c3c832a23441050866f734
Content-Type: text/plain; charset=UTF-8

On Wed, Nov 19, 2014 at 7:16 PM, snk_kid <korcan.hussein@googlemail.com>
wrote:

> On Tuesday, November 18, 2014 3:48:38 PM UTC, Joel Falcou wrote:
>>
>>  Yeah that's the idea (although I'm abit unsure what you mean about
>> getting a value out part), one thing missing is quoting the C++ expression.
>> You want to be able to seperate out the parts of expressions that get
>> evaluated at compile-time and the parts that get converted into an AST
>> (unevaluated).
>>
>> In Lisp the code quotation operator is the back-tick symbol `, in nermele
>> it's a pair of <[ ... ]>, Template Haskell it's [| ... |] so your example
>> would look something like this:
>>
>> constexpr Expr<int> x = [| a +b*3 |];
>>
>> That's a basic example, an AST macro (constexpr function) would typically
>> have a mix of quoted & unquoted C++ code.
>>
>>
>> Isn't ` enough ? [| |] is a mouthful to type. But that's probably
>> bikeshedding.
>>
>
[| |] is better - don't you want quotes within quotes?


Anyone have example code before/after something like this?  Obviously not
working examples, just something to get a feel of how worthwhile it might
be?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a11c3c832a23441050866f734
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Nov 19, 2014 at 7:16 PM, snk_kid <span dir=3D"ltr">&lt;<a href=
=3D"mailto:korcan.hussein@googlemail.com" target=3D"_blank">korcan.hussein@=
googlemail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
 dir=3D"ltr"><span class=3D"">On Tuesday, November 18, 2014 3:48:38 PM UTC,=
 Joel Falcou wrote:
    <blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div bgcolor=3D"#FFFFFF"><block=
quote type=3D"cite">
      <div dir=3D"ltr">
        <div>Yeah that&#39;s the idea (although I&#39;m abit unsure what yo=
u
          mean about getting a value out part), one thing missing is
          quoting the C++ expression. You want to be able to seperate
          out the parts of expressions that get evaluated at
          compile-time and the parts that get converted into an AST
          (unevaluated).<br>
          <br>
          In Lisp the code quotation operator is the back-tick symbol `,
          in nermele it&#39;s a pair of &lt;[ ... ]&gt;, Template Haskell
          it&#39;s [| ... |] so your example would look something like this=
:<br>
          <br>
          constexpr Expr&lt;int&gt; x =3D [| a +b*3 |];<br>
          <br>
          That&#39;s a basic example, an AST macro (constexpr function)
          would typically have a mix of quoted &amp; unquoted C++ code.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Isn&#39;t ` enough ? [| |] is a mouthful to type. But that&#39;s probab=
ly
    bikeshedding.<br></div></blockquote></span></div></blockquote><div><br>=
</div><div>[| |] is better - don&#39;t you want quotes within quotes? <br><=
/div></div><br><br></div><div class=3D"gmail_extra">Anyone have example cod=
e before/after something like this?=C2=A0 Obviously not working examples, j=
ust something to get a feel of how worthwhile it might be?<br><br><br></div=
></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c3c832a23441050866f734--

.


Author: Joel Falcou <joel.falcou@gmail.com>
Date: Sat, 22 Nov 2014 07:54:49 +0100
Raw View
--001a113fe4ca9d467205086d09d8
Content-Type: text/plain; charset=UTF-8

I can dig up some of my teaching material on metaOCAML where I use exactly
this to generate code from a small DSL.

2014-11-22 0:40 GMT+01:00 Tony V E <tvaneerd@gmail.com>:

>
>
> On Wed, Nov 19, 2014 at 7:16 PM, snk_kid <korcan.hussein@googlemail.com>
> wrote:
>
>> On Tuesday, November 18, 2014 3:48:38 PM UTC, Joel Falcou wrote:
>>>
>>>  Yeah that's the idea (although I'm abit unsure what you mean about
>>> getting a value out part), one thing missing is quoting the C++ expression.
>>> You want to be able to seperate out the parts of expressions that get
>>> evaluated at compile-time and the parts that get converted into an AST
>>> (unevaluated).
>>>
>>> In Lisp the code quotation operator is the back-tick symbol `, in
>>> nermele it's a pair of <[ ... ]>, Template Haskell it's [| ... |] so your
>>> example would look something like this:
>>>
>>> constexpr Expr<int> x = [| a +b*3 |];
>>>
>>> That's a basic example, an AST macro (constexpr function) would
>>> typically have a mix of quoted & unquoted C++ code.
>>>
>>>
>>> Isn't ` enough ? [| |] is a mouthful to type. But that's probably
>>> bikeshedding.
>>>
>>
> [| |] is better - don't you want quotes within quotes?
>
>
> Anyone have example code before/after something like this?  Obviously not
> working examples, just something to get a feel of how worthwhile it might
> be?
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a113fe4ca9d467205086d09d8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I can dig up some of my teaching material on metaOCAML whe=
re I use exactly this to generate code from a small DSL.<br></div><div clas=
s=3D"gmail_extra"><br><div class=3D"gmail_quote">2014-11-22 0:40 GMT+01:00 =
Tony V E <span dir=3D"ltr">&lt;<a href=3D"mailto:tvaneerd@gmail.com" target=
=3D"_blank">tvaneerd@gmail.com</a>&gt;</span>:<br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gma=
il_quote"><span class=3D"">On Wed, Nov 19, 2014 at 7:16 PM, snk_kid <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:korcan.hussein@googlemail.com" target=3D"_=
blank">korcan.hussein@googlemail.com</a>&gt;</span> wrote:<br><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><span>On Tuesday, November 18, 2014 3:48=
:38 PM UTC, Joel Falcou wrote:
    <blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div bgcolor=3D"#FFFFFF"><block=
quote type=3D"cite">
      <div dir=3D"ltr">
        <div>Yeah that&#39;s the idea (although I&#39;m abit unsure what yo=
u
          mean about getting a value out part), one thing missing is
          quoting the C++ expression. You want to be able to seperate
          out the parts of expressions that get evaluated at
          compile-time and the parts that get converted into an AST
          (unevaluated).<br>
          <br>
          In Lisp the code quotation operator is the back-tick symbol `,
          in nermele it&#39;s a pair of &lt;[ ... ]&gt;, Template Haskell
          it&#39;s [| ... |] so your example would look something like this=
:<br>
          <br>
          constexpr Expr&lt;int&gt; x =3D [| a +b*3 |];<br>
          <br>
          That&#39;s a basic example, an AST macro (constexpr function)
          would typically have a mix of quoted &amp; unquoted C++ code.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Isn&#39;t ` enough ? [| |] is a mouthful to type. But that&#39;s probab=
ly
    bikeshedding.<br></div></blockquote></span></div></blockquote><div><br>=
</div></span><div>[| |] is better - don&#39;t you want quotes within quotes=
? <br></div></div><br><br></div><div class=3D"gmail_extra">Anyone have exam=
ple code before/after something like this?=C2=A0 Obviously not working exam=
ples, just something to get a feel of how worthwhile it might be?<br><br><b=
r></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a113fe4ca9d467205086d09d8--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Mon, 24 Nov 2014 11:44:29 -0500
Raw View
--089e0112c58820dbf805089d826c
Content-Type: text/plain; charset=UTF-8

On Sat, Nov 22, 2014 at 1:54 AM, Joel Falcou <joel.falcou@gmail.com> wrote:

> I can dig up some of my teaching material on metaOCAML where I use exactly
> this to generate code from a small DSL.
>
>
I'd prefer something that looked like C++.
We need motivational examples.  Code that is hard without this, and gets
easy with it.

Obviously some of the syntax would be new and thus made up, but something
to get a feel of it.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--089e0112c58820dbf805089d826c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Sat, Nov 22, 2014 at 1:54 AM, Joel Falcou <span dir=3D"ltr">&lt;<a h=
ref=3D"mailto:joel.falcou@gmail.com" target=3D"_blank">joel.falcou@gmail.co=
m</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
I can dig up some of my teaching material on metaOCAML where I use exactly =
this to generate code from a small DSL.<br></div><div class=3D"gmail_extra"=
><br></div></blockquote><div><br></div><div>I&#39;d prefer something that l=
ooked like C++.<br></div><div>We need motivational examples.=C2=A0 Code tha=
t is hard without this, and gets easy with it.<br><br></div><div>Obviously =
some of the syntax would be new and thus made up, but something to get a fe=
el of it.<br></div></div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0112c58820dbf805089d826c--

.


Author: Joel FALCOU <joel.falcou@gmail.com>
Date: Mon, 24 Nov 2014 18:32:44 +0100
Raw View
Of course, just that I have soemthing done in a way that may look like a
real C++ sue case. Just didn't wanted to write something from the ground up.


On 24/11/2014 17:44, Tony V E wrote:
>
>
> On Sat, Nov 22, 2014 at 1:54 AM, Joel Falcou <joel.falcou@gmail.com
> <mailto:joel.falcou@gmail.com>> wrote:
>
>     I can dig up some of my teaching material on metaOCAML where I use
>     exactly this to generate code from a small DSL.
>
>
> I'd prefer something that looked like C++.
> We need motivational examples.  Code that is hard without this, and gets
> easy with it.
>
> Obviously some of the syntax would be new and thus made up, but
> something to get a feel of it.
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to std-proposals+unsubscribe@isocpp.org
> <mailto:std-proposals+unsubscribe@isocpp.org>.
> To post to this group, send email to std-proposals@isocpp.org
> <mailto:std-proposals@isocpp.org>.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Mon, 24 Nov 2014 14:30:19 -0500
Raw View
--089e0158ad5833cf5c05089fd39e
Content-Type: text/plain; charset=UTF-8

sure.

And it's just my opinion - I think motivation/use-case/examples would be
helpful. But I'm lazy and ask others to do the work :-)


On Mon, Nov 24, 2014 at 12:32 PM, Joel FALCOU <joel.falcou@gmail.com> wrote:

> Of course, just that I have soemthing done in a way that may look like a
> real C++ sue case. Just didn't wanted to write something from the ground
> up.
>
>
> On 24/11/2014 17:44, Tony V E wrote:
> >
> >
> > On Sat, Nov 22, 2014 at 1:54 AM, Joel Falcou <joel.falcou@gmail.com
> > <mailto:joel.falcou@gmail.com>> wrote:
> >
> >     I can dig up some of my teaching material on metaOCAML where I use
> >     exactly this to generate code from a small DSL.
> >
> >
> > I'd prefer something that looked like C++.
> > We need motivational examples.  Code that is hard without this, and gets
> > easy with it.
> >
> > Obviously some of the syntax would be new and thus made up, but
> > something to get a feel of it.
> >
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--089e0158ad5833cf5c05089fd39e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">sure.<br><br>And it&#39;s just my opinion - I think motiva=
tion/use-case/examples would be helpful. But I&#39;m lazy and ask others to=
 do the work :-)<br><br><div class=3D"gmail_extra"><br><div class=3D"gmail_=
quote">On Mon, Nov 24, 2014 at 12:32 PM, Joel FALCOU <span dir=3D"ltr">&lt;=
<a href=3D"mailto:joel.falcou@gmail.com" target=3D"_blank">joel.falcou@gmai=
l.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex">Of course, just that I have soemthing done in a way that may look lik=
e a<br>
real C++ sue case. Just didn&#39;t wanted to write something from the groun=
d up.<br>
<span class=3D""><br>
<br>
On 24/11/2014 17:44, Tony V E wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Nov 22, 2014 at 1:54 AM, Joel Falcou &lt;<a href=3D"mailto:joe=
l.falcou@gmail.com">joel.falcou@gmail.com</a><br>
</span><span class=3D"">&gt; &lt;mailto:<a href=3D"mailto:joel.falcou@gmail=
..com">joel.falcou@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0I can dig up some of my teaching material on metaOC=
AML where I use<br>
&gt;=C2=A0 =C2=A0 =C2=A0exactly this to generate code from a small DSL.<br>
&gt;<br>
&gt;<br>
&gt; I&#39;d prefer something that looked like C++.<br>
&gt; We need motivational examples.=C2=A0 Code that is hard without this, a=
nd gets<br>
&gt; easy with it.<br>
&gt;<br>
&gt; Obviously some of the syntax would be new and thus made up, but<br>
&gt; something to get a feel of it.<br>
&gt;</span><br></blockquote></div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0158ad5833cf5c05089fd39e--

.