<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:georss="http://www.georss.org/georss" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Nesterovsky bros - C++</title>
    <link>http://www.nesterovsky-bros.com/weblog/</link>
    <description />
    <language>en-us</language>
    <copyright>Nesterovsky bros</copyright>
    <lastBuildDate>Fri, 16 Mar 2012 19:21:58 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.12105.0</generator>
    <managingEditor>contact@nesterovsky-bros.com</managingEditor>
    <webMaster>contact@nesterovsky-bros.com</webMaster>
    <item>
      <trackback:ping>http://www.nesterovsky-bros.com/weblog/Trackback.aspx?guid=a9c55d27-d353-4bcf-b923-2b7f00768d22</trackback:ping>
      <pingback:server>http://www.nesterovsky-bros.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.nesterovsky-bros.com/weblog/PermaLink,guid,a9c55d27-d353-4bcf-b923-2b7f00768d22.aspx</pingback:target>
      <dc:creator>Vladimir Nesterovsky</dc:creator>
      <georss:point>0 0</georss:point>
      <wfw:comment>http://www.nesterovsky-bros.com/weblog/CommentView,guid,a9c55d27-d353-4bcf-b923-2b7f00768d22.aspx</wfw:comment>
      <wfw:commentRss>http://www.nesterovsky-bros.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=a9c55d27-d353-4bcf-b923-2b7f00768d22</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After C++11 revision has been approved a new cycle of C++ design has begun:
</p>
        <p style="padding-left: 1em; font-style: italic">
          <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3370.html">N3370</a>:
The C++ standards committee is soliciting proposals for additional library components.
Such proposals can range from small (addition of a single signature to an existing
library) to large (something bigger than any current standard library component). 
</p>
        <p>
At this stage it's interesting to read papers, as authors try to express ideas
rather than to formulate sentences that should go into spec as it lately was.
</p>
        <p>
These are just several papers that we've found interesting:
</p>
        <table border="1">
          <tr>
            <td>
              <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3322.pdf">N3322</a>
            </td>
            <td>
12-0012 
</td>
            <td>
A Preliminary Proposal for a Static if 
</td>
            <td>
Walter E. Brown 
</td>
          </tr>
          <tr>
            <td>
              <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3329.pdf">N3329</a>
            </td>
            <td>
12-0019 
</td>
            <td>
Proposal: static if declaration 
</td>
            <td>
H. Sutter, W. Bright, A. Alexandrescu 
</td>
          </tr>
        </table>
        <p>
Those proposals argue about compile time "if statement". The feature can
replace <code>#if</code> preprocessor directive, a SFINAE or in some cases template
specializations.
</p>
        <p>
A <code>static if</code> declaration can appear wherever a declaration or a statement
is legal. Authors also propose to add <code>static if</code> clause to a class and
a function declarations to conditionally exclude them from the scope.
</p>
        <p>
Examples:
</p>
        <p style="padding-left: 1em">
          <code>// Compile time factorial.<br />
template &lt;unsigned n&gt;<br />
struct factorial<br />
{<br />
static if (n &lt;= 1)<br />
{<br />
enum : unsigned { value = 1 };<br />
} 
<br />
else 
<br />
{<br />
enum : unsigned { value = factorial&lt;n - 1&gt;::value * n };<br />
}<br />
};<br /><br />
// Declare class provided a condition is true.<br />
class Internals if (sizeof(void*) == sizeof(int));</code>
        </p>
        <p>
Paper presents strong rationale why this addition helps to build better programs,
however the questions arise about relations between <code>static if</code> and concepts, <code>static
if</code> clause and an error diagnostics.
</p>
        <p>
        </p>
        <table border="1">
          <tr>
            <td>
              <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3327.pdf"> N3327</a>
            </td>
            <td>
12-0017</td>
            <td>
A Standard Programmatic Interface for Asynchronous Operations</td>
            <td>
N. Gustafsson, A. Laksberg</td>
          </tr>
          <tr>
            <td>
              <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3328.pdf"> N3328</a>
            </td>
            <td>
12-0018</td>
            <td>
Resumable Functions</td>
            <td>
