Re:Early exit is a tail call optimization of procedural lang...
by hellofunk on Monday December 14, 2015 @09:26AM
(#10731113)
Would be nice to see more serious study of this for a language like C++. It would take either TCO or Garbage Collection to make reliable, robust persistent data structures a possibility in C++, and more would prefer TCO of these two. That would open a big door into more powerful functional programming idioms for C++ than currently exist, even with the latest language standards.
[ Parent
| on HN ]
Re:Early exit is a tail call optimization of procedural lang...
by adrianm on Monday December 14, 2015 @09:51AM
(#10731255)
How would TCO help? I've never read anything about the connection between TCO and persistent data structures. GC on the other hand is a known, and often assumed, requirement in the literature. Sounds interesting!
Re:Early exit is a tail call optimization of procedural lang...
by jacquesm on Monday December 14, 2015 @10:38AM
(#10731560)
TCO can be done more readily if you know for a fact that all the parameters passed into the function were not modified during the execution of the function.
Re:Early exit is a tail call optimization of procedural lang...
by GFK_of_xmaspast on Monday December 14, 2015 @01:16PM
(#10732704)
More reasons to be aggressive about marking things const.
Re:Early exit is a tail call optimization of procedural lang...
by hellofunk on Monday December 14, 2015 @03:52PM
(#10733754)
consider this interesting discussion:
https://github.com/BartoszMilewski/Okasaki/issues/1#issuecom...
his blog has more details
Re:Early exit is a tail call optimization of procedural lang...
by pjc50 on Monday December 14, 2015 @10:43AM
(#10731606)
Compilers already implement some TCO. What specifically do you mean about "reliable, robust persistent data structures" that you think is currently not possible in C++?
Re:Early exit is a tail call optimization of procedural lang...
by hellofunk on Monday December 14, 2015 @03:51PM
(#10733749)
See here:
https://github.com/BartoszMilewski/Okasaki/issues/1#issuecom...
This guy knows what he is talking about. His blog has a lot of interesting discussion in this area.