www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Hardware-driven language design

reply bearophile <bearophileHUGS lycos.com> writes:
On Reddit I have just found a thread about a paper that I didn't know:
http://www.reddit.com/r/programming/comments/hs24h/programming_language_design_and_analysis/

The paper "Programming Language Design and Analysis motivated by Hardware
Evolution" by Alan Mycroft, 2007:
http://www.cl.cam.ac.uk/~am21/papers/sas07final.pdf

The slides:
http://www.cl.cam.ac.uk/~am21/papers/sas07slides.pdf

In the slides the part I find more interesting for language design is pages
28-35.

In slide 31 it shows the syntax:
void foo(Q  p) {...

This means "use either CBV or CBR but reject the body of f if it does anything
which can tell the difference" (Functions needing CBR or CBV can have it, but
CBEWE allows late binding of physical distribution.)

This also reminds me my  transparent, the attribute for reference types coming
out of pure functions :-)

On page 34-35 it talks about quasi-linear types.

The topics of the paper are similar, but the focus is not the on the same
things.

From what I've seen the designers of the Chapel language have taken seriously
in account the design of future CPUs. I suggest to take a look at Chapel for
ideas.

Bye,
bearophile
Jun 05 2011
next sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On Reddit I have just found a thread about a paper that I didn't know:
http://www.reddit.com/r/programming/comments/hs24h/programming_language_design_and_analysis/

The paper "Programming Language Design and Analysis motivated by Hardware
Evolution" by Alan Mycroft, 2007:
http://www.cl.cam.ac.uk/~am21/papers/sas07final.pdf
beaorphile wrote:
 The slides:
 http://www.cl.cam.ac.uk/~am21/papers/sas07slides.pdf

 In the slides the part I find more interesting for language design is pages >
28-35.

 In slide 31 it shows the syntax:
 void foo(Q  p) {...

 This means "use either CBV or CBR but reject the body of f if it does
 anything which can tell the difference" (Functions needing CBR or CBV can
 have it, but CBEWE allows late binding of physical distribution.)
 [snip.]
I think D has this (if Q is a value type). Isn't just a fancy way to signal that p is immutable? So in D, this would look like void foo(immutable Q p); Given that signature, the compiler can effectively decide whether to use CBV or CBR iff Q is a value type. It does not work that well for Ds reference types (because you cannot pass them by value obv.). Timon
Jun 05 2011
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/5/2011 6:43 AM, bearophile wrote:
 In slide 31 it shows the syntax: void foo(Q  p) {...

 This means "use either CBV or CBR but reject the body of f if it does
 anything which can tell the difference" (Functions needing CBR or CBV can
 have it, but CBEWE allows late binding of physical distribution.)
D has this (auto ref parameters).
Jun 05 2011