Topic: Digest for std-proposals@isocpp.org - 20 updates
Author: Bryce Glover <randomdsdevel@gmail.com>
Date: Sat, 10 Oct 2015 22:13:20 -0400
Raw View
--Apple-Mail=_BAC8ED54-3F21-452F-B77D-2BF133FAC116
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
> On Oct 9, 2015, at 6:14 PM, std-proposals@isocpp.org wrote:
>=20
> std-proposals@isocpp.org <https://groups.google.com/a/isocpp.org/forum/?u=
tm_source=3Ddigest&utm_medium=3Demail#!forum/std-proposals/topics> Google G=
roups <https://groups.google.com/a/isocpp.org/forum/?utm_source=3Ddigest&ut=
m_medium=3Demail/#!overview> <https://groups.google.com/a/isocpp.org/forum=
/?utm_source=3Ddigest&utm_medium=3Demail/#!overview> =20
> Topic digest <>
> View all topics <https://groups.google.com/a/isocpp.org/forum/?utm_source=
=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_th=
read_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++ <http://groups.google.com/a/isocpp.org/gr=
oup/std-proposals/t/5f3b8a5cbd52e878?utm_source=3Ddigest&utm_medium=3Demail=
> =20
> Klemens Morgenstern <klemens.morgenstern@gmx.net>: Oct 09 07:11AM -0700=
=20
>=20
> Hi,
> =20
> for a lot of microcontroller development direct hardware access is needed=
..=20
> Sadly C++ does not provide a very reliable and easy way to access them, i=
f=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>: Oct 09 11:28AM -0300=20
>=20
> You might want to subscribe to the informal C++ for embedded and real tim=
e
> systems mailing list. If interested PM me.
> El 9/10/2015 11:11, "Klemens Morgenstern" <klemens.morgenstern@gmx.net>
> escribi=C3=B3:
> =20
> David Krauss <potswa@gmail.com>: Oct 10 01:19AM +0800=20
>=20
>=20
> > for a lot of microcontroller development direct hardware access is need=
ed. Sadly C++ does not provide a very reliable and easy way to access them,=
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 feedback =
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 red =
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 t=
oken in a declaration, so although you might perhaps be avoiding absolute a=
mbiguity, it could be difficult to parse.
> =20
> 3. =E2=80=9CBasic rules=E2=80=9D are too loose. It should guarantee that =
a volatile access generates exactly one read. A core language solution to t=
his problem should have no disadvantages against a library solution.
> =20
> 4. Endianness doesn=E2=80=99t work quite like the example at the end. Als=
o, registers on peripheral chips don=E2=80=99t have to respect the endianne=
ss of the CPU.
> =20
> 5. Member pointers don=E2=80=99t currently work with bitfields. This woul=
d be an undertaking.
> =20
> 6. There=E2=80=99s no proposed way to map register variables to fixed add=
resses.
> =20
> 7. Aren=E2=80=99t registers just a particular case of binary formats? Per=
haps the proposal should be about portable class layout instead.
> Klemens Morgenstern <klemens.morgenstern@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 need =
to=20
> add this.
> =20
> 2. I don't know of any case where register is actually used and I think t=
he=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 integ=
er=20
> layout and then casting it to a register again. I thought about an invert=
=20
> operator or a lsb/msb declaration, but I did not come up with any good id=
ea=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 the=
=20
> point of member-pointers in general. So it's more too make it complete. B=
ut=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 twea=
k=20
> bitfields to do just that with compiler extensions and I've seen that don=
e.=20
> So a standard-solution would be utterly nice. I think the portable class=
=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 gr=
oup. You can change your settings on the group membership page <https://gro=
ups.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 an =
email to std-proposals+unsubscribe@isocpp.org <mailto:std-proposals+unsubsc=
ribe@isocpp.org>.
Just off-hand, I was, believe it or not, coincidentally thinking about this=
exact topic a while back when I was looking into whether or not adding som=
e functionality that is missing from Objective-C++ due to differences betwe=
en the object 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. =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=_BAC8ED54-3F21-452F-B77D-2BF133FAC116
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 9, 2015, at 6:14 PM, <a href=
=3D"mailto:std-proposals@isocpp.org" class=3D"">std-proposals@isocpp.org</a=
> wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D"">
<div style=3D"border: 1px solid rgb(211, 211, 211); max-width: 850px; font-=
family: Arial, sans-serif;" class=3D"">
<div style=3D"background-color:#f5f5f5;padding:10px 20px" class=3D"">
<table cellpadding=3D"0" cellspacing=3D"0" style=3D"width:100%" class=
=3D"">
<tbody class=3D"">
<tr class=3D"">
<td style=3D"width:70%" class=3D"">
<span style=3D"font:18px/20px arial;color:#333333" class=3D"">
<a href=3D"https://groups.google.com/a/isocpp.org/forum/?utm_=
source=3Ddigest&utm_medium=3Demail#!forum/std-proposals/topics" style=
=3D"text-decoration:none; color:#333333" class=3D"">
std-proposals@isocpp.org</a>
</span>
</td>
<td style=3D"text-align:right;width:30%" class=3D"">
<span style=3D"font:20px/24px arial" class=3D""><a style=3D"col=
or:#dd4b39; text-decoration:none;" href=3D"https://groups.google.com/a/isoc=
pp.org/forum/?utm_source=3Ddigest&utm_medium=3Demail/#!overview" target=
=3D"_blank" class=3D"">Google Groups</a></span>
</td>
<td style=3D"width:32px;" class=3D"">
<a href=3D"https://groups.google.com/a/isocpp.org/forum/?utm_so=
urce=3Ddigest&utm_medium=3Demail/#!overview" target=3D"_blank" class=3D=
""><img style=3D"border:0;vertical-align:middle" src=3D"http://www.google.c=
om/images/icons/product/groups-32.png" class=3D""></a>
</td>
</tr>
</tbody>
</table>
</div>
<div style=3D"padding:20px; background-color: #f5f5f5;" class=3D"">
<div style=3D"font-family: arial; color: #222222; padding: 0px" class=3D"">
<a name=3D"digest_top" style=3D"font-size:21px;" class=3D"">
=20
=20
Topic digest
=20
</a><br class=3D"">
<span style=3D"font-size:11px" class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"https://groups.=
google.com/a/isocpp.org/forum/?utm_source=3Ddigest&utm_medium=3Demail#!=
forum/std-proposals/topics" class=3D"">View all topics</a>
</span>
</div>
<div style=3D"font: 13px/18px arial; color:#222222; padding: 0px; margin-bo=
ttom:30px" class=3D"">
<ul style=3D"margin-left:3px; padding-left:0px" class=3D"">
=20
<li class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"x-msg://9/#gr=
oup_thread_0" class=3D"">
escaped commas in macros</a> -
<span style=3D"color:#777777" class=3D"">6 Updates</span>
</li>
=20
<li class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"x-msg://9/#gr=
oup_thread_1" class=3D"">
A proposal for C++: bit_cast.</a> -
<span style=3D"color:#777777" class=3D"">7 Updates</span>
</li>
=20
<li class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"x-msg://9/#gr=
oup_thread_2" class=3D"">
Register Access for C++</a> -
<span style=3D"color:#777777" class=3D"">4 Updates</span>
</li>
=20
<li class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"x-msg://9/#gr=
oup_thread_3" class=3D"">
Resumable expressions p0114r0 vs async/await P0057R0</a> -
<span style=3D"color:#777777" class=3D"">2 Updates</span>
</li>
=20
<li class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"x-msg://9/#gr=
oup_thread_4" class=3D"">
"enum union" with set of values restricted to exactly its enumerators=
?</a> -
<span style=3D"color:#777777" class=3D"">1 Update</span>
</li></ul></div></div></div></div></blockquote><snip></div><div>&=
lt;/snip><br class=3D""><blockquote type=3D"cite" class=3D""><div style=
=3D"border: 1px solid rgb(211, 211, 211); max-width: 850px; font-family: Ar=
ial, sans-serif;" class=3D""><div style=3D"padding:20px; background-color: =
#f5f5f5;" class=3D""><div style=3D"font: 13px/18px arial; color:#222222; pa=
dding: 0px; margin-bottom:30px" class=3D""><ul style=3D"margin-left:3px; pa=
dding-left:0px" class=3D"">
=20
</ul>
</div>
=20
<a name=3D"group_thread_0" class=3D""></a><div style=3D"display:inline-bl=
ock; font-family: arial; padding: 4px 0 5px 0px;" class=3D""><a target=3D"_=
blank" href=3D"http://groups.google.com/a/isocpp.org/group/std-proposals/t/=
5f3b8a5cbd52e878?utm_source=3Ddigest&utm_medium=3Demail" style=3D"font-=
size:21px; color:#1155CC; text-decoration:none" class=3D"">Register Access =
for C++
</a>
=20
</div>
<table style=3D"border-collapse: collapse; width: 100%" class=3D"">
=20
<tbody class=3D""><tr class=3D""><td style=3D"background-color: #FFFF=
FF; color:#2E2E2E; font-family: arial; padding:10px 15px; border:1px solid =
#d3d3d3;" class=3D"">
<span style=3D"color:#B1B0B0; font-size: 15px;" class=3D"">
Klemens Morgenstern <<a href=3D"mailto:klemens.morgenstern@gmx=
..net" class=3D"">klemens.morgenstern@gmx.net</a>>: Oct 09 07:11AM -0700
</span>
<br class=3D""><br class=3D"">
Hi,<br class=3D"">
<br class=3D"">
for a lot of microcontroller development direct hardware access is needed. =
<br class=3D"">
Sadly C++ does not provide a very reliable and easy way to access them, if =
<br class=3D"">
they are not pure intregral types.<br class=3D"">
So I've written a small paper to propose this a language feature.<br class=
=3D"">
<br class=3D"">
The paper however is far from finished, but I would like some feedback on <=
br class=3D"">
the basic idea of it.<br class=3D"">
</td></tr>
=20
<tr class=3D""><td style=3D"background-color: #FFFFFF; color:#2E2E2E;=
font-family: arial; padding:10px 15px; border:1px solid #d3d3d3;" class=3D=
"">
<span style=3D"color:#B1B0B0; font-size: 15px;" class=3D"">
"dgutson ." <<a href=3D"mailto:danielgutson@gmail.com" class=
=3D"">danielgutson@gmail.com</a>>: Oct 09 11:28AM -0300
</span>
<br class=3D""><br class=3D"">
You might want to subscribe to the informal C++ for embedded and re=
al time<br class=3D"">
systems mailing list. If interested PM me.<br class=3D"">
El 9/10/2015 11:11, "Klemens Morgenstern" <<a href=3D"mailto:klemens.mor=
genstern@gmx.net" class=3D"">klemens.morgenstern@gmx.net</a>><br class=
=3D"">
escribi=C3=B3:<br class=3D"">
<br class=3D"">
</td></tr>
=20
<tr class=3D""><td style=3D"background-color: #FFFFFF; color:#2E2E2E;=
font-family: arial; padding:10px 15px; border:1px solid #d3d3d3;" class=3D=
"">
<span style=3D"color:#B1B0B0; font-size: 15px;" class=3D"">
David Krauss <<a href=3D"mailto:potswa@gmail.com" class=3D"">p=
otswa@gmail.com</a>>: Oct 10 01:19AM +0800
</span>
<br class=3D""><br class=3D"">
<br class=3D"">
> for a lot of microcontroller development direct hardware access is nee=
ded. Sadly C++ does not provide a very reliable and easy way to access them=
, if they are not pure intregral types.<br class=3D"">
> So I've written a small paper to propose this a language feature.<br c=
lass=3D"">
<br class=3D"">
> The paper however is far from finished, but I would like some feedback=
on the basic idea of it.<br class=3D"">
<br class=3D"">
Nice to see this attacked. However:<br class=3D"">
<br class=3D"">
1. C++ doesn=E2=80=99t need to use macros here, so they=E2=80=99re a red he=
rring. Constexpr variables and inline functions are better, and they=E2=80=
=99re perfectly suitable for hardware interfaces.<br class=3D"">
<br class=3D"">
2. register is a storage class specifier. It can already be the leading tok=
en in a declaration, so although you might perhaps be avoiding absolute amb=
iguity, it could be difficult to parse.<br class=3D"">
<br class=3D"">
3. =E2=80=9CBasic rules=E2=80=9D are too loose. It should guarantee that a =
volatile access generates exactly one read. A core language solution to thi=
s problem should have no disadvantages against a library solution.<br class=
=3D"">
<br class=3D"">
4. Endianness doesn=E2=80=99t work quite like the example at the end. Also,=
registers on peripheral chips don=E2=80=99t have to respect the endianness=
of the CPU.<br class=3D"">
<br class=3D"">
5. Member pointers don=E2=80=99t currently work with bitfields. This would =
be an undertaking.<br class=3D"">
<br class=3D"">
6. There=E2=80=99s no proposed way to map register variables to fixed addre=
sses.<br class=3D"">
<br class=3D"">
7. Aren=E2=80=99t registers just a particular case of binary formats? Perha=
ps the proposal should be about portable class layout instead.<br class=3D"=
">
</td></tr>
=20
<tr class=3D""><td style=3D"background-color: #FFFFFF; color:#2E2E2E;=
font-family: arial; padding:10px 15px; border:1px solid #d3d3d3;" class=3D=
"">
<span style=3D"color:#B1B0B0; font-size: 15px;" class=3D"">
Klemens Morgenstern <<a href=3D"mailto:klemens.morgenstern@gmx=
..net" class=3D"">klemens.morgenstern@gmx.net</a>>: Oct 09 10:52AM -0700
</span>
<br class=3D""><br class=3D"">
Thanks for the feedback.Well yes, in C++ you can do this with const=
expr <br class=3D"">
value, but I've never seen this is in any embedded code. But yes, I need to=
<br class=3D"">
add this.<br class=3D"">
<br class=3D"">
2. I don't know of any case where register is actually used and I think the=
<br class=3D"">
proposed syntax is quite unique. Worked for auto, so I think that's <br cla=
ss=3D"">
alright. But you are right for one case; this<br class=3D"">
register struct{}x;<br class=3D"">
would be ambigious. I'll change that to <br class=3D"">
struct register{};<br class=3D"">
<br class=3D"">
3. Good point, I didn't think of that.<br class=3D"">
<br class=3D"">
4. Well I thought about fixing the endianess, because of that reason. <br c=
lass=3D"">
However: you have a guarantee, that the bit arrangement in the register <br=
class=3D"">
fits the integer, hence you can handle it when exchanging data between <br =
class=3D"">
devices with different platforms as integer, by just correcting the integer=
<br class=3D"">
layout and then casting it to a register again. I thought about an invert <=
br class=3D"">
operator or a lsb/msb declaration, but I did not come up with any good idea=
<br class=3D"">
to solve this without bloating the code. Do you have any?<br class=3D"">
<br class=3D"">
5. Yes, I honestly don't see the point in these, however, I don't see the <=
br class=3D"">
point of member-pointers in general. So it's more too make it complete. But=
<br class=3D"">
the logic of it is quite easy.<br class=3D"">
<br class=3D"">
6. That is on purpose, because this can be done in different ways. One is <=
br class=3D"">
to just declare a pointer with a fixed value. The other is to provide <br c=
lass=3D"">
hardware-access via linkerscript. So I don't think we should have a <br cla=
ss=3D"">
standard to do this.<br class=3D"">
<br class=3D"">
7. Well yes they are, but I think they need a real solution. You can tweak =
<br class=3D"">
bitfields to do just that with compiler extensions and I've seen that done.=
<br class=3D"">
So a standard-solution would be utterly nice. I think the portable class <b=
r class=3D"">
layout is given by the register struct, that is portably POD-Layouts.<br cl=
ass=3D"">
</td></tr>
=20
</tbody></table>
<div style=3D"align:right; font-size:11px; margin-bottom: 40px; margin-to=
p:5px;" class=3D"">
<a style=3D"color:#1155cc;text-decoration:none" href=3D"x-msg://9/#dige=
st_top" class=3D"">Back to top</a></div></div></div></blockquote><snip&g=
t;</div><div></snip><br class=3D""><blockquote type=3D"cite" class=3D=
""><div style=3D"border: 1px solid rgb(211, 211, 211); max-width: 850px; fo=
nt-family: Arial, sans-serif;" class=3D"">
<div style=3D"background-color: #f5f5f5;padding: 5px 20px;" class=3D"">
<table cellpadding=3D"0" cellspacing=3D"0" style=3D"width:100%" class=3D"=
">
<tbody class=3D""><tr class=3D"">
<td style=3D"padding-top:4px;font-family:arial,sans-serif;color:#636363=
;font-size:11px" class=3D"">
=20
You received this digest because you're subscribed to updates for thi=
s group. You can change your settings on the <a href=3D"https://groups.goog=
le.com/a/isocpp.org/forum/?utm_source=3Ddigest&utm_medium=3Demail#!foru=
m/std-proposals/join" style=3D"color:#1155cc;text-decoration:none" class=3D=
"">group membership page</a>.<br class=3D"">
To unsubscribe from this group and stop receiving emails from it send=
an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" class=
=3D"">std-proposals+unsubscribe@isocpp.org</a>.
</td>
</tr></tbody>
</table>
</div>
</div>
</blockquote></div><br class=3D""><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"">Just off-hand, I w=
as, believe it or not, coincidentally thinking about this <i class=3D"">exa=
ct</i> topic a while back when I was looking into whether or not addin=
g some functionality that is missing from Objective-C++ due to differences =
between the object models used by Objective-C and C++ by refactoring Object=
ive-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. </=
div></div></div>
</div>
<br class=3D""><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 class=3D"">Bryce Glover</div><div class=3D""><a hre=
f=3D"mailto:RandomDSdevel@gmail.com" class=3D"">RandomDSdevel@gmail.com</a>=
</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" 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=_BAC8ED54-3F21-452F-B77D-2BF133FAC116--
.