[Cryptography] tail recursion in C [was Re: "NSA-linked Cisco exploit poses bigger threat than previously thought"]

Ray Dillinger bear at sonic.net
Mon Aug 29 17:51:58 EDT 2016



On 08/29/2016 10:23 AM, Henry Baker wrote:


FWIW, for the first several iterations of the standard,
function calls were literally flow-of-control operation
in scheme.  People have since added looping constructs,
in an effort to check off "doesn't have X" arguments by
newbies against using the language, but looping structures
are usually defined as macros - they are syntactic sugar
for flow-of-control via function calls.  Direct use of
recursion is still the easiest and simplest way to express
loops.

Guaranteeing an unbounded number of open active tail
calls has the same importance in scheme as supporting
loops and other flow-of-control structures in imperative
languages. It is not optional.  It is not an optimization.
It is a necessity.

The very simplest interpreters always allocate call frames
on the heap, and garbage collect them like any other data.
More sophisticated compilers use the hardware stack when
possible, but this requires some program analysis for
figuring out when it's possible.


				Bear


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://www.metzdowd.com/pipermail/cryptography/attachments/20160829/f36214bd/attachment.sig>


More information about the cryptography mailing list