www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - On Andrei's Keynote / checkedint

reply qznc <qznc web.de> writes:
I just watched Andrei's Keynote slightly delayed so I could not 
ask live via chat. One question and one remark:

1. Is there any reason to restrict this to integrals? Why not use 
Checked!(float,H) or Checked!(complex,H) or 
Checked!(polynomial,H)? If it is more general, then we should 
change the name as long as we still can (it is experimental).

2. With respect to "Where did you steal all this money?": I 
recently [0] read about the Metaobject Protocol (MOP) and I 
noticed some similarities. MOP comes from the Lisp world, where 
things are more dynamic, but also compile-time and run-time are 
not that clearly separated. At least the intention of Gregor 
Kiczales and Andrei's DbI match. In Kiczales words from 1992 [1]: 
"for those cases where the underlying implementation is not 
adequate, the client has a more reasonable recourse. The 
meta-level interface provides them with the control they need to 
step in and customize the implementation to better suit their 
needs"

[0] http://beza1e1.tuxen.de/leaky_abstractions.html
[1] 
https://pdfs.semanticscholar.org/39ea/ec97dde6db7e2245e9b8dc662652a3cefa64.pdf
May 06 2017
next sibling parent qznc <qznc web.de> writes:
On Saturday, 6 May 2017 at 10:45:56 UTC, qznc wrote:
 I just watched Andrei's Keynote slightly delayed so I could not 
 ask live via chat. One question and one remark:

 1. ...

 2. ...
3. Checkedint has the same problem as std::string in C++, which Scott Meyers highlighted in his keynote the day before: Literals are not wrapped, so `checked_x + 42 + 42` may behave differently to `42 + 42 + checked_x`.
May 06 2017
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/6/17 12:45 PM, qznc wrote:
 I just watched Andrei's Keynote slightly delayed so I could not ask live 
 via chat. One question and one remark:
 
 1. Is there any reason to restrict this to integrals? Why not use 
 Checked!(float,H) or Checked!(complex,H) or Checked!(polynomial,H)? If 
 it is more general, then we should change the name as long as we still 
 can (it is experimental).
I haven't tried this yet, but I'm fairly sure this can be made to work with ease by implementing a couple of primitives: isUnsigned and checkedOp. The latter performs a checked unary or binary operation and returns the result along with information on whether the operation has overflown or not. That's not enough for floating-point operations; off the top of my head, there's underflow and loss of precision.
 2. With respect to "Where did you steal all this money?": I recently [0] 
 read about the Metaobject Protocol (MOP) and I noticed some 
 similarities. MOP comes from the Lisp world, where things are more 
 dynamic, but also compile-time and run-time are not that clearly 
 separated. At least the intention of Gregor Kiczales and Andrei's DbI 
 match. In Kiczales words from 1992 [1]: "for those cases where the 
 underlying implementation is not adequate, the client has a more 
 reasonable recourse. The meta-level interface provides them with the 
 control they need to step in and customize the implementation to better 
 suit their needs"
Thanks! I am indeed aware of MOP and Intentional Programming. They are related but distinct. MOP is mainly concerned with mutating a program such as adding/deleting methods, creating new types, etc. DbI focuses on combinations - assembling components into larger components in flexible ways.
 [0] http://beza1e1.tuxen.de/leaky_abstractions.html
Nice job writing a post so quickly! Andrei
May 06 2017
parent qznc <qznc web.de> writes:
On Saturday, 6 May 2017 at 14:14:25 UTC, Andrei Alexandrescu 
wrote:
 [0] http://beza1e1.tuxen.de/leaky_abstractions.html
Nice job writing a post so quickly!
It was a coincidence. It took longer. That post is part of my preparation for another conference [0], but that talk will be strongly influenced by DbI and other tidbits from DConf. ;) [0] https://www.topconf.com/conference//duesseldorf-2017/talk/abstractions-from-c-to-d/
May 06 2017
prev sibling parent reply dlangPupil <x x989898998.com> writes:
Hi,

I can't find video for Andrei's talk at

https://www.youtube.com/playlist?list=PL3jwVPmk_PRxo23yyoc0Ip_cP3-rCm7eB

Can you provide a link?  I'm looking forward to watching it!

Thanks!
May 11 2017
parent reply Mike Parker <aldacron gmail.com> writes:
On Friday, 12 May 2017 at 03:54:54 UTC, dlangPupil wrote:
 Hi,

 I can't find video for Andrei's talk at

 https://www.youtube.com/playlist?list=PL3jwVPmk_PRxo23yyoc0Ip_cP3-rCm7eB

 Can you provide a link?  I'm looking forward to watching it!

 Thanks!
It's not available yet. It should be there soon.
May 12 2017
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/12/17 10:05 AM, Mike Parker wrote:
 On Friday, 12 May 2017 at 03:54:54 UTC, dlangPupil wrote:
 Hi,

 I can't find video for Andrei's talk at

 https://www.youtube.com/playlist?list=PL3jwVPmk_PRxo23yyoc0Ip_cP3-rCm7eB

 Can you provide a link?  I'm looking forward to watching it!

 Thanks!
It's not available yet. It should be there soon.
I recommend watching instead the Google Israel Tech Talk (upcoming in a few days). Same content, better delivery. -- Andrei
May 12 2017