Topic: Another Use Case for Continuations? (Was 'Re:


Author: Bryce Glover <randomdsdevel@gmail.com>
Date: Sat, 24 Oct 2015 20:50:27 -0400
Raw View
--Apple-Mail=_D66C4348-2C81-40BE-AB87-8C9DDD406D05
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

> On Oct 24, 2015, at 8:25 PM, Bryce Glover <randomdsdevel@gmail.com> wrote=
:
>=20
>      Whoops, forgot to change my reply=E2=80=99s subject so that it would=
 be recognized as part of the =E2=80=98Register Access in C++=E2=80=99 thre=
ad!  Let=E2=80=99s try that again, shall we? =20
>=20
>> Begin forwarded message:
>>=20
>> From: Bryce Glover <randomdsdevel@gmail.com <mailto:randomdsdevel@gmail.=
com>>
>> Date: October 10, 2015 at 10:13:20 PM EDT
>> To: std-proposals@isocpp.org <mailto:std-proposals@isocpp.org>
>> Subject: Re: [std-proposals] Digest for std-proposals@isocpp.org <mailto=
:std-proposals@isocpp.org> - 20 updates in 5 topics
>>=20
>>> On Oct 9, 2015, at 6:14 PM, std-proposals@isocpp.org <mailto:std-propos=
als@isocpp.org> wrote:
>>>=20
>>> std-proposals@isocpp.org <https://groups.google.com/a/isocpp.org/forum/=
?utm_source=3Ddigest&utm_medium=3Demail#!forum/std-proposals/topics> Google=
 Groups <https://groups.google.com/a/isocpp.org/forum/?utm_source=3Ddigest&=
utm_medium=3Demail/#!overview>  <https://groups.google.com/a/isocpp.org/for=
um/?utm_source=3Ddigest&utm_medium=3Demail/#!overview>          =20
>>> Topic digest=C2=A0 <>
>>> View all topics <https://groups.google.com/a/isocpp.org/forum/?utm_sour=
ce=3Ddigest&utm_medium=3Demail#!forum/std-proposals/topics>
>>> escaped commas in macros <x-msg://9/#group_thread_0> - 6 Updates
>>> A proposal for C++: bit_cast. <x-msg://9/#group_thread_1> - 7 Updates
>>> Register Access for C++ <x-msg://9/#group_thread_2> - 4 Updates
>>> Resumable expressions p0114r0 vs async/await P0057R0 <x-msg://9/#group_=
thread_3> - 2 Updates
>>> "enum union" with set of values restricted to exactly its enumerators? =
<x-msg://9/#group_thread_4> - 1 Update
>> <snip>
>> </snip>
>>>  <>Register Access for C++=C2=A0 =C2=A0 =C2=A0 <http://groups.google.co=
m/a/isocpp.org/group/std-proposals/t/5f3b8a5cbd52e878?utm_source=3Ddigest&u=
tm_medium=3Demail>     =20
>>> Klemens Morgenstern <klemens.morgenstern@gmx.net <mailto:klemens.morgen=
stern@gmx.net>>: Oct 09 07:11AM -0700=20
>>>=20
>>> Hi,
>>> =20
>>> for a lot of microcontroller development direct hardware access is need=
ed.=20
>>> Sadly C++ does not provide a very reliable and easy way to access them,=
 if=20
>>> they are not pure intregral types.
>>> So I've written a small paper to propose this a language feature.
>>> =20
>>> The paper however is far from finished, but I would like some feedback =
on=20
>>> the basic idea of it.
>>> "dgutson ." <danielgutson@gmail.com <mailto:danielgutson@gmail.com>>: O=
ct 09 11:28AM -0300=20
>>>=20
>>> You might want to subscribe to the informal C++ for embedded and real t=
ime
>>> systems mailing list. If interested PM me.
>>> El 9/10/2015 11:11, "Klemens Morgenstern" <klemens.morgenstern@gmx.net =
<mailto:klemens.morgenstern@gmx.net>>
>>> escribi=C3=B3:
>>> =20
>>> David Krauss <potswa@gmail.com <mailto:potswa@gmail.com>>: Oct 10 01:19=
AM +0800=20
>>>=20
>>>=20
>>> > for a lot of microcontroller development direct hardware access is ne=
eded. Sadly C++ does not provide a very reliable and easy way to access the=
m, if they are not pure intregral types.
>>> > So I've written a small paper to propose this a language feature.
>>> =20
>>> > The paper however is far from finished, but I would like some feedbac=
k on the basic idea of it.
>>> =20
>>> Nice to see this attacked. However:
>>> =20
>>> 1. C++ doesn=E2=80=99t need to use macros here, so they=E2=80=99re a re=
d herring. Constexpr variables and inline functions are better, and they=E2=
=80=99re perfectly suitable for hardware interfaces.
>>> =20
>>> 2. register is a storage class specifier. It can already be the leading=
 token in a declaration, so although you might perhaps be avoiding absolute=
 ambiguity, it could be difficult to parse.
>>> =20
>>> 3. =E2=80=9CBasic rules=E2=80=9D are too loose. It should guarantee tha=
t a volatile access generates exactly one read. A core language solution to=
 this problem should have no disadvantages against a library solution.
>>> =20
>>> 4. Endianness doesn=E2=80=99t work quite like the example at the end. A=
lso, registers on peripheral chips don=E2=80=99t have to respect the endian=
ness of the CPU.
>>> =20
>>> 5. Member pointers don=E2=80=99t currently work with bitfields. This wo=
uld be an undertaking.
>>> =20
>>> 6. There=E2=80=99s no proposed way to map register variables to fixed a=
ddresses.
>>> =20
>>> 7. Aren=E2=80=99t registers just a particular case of binary formats? P=
erhaps the proposal should be about portable class layout instead.
>>> Klemens Morgenstern <klemens.morgenstern@gmx.net <mailto:klemens.morgen=
stern@gmx.net>>: Oct 09 10:52AM -0700=20
>>>=20
>>> Thanks for the feedback.Well yes, in C++ you can do this with constexpr=
=20
>>> value, but I've never seen this is in any embedded code. But yes, I nee=
d to=20
>>> add this.
>>> =20
>>> 2. I don't know of any case where register is actually used and I think=
 the=20
>>> proposed syntax is quite unique. Worked for auto, so I think that's=20
>>> alright. But you are right for one case; this
>>> register struct{}x;
>>> would be ambigious. I'll change that to=20
>>> struct register{};
>>> =20
>>> 3. Good point, I didn't think of that.
>>> =20
>>> 4. Well I thought about fixing the endianess, because of that reason.=
=20
>>> However: you have a guarantee, that the bit arrangement in the register=
=20
>>> fits the integer, hence you can handle it when exchanging data between=
=20
>>> devices with different platforms as integer, by just correcting the int=
eger=20
>>> layout and then casting it to a register again. I thought about an inve=
rt=20
>>> operator or a lsb/msb declaration, but I did not come up with any good =
idea=20
>>> to solve this without bloating the code. Do you have any?
>>> =20
>>> 5. Yes, I honestly don't see the point in these, however, I don't see t=
he=20
>>> point of member-pointers in general. So it's more too make it complete.=
 But=20
>>> the logic of it is quite easy.
>>> =20
>>> 6. That is on purpose, because this can be done in different ways. One =
is=20
>>> to just declare a pointer with a fixed value. The other is to provide=
=20
>>> hardware-access via linkerscript. So I don't think we should have a=20
>>> standard to do this.
>>> =20
>>> 7. Well yes they are, but I think they need a real solution. You can tw=
eak=20
>>> bitfields to do just that with compiler extensions and I've seen that d=
one.=20
>>> So a standard-solution would be utterly nice. I think the portable clas=
s=20
>>> layout is given by the register struct, that is portably POD-Layouts.
>>> Back to top <x-msg://9/#digest_top><snip>
>> </snip>
>>>=20
>>> You received this digest because you're subscribed to updates for this =
group. You can change your settings on the group membership page <https://g=
roups.google.com/a/isocpp.org/forum/?utm_source=3Ddigest&utm_medium=3Demail=
#!forum/std-proposals/join>.
>>> To unsubscribe from this group and stop receiving emails from it send a=
n email to std-proposals+unsubscribe@isocpp.org <mailto:std-proposals+unsub=
scribe@isocpp.org>.
>>=20
>> Just off-hand, I was, believe it or not, coincidentally thinking about t=
his exact topic a while back when I was looking into whether or not adding =
some functionality that is missing from Objective-C++ due to differences be=
tween the object models used by Objective-C and C++ by refactoring Objectiv=
e-C++=E2=80=99s functionality to be a pure superset of that of C++ would be=
 a feasible future project for somebody, maybe me, to undertake. =20
>>=20
>> Bryce Glover
>> RandomDSdevel@gmail.com <mailto:RandomDSdevel@gmail.com>
> I have, however, realized that something along the lines of the incoming =
`std::execution_context`, `std::context`, or `std::coroutine` might be a be=
tter solution for my particular use case since posting the above reply. =20
>=20
> Apologies,=20
>      Bryce Glover
>      RandomDSdevel@gmail.com <mailto:RandomDSdevel@gmail.com>

     On that note, have you coroutine guys taken notice that an optimized d=
ynamic-dispatch trampoline akin to Objective-C=E2=80=99s `objc_msgSend()` f=
unction might be another possible use case for execution contexts, continua=
tions, and/or coroutines? =20

Curious,=20
     Bryce Glover
     RandomDSdevel@gmail.com

--=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=_D66C4348-2C81-40BE-AB87-8C9DDD406D05
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=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><div><blockquote t=
ype=3D"cite" class=3D""><div class=3D"">On Oct 24, 2015, at 8:25 PM, Bryce =
Glover &lt;<a href=3D"mailto:randomdsdevel@gmail.com" class=3D"">randomdsde=
vel@gmail.com</a>&gt; wrote:</div><br class=3D"Apple-interchange-newline"><=
div class=3D""><meta http-equiv=3D"Content-Type" content=3D"text/html chars=
et=3Dutf-8" class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mo=
de: space; -webkit-line-break: after-white-space;" class=3D"">&nbsp; &nbsp;=
 &nbsp;Whoops, forgot to change my reply=E2=80=99s subject so that it would=
 be recognized as part of the =E2=80=98Register Access in C++=E2=80=99 thre=
ad! &nbsp;Let=E2=80=99s try that again, shall we? &nbsp;<br class=3D""><div=
 class=3D""><br class=3D""><blockquote type=3D"cite" class=3D""><div class=
=3D"">Begin forwarded message:</div><br class=3D"Apple-interchange-newline"=
><div style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; marg=
in-left: 0px;" class=3D""><span style=3D"font-family: -webkit-system-font, =
'Helvetica Neue', Helvetica, sans-serif;" class=3D""><b class=3D"">From: </=
b></span><span style=3D"font-family: -webkit-system-font, Helvetica Neue, H=
elvetica, sans-serif;" class=3D"">Bryce Glover &lt;<a href=3D"mailto:random=
dsdevel@gmail.com" class=3D"">randomdsdevel@gmail.com</a>&gt;<br class=3D""=
></span></div><div style=3D"margin-top: 0px; margin-right: 0px; margin-bott=
om: 0px; margin-left: 0px;" class=3D""><span style=3D"font-family: -webkit-=
system-font, 'Helvetica Neue', Helvetica, sans-serif;" class=3D""><b class=
=3D"">Date: </b></span><span style=3D"font-family: -webkit-system-font, Hel=
vetica Neue, Helvetica, sans-serif;" class=3D"">October 10, 2015 at 10:13:2=
0 PM EDT<br class=3D""></span></div><div style=3D"margin-top: 0px; margin-r=
ight: 0px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span style=3D=
"font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;=
" class=3D""><b class=3D"">To: </b></span><span style=3D"font-family: -webk=
it-system-font, Helvetica Neue, Helvetica, sans-serif;" class=3D""><a href=
=3D"mailto:std-proposals@isocpp.org" class=3D"">std-proposals@isocpp.org</a=
><br class=3D""></span></div><div style=3D"margin-top: 0px; margin-right: 0=
px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span style=3D"font-f=
amily: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;" class=
=3D""><b class=3D"">Subject: </b></span><span style=3D"font-family: -webkit=
-system-font, Helvetica Neue, Helvetica, sans-serif;" class=3D""><b class=
=3D"">Re: [std-proposals] Digest for <a href=3D"mailto:std-proposals@isocpp=
..org" class=3D"">std-proposals@isocpp.org</a> - 20 updates in 5 topics</b><=
br class=3D""></span></div><br class=3D""><div class=3D""><div style=3D"fon=
t-family: Helvetica; font-size: 14px; font-style: normal; font-variant: nor=
mal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align=
: start; text-indent: 0px; text-transform: none; white-space: normal; widow=
s: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><bl=
ockquote type=3D"cite" class=3D""><div class=3D"">On Oct 9, 2015, at 6:14 P=
M,<span class=3D"Apple-converted-space">&nbsp;</span><a href=3D"mailto:std-=
proposals@isocpp.org" class=3D"">std-proposals@isocpp.org</a><span class=3D=
"Apple-converted-space">&nbsp;</span>wrote:</div><br class=3D"Apple-interch=
ange-newline"><div class=3D""><div class=3D"" style=3D"border: 1px solid rg=
b(211, 211, 211); max-width: 850px; font-family: Arial, sans-serif;"><div c=
lass=3D"" style=3D"background-color: rgb(245, 245, 245); padding: 10px 20px=
;"><table cellpadding=3D"0" cellspacing=3D"0" class=3D"" style=3D"width: 77=
8px;"><tbody class=3D""><tr class=3D""><td class=3D"" style=3D"width: 522px=
;"><span class=3D"" style=3D"font-style: normal; font-variant: normal; font=
-weight: normal; font-size: 18px; line-height: 20px; font-family: arial; co=
lor: rgb(51, 51, 51);"><a href=3D"https://groups.google.com/a/isocpp.org/fo=
rum/?utm_source=3Ddigest&amp;utm_medium=3Demail#!forum/std-proposals/topics=
" class=3D"" style=3D"text-decoration: none; color: rgb(51, 51, 51);">std-p=
roposals@isocpp.org</a></span></td><td class=3D"" style=3D"text-align: righ=
t; width: 224px;"><span class=3D"" style=3D"font-style: normal; font-varian=
t: normal; font-weight: normal; font-size: 20px; line-height: 24px; font-fa=
mily: arial;"><a href=3D"https://groups.google.com/a/isocpp.org/forum/?utm_=
source=3Ddigest&amp;utm_medium=3Demail/#!overview" target=3D"_blank" class=
=3D"" style=3D"color: rgb(221, 75, 57); text-decoration: none;">Google Grou=
ps</a></span></td><td class=3D"" style=3D"width: 32px;"><a href=3D"https://=
groups.google.com/a/isocpp.org/forum/?utm_source=3Ddigest&amp;utm_medium=3D=
email/#!overview" target=3D"_blank" class=3D""><img src=3D"http://www.googl=
e.com/images/icons/product/groups-32.png" class=3D"" style=3D"border: 0px; =
vertical-align: middle;"></a><span class=3D"Apple-converted-space">&nbsp;</=
span> <span class=3D"Apple-converted-space">&nbsp;</span> <span class=3D"Ap=
ple-converted-space">&nbsp;</span><span class=3D"Apple-converted-space">&nb=
sp;</span> <span class=3D"Apple-converted-space">&nbsp;</span><span class=
=3D"Apple-converted-space">&nbsp;</span> <span class=3D"Apple-converted-spa=
ce">&nbsp;</span></td></tr></tbody></table></div><div class=3D"" style=3D"p=
adding: 20px; background-color: rgb(245, 245, 245);"><div class=3D"" style=
=3D"font-family: arial; color: rgb(34, 34, 34); padding: 0px;"><a name=3D"d=
igest_top" class=3D"" style=3D"font-size: 21px;">Topic digest<span class=3D=
"Apple-converted-space">&nbsp;</span></a><br class=3D""><span class=3D"" st=
yle=3D"font-size: 11px;"><a href=3D"https://groups.google.com/a/isocpp.org/=
forum/?utm_source=3Ddigest&amp;utm_medium=3Demail#!forum/std-proposals/topi=
cs" class=3D"" style=3D"color: rgb(17, 85, 204); text-decoration: none;">Vi=
ew all topics</a></span></div><div class=3D"" style=3D"font-style: normal; =
font-variant: normal; font-weight: normal; font-size: 13px; line-height: 18=
px; font-family: arial; color: rgb(34, 34, 34); padding: 0px; margin-bottom=
: 30px;"><ul class=3D"" style=3D"margin-left: 3px; padding-left: 0px;"><li =
class=3D""><a href=3D"x-msg://9/#group_thread_0" class=3D"" style=3D"color:=
 rgb(17, 85, 204); text-decoration: none;">escaped commas in macros</a><spa=
n class=3D"Apple-converted-space">&nbsp;</span>-<span class=3D"Apple-conver=
ted-space">&nbsp;</span><span class=3D"" style=3D"color: rgb(119, 119, 119)=
;">6 Updates</span></li><li class=3D""><a href=3D"x-msg://9/#group_thread_1=
" class=3D"" style=3D"color: rgb(17, 85, 204); text-decoration: none;">A pr=
oposal for C++: bit_cast.</a><span class=3D"Apple-converted-space">&nbsp;</=
span>-<span class=3D"Apple-converted-space">&nbsp;</span><span class=3D"" s=
tyle=3D"color: rgb(119, 119, 119);">7 Updates</span></li><li class=3D""><a =
href=3D"x-msg://9/#group_thread_2" class=3D"" style=3D"color: rgb(17, 85, 2=
04); text-decoration: none;">Register Access for C++</a><span class=3D"Appl=
e-converted-space">&nbsp;</span>-<span class=3D"Apple-converted-space">&nbs=
p;</span><span class=3D"" style=3D"color: rgb(119, 119, 119);">4 Updates</s=
pan></li><li class=3D""><a href=3D"x-msg://9/#group_thread_3" class=3D"" st=
yle=3D"color: rgb(17, 85, 204); text-decoration: none;">Resumable expressio=
ns p0114r0 vs async/await P0057R0</a><span class=3D"Apple-converted-space">=
&nbsp;</span>-<span class=3D"Apple-converted-space">&nbsp;</span><span clas=
s=3D"" style=3D"color: rgb(119, 119, 119);">2 Updates</span></li><li class=
=3D""><a href=3D"x-msg://9/#group_thread_4" class=3D"" style=3D"color: rgb(=
17, 85, 204); text-decoration: none;">"enum union" with set of values restr=
icted to exactly its enumerators?</a><span class=3D"Apple-converted-space">=
&nbsp;</span>-<span class=3D"Apple-converted-space">&nbsp;</span><span clas=
s=3D"" style=3D"color: rgb(119, 119, 119);">1 Update</span></li></ul></div>=
</div></div></div></blockquote>&lt;snip&gt;</div><div style=3D"font-family:=
 Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font=
-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"">&lt;/snip&gt=
;<br class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"" style=
=3D"border: 1px solid rgb(211, 211, 211); max-width: 850px; font-family: Ar=
ial, sans-serif;"><div class=3D"" style=3D"padding: 20px; background-color:=
 rgb(245, 245, 245);"><div class=3D"" style=3D"font-style: normal; font-var=
iant: normal; font-weight: normal; font-size: 13px; line-height: 18px; font=
-family: arial; color: rgb(34, 34, 34); padding: 0px; margin-bottom: 30px;"=
><ul class=3D"" style=3D"margin-left: 3px; padding-left: 0px;"></ul></div><=
a name=3D"group_thread_0" class=3D""></a><div class=3D"" style=3D"display: =
inline-block; font-family: arial; padding: 4px 0px 5px;"><a target=3D"_blan=
k" href=3D"http://groups.google.com/a/isocpp.org/group/std-proposals/t/5f3b=
8a5cbd52e878?utm_source=3Ddigest&amp;utm_medium=3Demail" class=3D"" style=
=3D"font-size: 21px; color: rgb(17, 85, 204); text-decoration: none;">Regis=
ter Access for C++<span class=3D"Apple-converted-space">&nbsp;</span> <span=
 class=3D"Apple-converted-space">&nbsp;</span> <span class=3D"Apple-convert=
