Skip to content

Native TCO #11

@jsborjesson

Description

@jsborjesson

You can actually get native tail call optimisation in Ruby, if this works for Läsp it would perhaps even be nicer than mimicking Clojure's recur. It has to be turned on like this:

RubyVM::InstructionSequence.compile_option = { 
  tailcall_optimization: true,
  trace_instruction:     false,
}

One pitfall is that this has to be set before the code that uses it is compiled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions