jackfirth / jackfirth/resyntax

Suggest optimizing `for/last` expressions

Open
#431 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new lint
Dominant language
Racket
Stars
70
Forks
11
PR merge metrics
No merged PRs in 30d

Description

The for/last form evaluates the loop body every iteration, even though it often only needs to evaluate it on the last iteration. This is very wasteful when the loop body is computing something whose side effects don't matter. Resyntax ought to suggest something to optimize this, either by manually extracting the body out or by using a new keyword we could add to for/last that tells it to only evaluate the last loop body.

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

Start by tracing how resyntax recognizes for/last and how it represents optimization suggestions; the issue names no files or tests. First resolve whether the intended change is manual body extraction or a new keyword, then define completion with coverage showing the chosen transformation handles the final iteration correctly.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.