[ruby-core:114252] [Ruby master Feature#19780] Remove tailcall_optimization support
Issue #19780 has been reported by k0kubun (Takashi Kokubun). ---------------------------------------- Feature #19780: Remove tailcall_optimization support https://bugs.ruby-lang.org/issues/19780 * Author: k0kubun (Takashi Kokubun) * Status: Open * Priority: Normal ---------------------------------------- ## Proposal Remove `tailcall_optimization` flag from `RubyVM::InstructionSequence` ## Motivation The consensus at [Feature #6602] seems to be that we're not going to enable tailcall optimization by default until we introduce syntax for it. Until this syntax is introduced, this feature is useless. Can we remove this flag until we do support that future syntax? ## Background This script doesn't work with `--yjit-call-threshold=1` on any YJIT-enabled build. ```rb src = <<-EOS def apply_one_and_two(&block) [1, p(1)] end def add_one_and_two apply_one_and_two(&:+) end EOS RubyVM::InstructionSequence.new( "proc {|_|_.class_eval {#{src}}}", __FILE__, __FILE__, 1, tailcall_optimization: true, trace_instruction: false, ).eval[self.singleton_class] def entry add_one_and_two end entry ``` I already wasted a lot of time just for noticing it's already broken. I don't want to waste time for users that do not exist yet. -- https://bugs.ruby-lang.org/
Issue #19780 has been updated by k0kubun (Takashi Kokubun). Status changed from Open to Rejected This ticket has been discussed on [DevMeeting-2023-09-14](https://github.com/ruby/dev-meeting-log/blob/master/2023/DevMeeting-2023-09-...). While no meeting log is left, according to @mame on Sep 14, 2023, @matz didn't want to delete it while @ko1 was about to give it up. I'm closing this ticket as rejected. ---------------------------------------- Feature #19780: Remove tailcall_optimization support https://bugs.ruby-lang.org/issues/19780#change-120019 * Author: k0kubun (Takashi Kokubun) * Status: Rejected ---------------------------------------- ## Proposal Remove `tailcall_optimization` support from `RubyVM::InstructionSequence` (make it no-op) ## Motivation The consensus at [Feature #6602] seems to be that we're not going to enable tailcall optimization by default until we introduce syntax for it. Until this syntax is introduced, this feature is useless. Can we remove this flag until we do support that future syntax? ## Background This script crashes with `--yjit-call-threshold=1` on any YJIT-enabled build. ```rb src = <<-EOS def apply_one_and_two(&block) [1, p(1)] end def add_one_and_two apply_one_and_two(&:+) end EOS RubyVM::InstructionSequence.new( "proc {|_|_.class_eval {#{src}}}", __FILE__, __FILE__, 1, tailcall_optimization: true, trace_instruction: false, ).eval[self.singleton_class] def entry add_one_and_two end entry ``` I already wasted a lot of time just for noticing it's already broken. I don't want to waste time for users that do not exist yet. It's possible to fix, but you need to add some code that needs to be executed even if you don't enable it unless you add another flag to iseqs (which will consume more memory). The complexity just doesn't seem worth it. Removing tailcall support would simplify the implementation and problems we need to deal with. -- https://bugs.ruby-lang.org/
participants (1)
-
k0kubun (Takashi Kokubun)