gbdev / gbdev/rgbds

RGBLINT tool to optimize and improve code

Open
#1,807 6 comments 3 reactions 0 assignees View on GitHub
enhancement good first issue new tool
Dominant language
C++
Stars
1.6k
Forks
193
Avg merge
22h 17m
Merged PRs (30d)
26

Description

There are [many "peephole" optimizations](https://github.com/pret/pokecrystal/wiki/Optimizing-assembly-code) that can be applied by searching for suboptimal patterns of assembly code. There may also be reasons to lint code besides optimization (and besides consistent formatting, which would be its own tool; see #1796).

This would be like [optimize.py](https://github.com/Rangi42/polishedcrystal/blob/master/utils/optimize.py), but ideally running faster, and not tied to pret's preferred formatting and macros (generalizable to all of GB dev). On the other hand, it should have a way to easily define custom lint rules, so it can recognize project-specific macros and exceptions. (For instance, in pret `jmp` should be recognized by all relevant patterns as a jump instruction, and the Hungarian `h`/`w`/`v`/`s` RAM prefixes are relevant for some patterns.)

Contributor guide

Open the contributing guide

Research direction

Start with the linked utils/optimize.py and the peephole-optimization wiki page to understand the proposed rule set and existing behavior. Define the scope for RGBLINT, including configurable custom rules and project-specific exceptions; done should mean an agreed, generalizable linting tool rather than only a design proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.