ed-space">&nbsp;</span></a><span class=3D"Apple-converted-space">&nbsp;</sp=
an> <span class=3D"Apple-converted-space">&nbsp;</span><span class=3D"Apple=
-converted-space">&nbsp;</span> <span class=3D"Apple-converted-space">&nbsp=
;</span></div><table class=3D"" style=3D"border-collapse: collapse; width: =
777px;"><tbody class=3D""><tr class=3D""><td class=3D"" style=3D"background=
-color: rgb(255, 255, 255); color: rgb(46, 46, 46); font-family: arial; pad=
ding: 10px 15px; border: 1px solid rgb(211, 211, 211);"><span class=3D"" st=
yle=3D"color: rgb(177, 176, 176); font-size: 15px;">Klemens Morgenstern &lt=
;<a href=3D"mailto:klemens.morgenstern@gmx.net" class=3D"">klemens.morgenst=
ern@gmx.net</a>&gt;: Oct 09 07:11AM -0700<span class=3D"Apple-converted-spa=
ce">&nbsp;</span></span><br class=3D""><br class=3D"">Hi,<br class=3D"">&nb=
sp;<br class=3D"">for a lot of microcontroller development direct hardware =
access is needed.<span class=3D"Apple-converted-space">&nbsp;</span><br cla=
ss=3D"">Sadly C++ does not provide a very reliable and easy way to access t=
hem, if<span class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">th=
ey are not pure intregral types.<br class=3D"">So I've written a small pape=
r to propose this a language feature.<br class=3D"">&nbsp;<br class=3D"">Th=
e paper however is far from finished, but I would like some feedback on<spa=
n class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">the basic ide=
a of it.<br class=3D""></td></tr><tr class=3D""><td class=3D"" style=3D"bac=
kground-color: rgb(255, 255, 255); color: rgb(46, 46, 46); font-family: ari=
al; padding: 10px 15px; border: 1px solid rgb(211, 211, 211);"><span class=
=3D"" style=3D"color: rgb(177, 176, 176); font-size: 15px;">"dgutson ." &lt=
;<a href=3D"mailto:danielgutson@gmail.com" class=3D"">danielgutson@gmail.co=
m</a>&gt;: Oct 09 11:28AM -0300<span class=3D"Apple-converted-space">&nbsp;=
</span></span><br class=3D""><br class=3D"">You might want to subscribe to =
the informal C++ for embedded and real time<br class=3D"">systems mailing l=
ist. If interested PM me.<br class=3D"">El 9/10/2015 11:11, "Klemens Morgen=
stern" &lt;<a href=3D"mailto:klemens.morgenstern@gmx.net" class=3D"">klemen=
s.morgenstern@gmx.net</a>&gt;<br class=3D"">escribi=C3=B3:<br class=3D"">&n=
bsp;<br class=3D""></td></tr><tr class=3D""><td class=3D"" style=3D"backgro=
und-color: rgb(255, 255, 255); color: rgb(46, 46, 46); font-family: arial; =
padding: 10px 15px; border: 1px solid rgb(211, 211, 211);"><span class=3D""=
 style=3D"color: rgb(177, 176, 176); font-size: 15px;">David Krauss &lt;<a =
