rescript-lang / rescript-lang/rescript

Trampolining of mutually recursive functions

Open
#849 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
OCaml
Stars
7.5k
Forks
485
Avg merge
1d 2h
Merged PRs (30d)
55

Description

Introduce an annotation to rewrite mutually recursive functions to use a trampoline. This will enable the user to avoid exceeding the stack size at the expense of more overhead until ES6 proper tail calls are widely implemented (it is only available in Safari 10 & WebKit at the moment).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or compiler entry points are named in the issue. Start by locating how mutually recursive functions are compiled and how annotations are parsed, then review the generated JavaScript behavior. Done means an annotation can rewrite mutually recursive functions to use a trampoline without exceeding the stack, with coverage for the supported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, ocaml
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.