Niklas Gustafsson</td>
          </tr>
        </table>
        <p>
That's our favorite.
</p>
        <p>
Authors propose an API and a language extensions to make asynchronous programs simpler. 
</p>
        <p>
In fact, asynchronous function will look very mush as a regular one but with small
additions. It's similar to <code>yield return</code> in C# (<span style="font-style: italic">a
construct that has been available in C# for many years and is well vetted</span>),
and to <code>async</code> expression in C# 4.5. Compiler will rewrite such a function
into a state machine, thus function can suspend its execution, wait for the data and
to resume when data is available.
</p>
        <p>
Example:
</p>
        <p style="padding-left: 1em">
          <code>// read data asynchronously from an input and write it into an output.<br />
int cnt = 0;<br /><br />
do<br />
{<br />
cnt = await streamR.read(512, buf);<br /><br />
if (cnt == 0) 
<br />
{<br />
break;<br />
}<br /><br />
cnt = await streamW.write(cnt, buf);<br />
}<br />
while(cnt &gt; 0);</code>
        </p>
        <p>
It's iteresting to see how authors will address <code>yield return</code>: either
with aditional keyword, or in terms of resumable functions.
</p>
        <p>
        </p>
        <p>
          <table border="1">
            <tr>
              <td>
                <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3340.pdf"> N3340</a>
              </td>
              <td>
12-0030</td>
              <td>
Rich Pointers</td>
              <td>
D. M. Berris, M. Austern, L. Crowl</td>
            </tr>
          </table>
        </p>
        <p>
Here authors try to justify rich type-info but mask it under the name "rich pointers".
To make things even more obscure they argue about dynamic code generation.
</p>
        <p>
If you want a rich type-info then you should talk about it and not about thousand
of other things.
</p>
        <p>
We would better appealed to create a standard API to access post-compile object model,
which could be used to produce different type-infos or other source derivatives.
</p>
        <p>
This paper is our outsider. :-)
</p>
        <p>
        </p>
        <p>
          <table border="1">
            <tr>
              <td>
                <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3341.pdf"> N3341</a>
              </td>
              <td>
12-0031</td>
              <td>
Transactional Language Constructs for C++</td>
              <td>
M. Wong, H. Boehm, J. Gottschlich, T. Shpeisman, et al.</td>
            </tr>
          </table>
        </p>
        <p>
Here people try to generalize (put you away from) locking, and replace it with other
word "transaction". 
</p>
        <p>
Seems it's not viable proposition. It's better to teach on functional style
of programming with its immutable objects.
</p>
        <p>
        </p>
        <table border="1">
          <tr>
            <td>
              <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3347.pdf"> N3347</a>
            </td>
            <td>
12-0037</td>
            <td>
Modules in C++ (Revision 6)</td>
            <td>
Daveed Vandevoorde</td>
          </tr>
        </table>
        <p>
Author argues against C style source composition with <code>#include</code> directive,
and propose alternative called "modules".
</p>
        <p>
We think that many C++ developers would agree that C pre-processor is a legacy that
would never have existed, but for the same reason (for the legacy, and compatibility)
it should stay.
</p>
        <p>
In out opinion the current proposition is just immature, at least it's not intuitive.
Or in other words there should be something to replace the C pre-processor (and <code>#include</code> as
its part), but we don't like this paper from aestetic perspective.
</p>
        <p>
        </p>
        <table border="1">
          <tr>
            <td>
              <a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3365.html"> N3365</a>
            </td>
            <td>
12-0055</td>
            <td>
Filesystem Library Proposal (Revision 2)</td>
          </tr>
        </table>
        <p>
This proposal says no a word about asynchronous nature of file access, while it should
be designed around it.
</p>
        <img width="0" height="0" src="http://www.nesterovsky-bros.com/weblog/aggbug.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22" />
      </body>
      <title>New season in C++ WG</title>
      <guid isPermaLink="false">http://www.nesterovsky-bros.com/weblog/PermaLink,guid,a9c55d27-d353-4bcf-b923-2b7f00768d22.aspx</guid>
      <link>http://www.nesterovsky-bros.com/weblog/2012/03/16/NewSeasonInCWG.aspx</link>
      <pubDate>Fri, 16 Mar 2012 19:21:58 GMT</pubDate>
      <description>  &lt;p&gt;