href=3D"mailto:potswa@gmail.com" class=3D"">potswa@gmail.com</a>&gt;: Oct 1=
0 01:19AM +0800<span class=3D"Apple-converted-space">&nbsp;</span></span><b=
r class=3D""><br class=3D""><br class=3D"">&gt; for a lot of microcontrolle=
r development direct hardware access is needed. Sadly C++ does not provide =
a very reliable and easy way to access them, if they are not pure intregral=
 types.<br class=3D"">&gt; So I've written a small paper to propose this a =
language feature.<br class=3D"">&nbsp;<br class=3D"">&gt; The paper however=
 is far from finished, but I would like some feedback on the basic idea of =
it.<br class=3D"">&nbsp;<br class=3D"">Nice to see this attacked. However:<=
br class=3D"">&nbsp;<br class=3D"">1. C++ doesn=E2=80=99t need to use macro=
s here, so they=E2=80=99re a red herring. Constexpr variables and inline fu=
nctions are better, and they=E2=80=99re perfectly suitable for hardware int=
erfaces.<br class=3D"">&nbsp;<br class=3D"">2. register is a storage class =
specifier. It can already be the leading token in a declaration, so althoug=
h you might perhaps be avoiding absolute ambiguity, it could be difficult t=
o parse.<br class=3D"">&nbsp;<br class=3D"">3. =E2=80=9CBasic rules=E2=80=
=9D are too loose. It should guarantee that a volatile access generates exa=
ctly one read. A core language solution to this problem should have no disa=
dvantages against a library solution.<br class=3D"">&nbsp;<br class=3D"">4.=
 Endianness doesn=E2=80=99t work quite like the example at the end. Also, r=
