News for hackers. Stuff that matters.
Re:Tail Calls, Optimization, and ES6 by yror10 on Saturday May 24, 2014 @03:30PM (#7794136)
If you write ruby and want TCO put this at the top of your .rb file:

    RubyVM::InstructionSequence.compile_option = {
      :tailcall_optimization => true,
      :trace_instruction => false
    }
Re:Tail Calls, Optimization, and ES6 by eknkc on Saturday May 24, 2014 @04:30PM (#7794325)
Why is it optional? What is the benefit of having it disabled by default if there is a decent implementation?
Re:Tail Calls, Optimization, and ES6 by anonova on Saturday May 24, 2014 @04:44PM (#7794371)
They disabled it for error reporting/debugging reasons. Because you don't need to create a new stack frame, you eliminate that information in the backtrace.
Re:Tail Calls, Optimization, and ES6 by steveklabnik on Saturday May 24, 2014 @04:50PM (#7794381)
I've seen at least one paper that shows a way to fix this... hm.
Re:Tail Calls, Optimization, and ES6 by Tuna-Fish on Saturday May 24, 2014 @04:42PM (#7794365)
A lot of people prefer having complete, explicit stacks for debugger use over having tail calls.
Re:Tail Calls, Optimization, and ES6 by hajile on Tuesday May 27, 2014 @02:18PM (#7805953)
loops don't leave a stack trace either...
Re:Tail Calls, Optimization, and ES6 by damncabbage on Sunday May 25, 2014 @01:27AM (#7795562)
And also apply this patch, if you're using MRI (the C implementation, and the most common Ruby runtime): https://gist.github.com/plexus/11201946