3 ms·
My sense is that the only unique thing about Scheme here is the fact that it's specified in the standard. That means that developers are going to develop softwa
by mumblemumble 6y ago
My sense is that the only unique thing about Scheme here is the fact that it's specified in the standard. That means that developers are going to develop software that expects to be able to write tail-recrusive code without fear of blowing the stack.
Other language standards keep this from affecting the semantics of the language by simply leaving it out of the semantics of the language. When the expected behavior is undefined, the implementors can do anything they want without, strictly speaking, affecting the semantics of the language.
- beagle3 6y agoSome languages (Python, Tcl, R and possibly others) expose the stack as part of the language/standard-library, and thus an implementation that DOES do TCE cannot be compatible. In python, it's mostly visible through exception objects. In Tcl and R, it's in common use because it is standard practice to do things in your caller's scope instead of your own. In C++ (and any language with destructors), many routines are invisibly not TCEable because the language semantics require the destructor to run after the tail call returns - which means that a change to a different part of the code determines if a specific function is TCEable or not. So, despite your claim being technically true, it is in practice often informally specified by the language or standard library.