www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Prorogued Proramming - somthing to consider for the D future?

reply Dejan Lekic <dejan.lekic gmail.com> writes:
Hi everybody!

Today I watched this woderful presentation by Mehrdad Afshari - 
http://www.infoq.com/presentations/Prorogued-Programming . I must admit I like 
the idea and see potential benefits of having the "prorogue" in D.

What do you people think?

-- 
Dejan Lekic
dejan.lekic (a) gmail.com
http://dejan.lekic.org
Sep 14 2013
next sibling parent "Peter Alexander" <peter.alexander.au gmail.com> writes:
Here's a super quick summary for those without time to watch:

He proposed a language keyword, 'prorogue' used like so:

int foo = prorogue bar(x);

The keyword indicates that, instead of calling 'bar', the code 
should ask the user for the return value, which is then memoized 
with the value of x, and is saved across executions. bar need not 
be defined. You can also do things like 'return prorogue;' to 
request a value to return.

The reported uses of this are:
- Top-down development: prorogue functions to mock them.
- Debugging: mark a call as prorogue to provide a value to repro 
a failure case.
- Crowdsourcing: if you memoize across the internet then all 
users collaborate to fill in gaps.
Sep 14 2013
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Saturday, 14 September 2013 at 19:26:04 UTC, Peter Alexander 
wrote:
 Here's a super quick summary for those without time to watch:

 He proposed a language keyword, 'prorogue' used like so:

 int foo = prorogue bar(x);

 The keyword indicates that, instead of calling 'bar', the code 
 should ask the user for the return value, which is then 
 memoized with the value of x, and is saved across executions. 
 bar need not be defined. You can also do things like 'return 
 prorogue;' to request a value to return.

 The reported uses of this are:
 - Top-down development: prorogue functions to mock them.
 - Debugging: mark a call as prorogue to provide a value to 
 repro a failure case.
 - Crowdsourcing: if you memoize across the internet then all 
 users collaborate to fill in gaps.

That's actually kindof neat. I'm not convinced by the Crowd-sourcing aspect, but it seems like it would be a nice abstraction for sketching out an architecture or debugging a rare, hard to access code path. On the surface at least, this looks trivial to implement in D.
Sep 14 2013
prev sibling parent Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Sat, 14 Sep 2013 21:25:58 +0200
"Peter Alexander" <peter.alexander.au gmail.com> wrote:

 Here's a super quick summary for those without time to watch:
 
 He proposed a language keyword, 'prorogue' used like so:
 
 int foo = prorogue bar(x);
 
 The keyword indicates that, instead of calling 'bar', the code 
 should ask the user for the return value, which is then memoized 
 with the value of x, and is saved across executions. bar need not 
 be defined. You can also do things like 'return prorogue;' to 
 request a value to return.
 
 The reported uses of this are:
 - Top-down development: prorogue functions to mock them.
 - Debugging: mark a call as prorogue to provide a value to repro 
 a failure case.
 - Crowdsourcing: if you memoize across the internet then all 
 users collaborate to fill in gaps.
 

I think that's a pretty cool idea.
Sep 21 2013