Re: The quest for the optimal calling convention; a model for specifying multiple calling conventions (longish)

fjh@cs.mu.OZ.AU (Fergus Henderson)
17 Jan 2003 19:44:28 -0500

          From comp.compilers

Related articles
The quest for the optimal calling convention; a model for specifying m jsykari@gamma.hut.fi (Antti Sykari) (2003-01-12)
Re: The quest for the optimal calling convention; a model for specif fjh@cs.mu.OZ.AU (2003-01-17)
Re: The quest for the optimal calling convention; a model for specifyi jsykari@kosh.hut.fi (Antti Sykari) (2003-01-25)
Re: The quest for the optimal calling convention; a model for specifyi strohm@airmail.net (John R. Strohm) (2003-01-26)
Re: The quest for the optimal calling convention; a model for specifyi mailbox@dmitry-kazakov.de (Dmitry A.Kazakov) (2003-01-27)
Re: The quest for the optimal calling convention; a model for specifyi rodney.bates@wichita.edu (Rodney M. Bates) (2003-01-27)
Re: The quest for the optimal calling convention; a model for specif strohm@airmail.net (John R. Strohm) (2003-01-29)
Re: The quest for the optimal calling convention; a model for spe jvorbrueggen@mediasec.de (Jan C.=?iso-8859-1?Q?Vorbr=FCggen?=) (2003-02-05)
[2 later articles]
| List of all articles for this month |

From: fjh@cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.compilers
Date: 17 Jan 2003 19:44:28 -0500
Organization: Computer Science, University of Melbourne
References: 03-01-065
Keywords: design, optimize
Posted-Date: 17 Jan 2003 19:44:28 EST

Antti Sykari <jsykari@gamma.hut.fi> writes:


>I'm working on a hobby language design project.
...
>I plan to
>make all arguments read-only by default, so that the decision of
>passing variables by reference or by value is transparent to the user
>and we will be saved from C++-like "const String&" -style cluttering
>of the argument lists.


Making arguments read-only is not sufficient to ensure that
passing variables by reference or by value will be completely
transparent to the user. Consider


foo(a,b) {
*b = 1;
print(a);
}


main() {
int x = 0;
foo(x, &x);
}


If `a' is passed by reference, then this program will print "1",
but if `a' is passed by value, the program will print "0".


--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.