egisters on peripheral chips don=E2=80=99t have to respect the endianness o=
f the CPU.<br class=3D"">&nbsp;<br class=3D"">5. Member pointers don=E2=80=
=99t currently work with bitfields. This would be an undertaking.<br class=
=3D"">&nbsp;<br class=3D"">6. There=E2=80=99s no proposed way to map regist=
er variables to fixed addresses.<br class=3D"">&nbsp;<br class=3D"">7. Aren=
=E2=80=99t registers just a particular case of binary formats? Perhaps the =
proposal should be about portable class layout instead.<br class=3D""></td>=
</tr><tr class=3D""><td class=3D"" style=3D"background-color: rgb(255, 255,=
 255); color: rgb(46, 46, 46); font-family: arial; padding: 10px 15px; bord=
er: 1px solid rgb(211, 211, 211);"><span class=3D"" style=3D"color: rgb(177=
, 176, 176); font-size: 15px;">Klemens Morgenstern &lt;<a href=3D"mailto:kl=
emens.morgenstern@gmx.net" class=3D"">klemens.morgenstern@gmx.net</a>&gt;: =
Oct 09 10:52AM -0700<span class=3D"Apple-converted-space">&nbsp;</span></sp=
an><br class=3D""><br class=3D"">Thanks for the feedback.Well yes, in C++ y=
ou can do this with constexpr<span class=3D"Apple-converted-space">&nbsp;</=
span><br class=3D"">value, but I've never seen this is in any embedded code=
.. But yes, I need to<span class=3D"Apple-converted-space">&nbsp;</span><br =
class=3D"">add this.<br class=3D"">&nbsp;<br class=3D"">2. I don't know of =
any case where register is actually used and I think the<span class=3D"Appl=
e-converted-space">&nbsp;</span><br class=3D"">proposed syntax is quite uni=
que. Worked for auto, so I think that's<span class=3D"Apple-converted-space=
">&nbsp;</span><br class=3D"">alright. But you are right for one case; this=
<br class=3D"">register struct{}x;<br class=3D"">would be ambigious. I'll c=
hange that to<span class=3D"Apple-converted-space">&nbsp;</span><br class=
=3D"">struct register{};<br class=3D"">&nbsp;<br class=3D"">3. Good point, =
I didn't think of that.<br class=3D"">&nbsp;<br class=3D"">4. Well I though=
t about fixing the endianess, because of that reason.<span class=3D"Apple-c=
onverted-space">&nbsp;</span><br class=3D"">However: you have a guarantee, =
that the bit arrangement in the register<span class=3D"Apple-converted-spac=
e">&nbsp;</span><br class=3D"">fits the integer, hence you can handle it wh=
en exchanging data between<span class=3D"Apple-converted-space">&nbsp;</spa=
n><br class=3D"">devices with different platforms as integer, by just corre=
cting the integer<span class=3D"Apple-converted-space">&nbsp;</span><br cla=
ss=3D"">layout and then casting it to a register again. I thought about an =
invert<span class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">ope=
rator or a lsb/msb declaration, but I did not come up with any good idea<sp=
an class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">to solve thi=
s without bloating the code. Do you have any?<br class=3D"">&nbsp;<br class=
=3D"">5. Yes, I honestly don't see the point in these, however, I don't see=
 the<span class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">point=
 of member-pointers in general. So it's more too make it complete. But<span=
 class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">the logic of i=
