220 40322 <CAFdMc-0gqidWj79ogvg8wdwx28N0N+weecu+1dFe5mEzyLN9gg@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Daniel Gutson <danielgutson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Runtime code generation and self modifying code
Date: Fri, 5 Oct 2018 00:45:40 -0300
Lines: 138
Approved: news@gmane.org
Message-ID: <CAFdMc-0gqidWj79ogvg8wdwx28N0N+weecu+1dFe5mEzyLN9gg@mail.gmail.com>
References: <4489f889-977c-45f2-8a2f-186ee3b06bff@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000ae03de0577731b2e"
X-Trace: blaine.gmane.org 1538711033 15783 195.159.176.226 (5 Oct 2018 03:43:53 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 5 Oct 2018 03:43:53 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDE3NBMV6UFBB4V43POQKGQEGUB33QA@isocpp.org Fri Oct 05 05:43:49 2018
Return-path: <std-proposals+bncBDE3NBMV6UFBB4V43POQKGQEGUB33QA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lj1-f199.google.com ([209.85.208.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDE3NBMV6UFBB4V43POQKGQEGUB33QA@isocpp.org>)
	id 1g8H1p-0003um-MM
	for gclcip-std-proposals@m.gmane.org; Fri, 05 Oct 2018 05:43:49 +0200
Original-Received: by mail-lj1-f199.google.com with SMTP id p6-v6sf3950728ljb.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 04 Oct 2018 20:46:00 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1538711155; cv=pass;
        d=google.com; s=arc-20160816;
        b=AWK8buL4jiryvVP2rrGAUvU28kfvsPGYHD6am4ic7w6zLv4adBj/OSgK2hwqNlkGhI
         cYjVvnOF9EIZe2RawjukraMRE90leYpShqrOTBcBxdUPZoNKs5lHagO5cvM1xbYp27wi
         UPA2ZGawXewW1rt+ZJ90X5/mAR8C6q+VhUCLslJJgagH58YrTztcKCltc5e5XS8NMKwQ
         odF78BUM4WFtAmvvmzkcY6Dc40X30DJ+3wT4cCRpZKDXK/lKTvWM+LpXJZoj8/XX0CN6
         DzSWaJg3SHw9b6rW+eRG/TpQhpVnZNr2ekf4UuPXz9ALdU+upBdNjhtS4JcCunLxuWOH
         S9PA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:dkim-signature;
        bh=ygUQEcLwceMKnNzyibiPoMxtA4ELTurT7VkMpoIOtWw=;
        b=DCy4GHWIUii1rD4o0aqrlbRdTT87pawWRecF9lkfI7MQiUFqQ/zmzWpatt/AUAUf04
         ZQlqbQvaZX91/KFb9h2H1Ao6atPg2j5zM11gHCkMy4ftnnyAzloUg573f4GhIKWqCeai
         B634MdeaP3PpbYsfvL4HhI4pEBTOjnQU2851MHEsekumicvZcdA+Q40ShJ6NblxpUZQY
         cEhN6fhrBuBAZewdYU5B0+IcL+dA4dGZOBNmcPJE6uO9io/WoreYI8vo8foLD9JA2LIc
         s4AbbWkP9ByngbVJrJ3w5i7LRr6nk/qVMRo89R3k/g7S5FdhrCuU1/4gNGbwgjrlwVwg
         NFJw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=ck3mpdou;
       spf=pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=danielgutson@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ygUQEcLwceMKnNzyibiPoMxtA4ELTurT7VkMpoIOtWw=;
        b=mczmOPMLBaybYMMSiqUUG+69Pmh2zHPumhbbv0tIsxm4EAURzpUYH3XHD28wCZKz2g
         rMsxlfknmyLvRrKCKiRj/a8Vi1v8tna2O9FKnY38SpCksz8+/ORtTduc7zd56tPEgFps
         4PjV/i2oYpE/q81b981ewW2iALXxlrHdGHkDUlCs3pncySagS12gtEzUayS1GcdxjZyY
         /prUkqw0Fx4U02igOBsmPWpCPvQeLAX8t9Tonye85DCWncgHB3gaYdcm5iBVHwqC9M5u
         fuA8uEDmD5ujVFNaKpUhg991rNBiyvJ5jg/wnDe45Q2hjuBfLnfceQSMClccjtEcQI9V
         2ZQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ygUQEcLwceMKnNzyibiPoMxtA4ELTurT7VkMpoIOtWw=;
        b=AgD5Fuqfori4kNQ9FZaR5spofOx0xkzyrm0xWbV4oMlZ/Fn/ojOEwBMmzmTqXpK4t6
         cI/73BuBkfRWtYD/oWtOtiae9DMr3ag5VTbGvYQevbmc8siOeMaIQfGexMLrGN4L7qcf
         eIC2AwBgAtdcSdLAuDL98b7Ah7Fv3bI1CcndzV8/VSOVVUOGRTAv5jzJA1tbe9G3DA42
         GOuSvhLobPcC7bnwtDTC5Vp1BxHwZNArt1kYes5jLfz2l5eCylEVPEpHtwhQDkVoqj4J
         QH7G/1vycBrhRh5fKFIs0fOxk3FFFDVgjzNCR8Af8tzsHqjUT61wZbt0Q6OmS+DOrTVD
         mDVQ==
X-Gm-Message-State: ABuFfoixPCuS4r/3ALnIAhH+HecfkLbxT+60xmoF679EcUBV3SS489pc
	sFhIHO6oQ2u5m0PDI70Uz59/kQ==
X-Google-Smtp-Source: ACcGV60aD3hbS5JTa3h0JMpUjf1K9uh57Wzgo4IsCoGsRpRwl07zISJnnlCzS6/RJ6F0czAUSafbWA==
X-Received: by 2002:ac2:4359:: with SMTP id o25-v6mr294811lfl.31.1538711155161;
        Thu, 04 Oct 2018 20:45:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a2e:88c1:: with SMTP id a1-v6ls394890ljk.26.gmail; Thu, 04
 Oct 2018 20:45:53 -0700 (PDT)
X-Received: by 2002:a2e:8919:: with SMTP id d25-v6mr6475222lji.69.1538711153616;
        Thu, 04 Oct 2018 20:45:53 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1538711153; cv=none;
        d=google.com; s=arc-20160816;
        b=hJ7RxVBOobEqpjRUottE6ucGRmrQx8lGwJ4wzfybJa6vb7f2KPkPL6Z6hvMd1hbT8p
         NbloepBoVQGEiyqzJLFwBj8/WAOpcVpQd+VvZR92sHYceBllshrnGY8iOeqtmiDpf4uk
         AP40zWtYySf2pLmEnLNcD2hsiT4im4ICCcHhpOmOips7eKvjsLoXouaaf93p8p2iVnfh
         BXfsEW9vBz2iLzeZjObk5lf4phGim0diYBJXJpzDCWgoqbsw4LE17zaAme7uxZU+TK13
         tDvfEc1JOZe9jdSKuQ3k+VSgXjnrODFK00C/nKhV+ObBENlrOIxffFMVG0gHpPpwA6sU
         Wblg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=KEGbqinl1KqkPA1KmrkI2asUfO84Uf95uL3+9vcI2OI=;
        b=I01gAy+WSaZ0Ra9rPYT61yXqbmxhaX/L5HregCB5GqKjG3fM/FGL5SOw+IG1jte6dd
         hrkaHE7sbeh32udgCtBsgQ5j33IgLXYmIrOk6a3Aa3loeebkuuIikaew8MMDJfybpl+b
         znEfZmeLGit3Vu+4tDhAikdjJdMfK/MOpwcIY3W8lqOWct6MKG2LKPwhrptMXm9kbsLU
         keZNjP15BoyEhnwKdfusI+xpBAG6D/6bC1+g+RkjertPrOKrYuStCUQGlVT9B7lAN3CJ
         1/+jY2xA2Od+L4xjYioggn111oeDlgsDeMfdgNX50u8HTAK+Ka4MjJ6k0bBpFREpz/iN
         FjEg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=ck3mpdou;
       spf=pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=danielgutson@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id h10-v6sor2416819lfm.53.2018.10.04.20.45.53
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Thu, 04 Oct 2018 20:45:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a19:54c1:: with SMTP id b62-v6mr5378191lfl.14.1538711152885;
 Thu, 04 Oct 2018 20:45:52 -0700 (PDT)
In-Reply-To: <4489f889-977c-45f2-8a2f-186ee3b06bff@isocpp.org>
X-Original-Sender: danielgutson@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=ck3mpdou;       spf=pass
 (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=danielgutson@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:40322
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40322>

--000000000000ae03de0577731b2e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

No, just please don't.

SMC has tons of consequences, from security perspective (check
https://en.wikipedia.org/wiki/W%5EX and also triggering antivirus
heuristics) to performance perspective (breaking every single performance
prediction microproceesor feature).
Additionally, SMC is really hard to debug (check gdb, and --smc-check in
valgrind) and easy to crash (I have too vast experience with this).
I really don't see enough benefits.

El jue., 4 de oct. de 2018 a la(s) 21:35, Matthew Fioravante (
fmatthew5876@gmail.com) escribi=C3=B3:

> One big area where dynamic languages are way ahead of C++ is runtime
> dynamic code generation or self modifying code.
>
>
> One tiny example is singleton initialization. The only safe way in C++ to
> do non-constexpr singletons is by lazy init.
>
> The problem with lazy init is that you have to pay for a branch on every
> access, and that usually involves an atomic check.
>
> What if you instead you atomically overwrote the check with NOPS. Then th=
e
> branch is gone and accessing the object is as efficient as if it weren't
> lazy.
>
> Has anyone considered writing proposals for improving runtime code gen
> with C++?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4489f889-977=
c-45f2-8a2f-186ee3b06bff%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4489f889-97=
7c-45f2-8a2f-186ee3b06bff%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>


--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAFdMc-0gqidWj79ogvg8wdwx28N0N%2Bweecu%2B1dFe5mE=
zyLN9gg%40mail.gmail.com.

--000000000000ae03de0577731b2e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">No, just please don&#39;t.<div><br></div>=
<div>SMC has tons of consequences, from security perspective (check <a href=
=3D"https://en.wikipedia.org/wiki/W%5EX">https://en.wikipedia.org/wiki/W%5E=
X</a> and also triggering antivirus heuristics) to performance perspective =
(breaking every single performance prediction microproceesor feature).</div=
><div>Additionally, SMC is really hard to debug (check gdb, and --smc-check=
 in valgrind) and easy to crash (I have too vast experience with this).</di=
v><div>I really don&#39;t see enough benefits.</div></div></div><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr">El jue., 4 de oct. de 2018 a la(s) 21:=
35, Matthew Fioravante (<a href=3D"mailto:fmatthew5876@gmail.com">fmatthew5=
876@gmail.com</a>) escribi=C3=B3:<br></div><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>One big area where dynamic languages are way ahead of =
C++ is runtime dynamic code generation or self modifying code.<br></div><di=
v><br></div><div><br></div><div>One tiny example is singleton initializatio=
n. The only safe way in C++ to do non-constexpr singletons is by lazy init.=
 <br></div><div><br></div><div>The problem with lazy init is that you have =
to pay for a branch on every access, and that usually involves an atomic ch=
eck.</div><div><br></div><div>What if you instead you atomically overwrote =
the check with NOPS. Then the branch is gone and accessing the object is as=
 efficient as if it weren&#39;t lazy.<br></div><div><br></div><div>Has anyo=
ne considered writing proposals for improving runtime code gen with C++?<br=
></div></div>

<p></p>

-- <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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4489f889-977c-45f2-8a2f-186ee3b06bff%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4489f889-977c-=
45f2-8a2f-186ee3b06bff%40isocpp.org</a>.<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature">Who=E2=80=99s=
 got the sweetest disposition?<br>One guess, that=E2=80=99s who?<br>Who=E2=
=80=99d never, ever start an argument?<br>Who never shows a bit of temperam=
ent?<br>Who&#39;s never wrong but always right?<br>Who&#39;d never dream of=
 starting a fight?<br>Who get stuck with all the bad luck? </div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAFdMc-0gqidWj79ogvg8wdwx28N0N%2Bweec=
u%2B1dFe5mEzyLN9gg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFdMc-0gqidW=
j79ogvg8wdwx28N0N%2Bweecu%2B1dFe5mEzyLN9gg%40mail.gmail.com</a>.<br />

--000000000000ae03de0577731b2e--

.