After C++11 revision has been approved a new cycle of C++ design has begun:
&lt;/p&gt;
&lt;p style="padding-left: 1em; font-style: italic"&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3370.html"&gt;N3370&lt;/a&gt;:
The C++ standards committee is soliciting proposals for additional library components.
Such proposals can range from small (addition of a single signature to an existing
library) to large (something bigger than any current standard library component). 
&lt;/p&gt;
&lt;p&gt;
At this stage it&amp;#39;s interesting to read papers, as authors try to express ideas
rather than to formulate sentences that should go into spec as it lately was.
&lt;/p&gt;
&lt;p&gt;
These are just several papers that we&amp;#39;ve found interesting:
&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3322.pdf"&gt;N3322&lt;/a&gt; 
&lt;/td&gt;
&lt;td&gt;
12-0012 
&lt;/td&gt;
&lt;td&gt;
A Preliminary Proposal for a Static if 
&lt;/td&gt;
&lt;td&gt;
Walter E. Brown 
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3329.pdf"&gt;N3329&lt;/a&gt; 
&lt;/td&gt;
&lt;td&gt;
12-0019 
&lt;/td&gt;
&lt;td&gt;
Proposal: static if declaration 
&lt;/td&gt;
&lt;td&gt;
H. Sutter, W. Bright, A. Alexandrescu 
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
Those proposals argue about compile time &amp;quot;if statement&amp;quot;. The feature can
replace &lt;code&gt;#if&lt;/code&gt; preprocessor directive, a SFINAE or in some cases template
specializations.
&lt;/p&gt;
&lt;p&gt;
A &lt;code&gt;static if&lt;/code&gt; declaration can appear wherever a declaration or a statement
is legal. Authors also propose to add &lt;code&gt;static if&lt;/code&gt; clause to a class and
a function declarations to conditionally exclude them from the scope.
&lt;/p&gt;
&lt;p&gt;
Examples:
&lt;/p&gt;
&lt;p style="padding-left: 1em"&gt;
&lt;code&gt;// Compile time factorial.&lt;br /&gt;
template &amp;lt;unsigned n&amp;gt;&lt;br /&gt;
struct factorial&lt;br /&gt;
{&lt;br /&gt;
static if (n &amp;lt;= 1)&lt;br /&gt;
{&lt;br /&gt;
enum : unsigned { value = 1 };&lt;br /&gt;
} 
&lt;br /&gt;
else 
&lt;br /&gt;
{&lt;br /&gt;
enum : unsigned { value = factorial&amp;lt;n - 1&amp;gt;::value * n };&lt;br /&gt;
}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Declare class provided a condition is true.&lt;br /&gt;
class Internals if (sizeof(void*) == sizeof(int));&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
Paper presents strong rationale why this addition helps to build better programs,
however the questions arise about relations between &lt;code&gt;static if&lt;/code&gt; and concepts, &lt;code&gt;static
if&lt;/code&gt; clause and an error diagnostics.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3327.pdf"&gt; N3327&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
12-0017&lt;/td&gt;
&lt;td&gt;
A Standard Programmatic Interface for Asynchronous Operations&lt;/td&gt;
&lt;td&gt;
N. Gustafsson, A. Laksberg&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3328.pdf"&gt; N3328&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
12-0018&lt;/td&gt;
&lt;td&gt;
Resumable Functions&lt;/td&gt;
&lt;td&gt;
Niklas Gustafsson&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
That&amp;#39;s our favorite.
&lt;/p&gt;
&lt;p&gt;
Authors propose an API and a language extensions to make asynchronous programs simpler. 
&lt;/p&gt;
&lt;p&gt;
In fact, asynchronous function will look very mush as a regular one but with small
additions. It&amp;#39;s similar to &lt;code&gt;yield return&lt;/code&gt; in C# (&lt;span style="font-style: italic"&gt;a
construct that has been available in C# for many years and is well vetted&lt;/span&gt;),
and to &lt;code&gt;async&lt;/code&gt; expression in C# 4.5. Compiler will rewrite such a function
into a state machine, thus function can suspend its execution, wait for the data and
to resume when data is available.
&lt;/p&gt;
&lt;p&gt;
Example:
&lt;/p&gt;
&lt;p style="padding-left: 1em"&gt;
&lt;code&gt;// read data asynchronously from an input and write it into an output.&lt;br /&gt;
int cnt = 0;&lt;br /&gt;
&lt;br /&gt;
do&lt;br /&gt;
{&lt;br /&gt;
cnt = await streamR.read(512, buf);&lt;br /&gt;
&lt;br /&gt;
if (cnt == 0) 
&lt;br /&gt;
{&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
cnt = await streamW.write(cnt, buf);&lt;br /&gt;
}&lt;br /&gt;
while(cnt &amp;gt; 0);&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
It&amp;#39;s iteresting to see how authors will address &lt;code&gt;yield return&lt;/code&gt;: either
with aditional keyword, or in terms of resumable functions.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3340.pdf"&gt; N3340&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
12-0030&lt;/td&gt;
&lt;td&gt;
Rich Pointers&lt;/td&gt;
&lt;td&gt;
D. M. Berris, M. Austern, L. Crowl&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
Here authors try to justify rich type-info but mask it under the name &amp;quot;rich pointers&amp;quot;.
To make things even more obscure they argue about dynamic code generation.
&lt;/p&gt;
&lt;p&gt;
If you want a rich type-info then you should talk about it and not about thousand
of other things.
&lt;/p&gt;
&lt;p&gt;
We would better appealed to create a standard API to access post-compile object model,
which could be used to produce different type-infos or other source derivatives.
&lt;/p&gt;
&lt;p&gt;
This paper is our outsider. :&amp;#45;)
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3341.pdf"&gt; N3341&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
12-0031&lt;/td&gt;
&lt;td&gt;
Transactional Language Constructs for C++&lt;/td&gt;
&lt;td&gt;
M. Wong, H. Boehm, J. Gottschlich, T. Shpeisman, et al.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
Here people try to generalize (put you away from) locking, and replace it with other
word &amp;quot;transaction&amp;quot;. 
&lt;/p&gt;
&lt;p&gt;
Seems it&amp;#39;s not viable proposition. It&amp;#39;s better to teach on functional style
of programming with its immutable objects.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3347.pdf"&gt; N3347&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
12-0037&lt;/td&gt;
&lt;td&gt;
Modules in C++ (Revision 6)&lt;/td&gt;
&lt;td&gt;
Daveed Vandevoorde&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
Author argues against C style source composition with &lt;code&gt;#include&lt;/code&gt; directive,
and propose alternative called &amp;quot;modules&amp;quot;.
&lt;/p&gt;
&lt;p&gt;
We think that many C++ developers would agree that C pre-processor is a legacy that
would never have existed, but for the same reason (for the legacy, and compatibility)
it should stay.
&lt;/p&gt;
&lt;p&gt;
In out opinion the current proposition is just immature, at least it&amp;#39;s not intuitive.
Or in other words there should be something to replace the C pre-processor (and &lt;code&gt;#include&lt;/code&gt; as
its part), but we don&amp;#39;t like this paper from aestetic perspective.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://www.nesterovsky-bros.com/weblog/ct.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22&amp;amp;url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2012%2fn3365.html"&gt; N3365&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
12-0055&lt;/td&gt;
&lt;td&gt;
Filesystem Library Proposal (Revision 2)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
This proposal says no a word about asynchronous nature of file access, while it should
be designed around it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.nesterovsky-bros.com/weblog/aggbug.ashx?id=a9c55d27-d353-4bcf-b923-2b7f00768d22" /&gt;</description>
      <comments>http://www.nesterovsky-bros.com/weblog/CommentView,guid,a9c55d27-d353-4bcf-b923-2b7f00768d22.aspx</comments>
      <category>C++</category>
      <category>Thinking aloud</category>
    </item>
  </channel>
</rss>