t is quite easy.<br class=3D"">&nbsp;<br class=3D"">6. That is on purpose, =
because this can be done in different ways. One is<span class=3D"Apple-conv=
erted-space">&nbsp;</span><br class=3D"">to just declare a pointer with a f=
ixed value. The other is to provide<span class=3D"Apple-converted-space">&n=
bsp;</span><br class=3D"">hardware-access via linkerscript. So I don't thin=
k we should have a<span class=3D"Apple-converted-space">&nbsp;</span><br cl=
ass=3D"">standard to do this.<br class=3D"">&nbsp;<br class=3D"">7. Well ye=
s they are, but I think they need a real solution. You can tweak<span class=
=3D"Apple-converted-space">&nbsp;</span><br class=3D"">bitfields to do just=
 that with compiler extensions and I've seen that done.<span class=3D"Apple=
-converted-space">&nbsp;</span><br class=3D"">So a standard-solution would =
be utterly nice. I think the portable class<span class=3D"Apple-converted-s=
pace">&nbsp;</span><br class=3D"">layout is given by the register struct, t=
hat is portably POD-Layouts.<br class=3D""></td></tr></tbody></table><div c=
lass=3D"" style=3D"font-size: 11px; margin-bottom: 40px; margin-top: 5px;">=
<a href=3D"x-msg://9/#digest_top" class=3D"" style=3D"color: rgb(17, 85, 20=
4); text-decoration: none;">Back to top</a></div></div></div></blockquote>&=
lt;snip&gt;</div><div style=3D"font-family: Helvetica; font-size: 14px; fon=
t-style: normal; font-variant: normal; font-weight: normal; letter-spacing:=
 normal; orphans: auto; text-align: start; text-indent: 0px; text-transform=
