home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!acorn!armltd!hmeekings
- From: hmeekings@armltd.co.uk (Harry Meekings)
- Newsgroups: comp.sys.acorn.tech
- Subject: Re: New Language/Compiler (ideas wanted)
- Message-ID: <5322@armltd.uucp>
- Date: 14 Aug 92 15:46:11 GMT
- References: <1992Aug13.130618.18871@odin.diku.dk>
- Sender: hmeeking@armltd.uucp
- Distribution: comp
- Organization: A.R.M. Ltd, Swaffham Bulbeck, Cambs, UK
- Lines: 25
-
- In article <1992Aug13.130618.18871@odin.diku.dk> torbenm@diku.dk
- (Torben AEgidius Mogensen) writes:
-
- >Afeature I have sorely missed in compilers for C etc. is a cheap
- >tail-call: if the last thing you do in a procedure or function is to
- >call a procedure or function, this can be implemented as a goto rather
- >than a general procedure/function call. Also, the local variables of
- >the calling procedure need not be saved before the call, as they will
- >never be used again. Note that this is not a laguage feature, but a
- >compiler feature. This requires a callee-saves-registers strategy, but
- >that is often the simplest anyway.
- >
-
- It's curious that this should be posted in an Acorn newgroup, since the Acorn
- C compiler does indeed do (indeed, has always done) conversion of tail-calls
- branches, except when
- the calling function contains a call to setjmp
- or the calling function takes the address of an argument
- or when compilation is using the -g flag (to avoid confusing the poor user).
-
- It's true that lots of compilers don't do this but, bearing in mind the
- background of the compiler's original authors in functional programming, it's
- unsurprising that the Aconr compiler does.
-
- Harry Meekings
-