logoalt Hacker News

pfdietztoday at 12:18 PM3 repliesview on HN

Lack of TCO is also a common footgun for Scheme programmers using Common Lisp.


Replies

tialaramextoday at 12:38 PM

This footgun is the reason I'm so enthusiastic about the Rust `become` keyword.

This proposal would give Rust a specific keyword which says that you intend TCO and so two things happen: 1. The compiler goes to more length to deliver TCO even where it wouldn't "just work" and 2. If it cannot deliver TCO your code doesn't compile, because you asked for TCO.

show 3 replies
guentherttoday at 12:45 PM

Only if they are using an insufficiently smart compiler. SBCL handles TCO just fine, as do a number of other implementations, see : https://0branch.com/notes/tco-cl.html

show 1 reply
pjmlptoday at 1:24 PM

Mostly because they forget Scheme is one of the few languages where TCO is part of the language standard, making it a required feature for any compliant implementation.

This has always been an issue regarding TCO support across programming languages.

show 1 reply