: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-=
stroke-width: 0px;" class=3D"">&lt;/snip&gt;<br class=3D""><blockquote type=
=3D"cite" class=3D""><div class=3D"" style=3D"border: 1px solid rgb(211, 21=
1, 211); max-width: 850px; font-family: Arial, sans-serif;"><div class=3D""=
 style=3D"background-color: rgb(245, 245, 245); padding: 5px 20px;"><table =
cellpadding=3D"0" cellspacing=3D"0" class=3D"" style=3D"width: 778px;"><tbo=
dy class=3D""><tr class=3D""><td class=3D"" style=3D"padding-top: 4px; font=
-family: arial, sans-serif; color: rgb(99, 99, 99); font-size: 11px;">You r=
eceived this digest because you're subscribed to updates for this group. Yo=
u can change your settings on the<span class=3D"Apple-converted-space">&nbs=
p;</span><a href=3D"https://groups.google.com/a/isocpp.org/forum/?utm_sourc=
e=3Ddigest&amp;utm_medium=3Demail#!forum/std-proposals/join" class=3D"" sty=
le=3D"color: rgb(17, 85, 204); text-decoration: none;">group membership pag=
e</a>.<br class=3D"">To unsubscribe from this group and stop receiving emai=
ls from it send an email to<span class=3D"Apple-converted-space">&nbsp;</sp=
an><a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" class=3D"">std-p=
roposals+unsubscribe@isocpp.org</a>.</td></tr></tbody></table></div></div><=
/blockquote></div><br class=3D"" style=3D"font-family: Helvetica; font-size=
: 14px; font-style: normal; font-variant: normal; font-weight: normal; lett=
er-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; tex=
t-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -w=
ebkit-text-stroke-width: 0px;"><div apple-content-edited=3D"true" class=3D"=
" style=3D"font-family: Helvetica; font-size: 14px; font-style: normal; fon=
t-variant: normal; font-weight: normal; letter-spacing: normal; orphans: au=
to; text-align: start; text-indent: 0px; text-transform: none; white-space:=
 normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">=
<div class=3D"" style=3D"letter-spacing: normal; orphans: auto; text-align:=
 start; text-indent: 0px; text-transform: none; white-space: normal; widows=
: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break=
-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><d=
iv class=3D"" style=3D"letter-spacing: normal; orphans: auto; text-align: s=
tart; text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-w=
ord; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div=
 class=3D"" style=3D"letter-spacing: normal; orphans: auto; text-align: sta=
rt; text-indent: 0px; text-transform: none; white-space: normal; widows: au=
to; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-wor=
d; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Just o=
ff-hand, I was, believe it or not, coincidentally thinking about this<span =
class=3D"Apple-converted-space">&nbsp;</span><i class=3D"">exact</i>&nbsp;t=
opic a while back when I was looking into whether or not adding some functi=
onality that is missing from Objective-C++ due to differences between the o=
bject models used by Objective-C and C++ by refactoring Objective-C++=E2=80=
=99s functionality to be a pure superset of that of C++ would be a feasible=
 future project for somebody, maybe me, to undertake. &nbsp;</div></div></d=
iv></div><br class=3D"" style=3D"font-family: Helvetica; font-size: 14px; f=
ont-style: normal; font-variant: normal; font-weight: normal; letter-spacin=
g: normal; orphans: auto; text-align: start; text-indent: 0px; text-transfo=
rm: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tex=
t-stroke-width: 0px;"><div apple-content-edited=3D"true" class=3D"" style=
=3D"font-family: Helvetica; font-size: 14px; font-style: normal; font-varia=
nt: normal; font-weight: normal; letter-spacing: normal; orphans: auto; tex=
t-align: start; text-indent: 0px; text-transform: none; white-space: normal=
; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div cl=
ass=3D"" style=3D"letter-spacing: normal; orphans: auto; text-align: start;=
 text-indent: 0px; text-transform: none; white-space: normal; widows: auto;=
 word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div clas=
s=3D"">Bryce Glover</div><div class=3D""><a href=3D"mailto:RandomDSdevel@gm=
ail.com" class=3D"">RandomDSdevel@gmail.com</a></div></div></div></div></bl=
ockquote></div><br class=3D""><div class=3D"">I have, however, realized tha=
t something along the lines of the incoming `std::execution_context`, `std:=
:context`, or `std::coroutine` might be a better solution for my particular=
 use case since posting the above reply. &nbsp;</div><div class=3D""><br cl=
ass=3D"webkit-block-placeholder"></div><div apple-content-edited=3D"true" c=
lass=3D"">
<div style=3D"letter-spacing: normal; orphans: auto; text-align: start; tex=
t-indent: 0px; text-transform: none; white-space: normal; widows: auto; wor=
d-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -web=
kit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=3D""><d=
iv style=3D"letter-spacing: normal; orphans: auto; text-align: start; text-=
indent: 0px; text-transform: none; white-space: normal; widows: auto; word-=
spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webki=
t-nbsp-mode: space; -webkit-line-break: after-white-space;" class=3D""><div=
 style=3D"letter-spacing: normal; orphans: auto; text-align: start; text-in=
dent: 0px; text-transform: none; white-space: normal; widows: auto; word-sp=
acing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-=
nbsp-mode: space; -webkit-line-break: after-white-space;" class=3D""><div c=
lass=3D"">Apologies,&nbsp;</div><div class=3D"">&nbsp; &nbsp; &nbsp;Bryce G=
lover</div><div class=3D"">&nbsp; &nbsp; &nbsp;<a href=3D"mailto:RandomDSde=
vel@gmail.com" class=3D"">RandomDSdevel@gmail.com</a></div></div></div></di=
v>
</div>
<br class=3D""></div></div></blockquote></div><br class=3D""><div class=3D"=
">&nbsp; &nbsp; &nbsp;On that note, have you coroutine guys taken notice th=
at an optimized dynamic-dispatch trampoline akin to Objective-C=E2=80=99s `=
objc_msgSend()` function might be another possible use case for execution c=
ontexts, continuations, and/or coroutines? &nbsp;</div><div class=3D""><br =
class=3D"webkit-block-placeholder"></div><div apple-content-edited=3D"true"=
 class=3D"">
<div style=3D"color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; t=
ext-align: start; text-indent: 0px; text-transform: none; white-space: norm=
al; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-w=
rap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-=
space;" class=3D""><div style=3D"color: rgb(0, 0, 0); letter-spacing: norma=
l; orphans: auto; text-align: start; text-indent: 0px; text-transform: none=
; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke=
-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-=
break: after-white-space;" class=3D""><div style=3D"color: rgb(0, 0, 0); le=
tter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; t=
ext-transform: none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><div class=3D"">Cu=
rious,&nbsp;</div><div class=3D"">&nbsp; &nbsp; &nbsp;Bryce Glover</div><di=
v class=3D"">&nbsp; &nbsp; &nbsp;<a href=3D"mailto:RandomDSdevel@gmail.com"=
 class=3D"">RandomDSdevel@gmail.com</a></div></div></div></div>
</div>
<br class=3D""></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=_D66C4348-2C81-40BE-AB87-8C9DDD406D05--

.


Author: Klemens Morgenstern <klemens.morgenstern@gmx.net>
Date: Sun, 25 Oct 2015 02:50:25 -0700 (PDT)
Raw View
------=_Part_163_218428125.1445766626078
Content-Type: multipart/alternative;
 boundary="----=_Part_164_1372253363.1445766626078"

------=_Part_164_1372253363.1445766626078
Content-Type: text/plain; charset=UTF-8

Setting the topic right doesn't seem to have worked. Could you maybe tell
me which part of Objective-C++ you think about, because I have no clue of
this language what so ever.

--

---
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_164_1372253363.1445766626078
Content-Type: text/html; charset=UTF-8

<div dir="ltr">Setting the topic right doesn&#39;t seem to have worked. Could you maybe tell me which part of Objective-C++ you think about, because I have no clue of this language what so ever.</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_164_1372253363.1445766626078--
------=_Part_163_218428125.1445766626078--

.