Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dogprez
on Jan 23, 2015
|
parent
|
context
|
favorite
| on:
What makes Nim practical?
Your example isn't exactly true. Clang and GCC both do tail call optimizations. Compiling language functions to C functions doesn't 100% preclude you from TCO.
http://david.wragg.org/blog/2014/02/c-tail-calls-1.html
bch
on Jan 23, 2015
|
next
[–]
See also:
http://www.pipeline.com/~hbaker1/CheneyMTA.html
It looks like work/research in this area has been going on for at least ~20 years.
jpolitz
on Jan 23, 2015
|
parent
|
next
[–]
Indeed it has. For a few more examples, see also
http://www.ustream.tv/recorded/43777177
, and
http://www.ccs.neu.edu/racket/pubs/stackhack4.html
. Pyret (
http://pyret.org
) uses similar stack techniques to these to simulate an arbitrarily deep stack while compiling to JS.
pjmlp
on Jan 23, 2015
|
prev
[–]
It will, otherwise semantics will depend on which C compiler is available and ANSI C doesn't require TCO.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: