Tensegritics / Tensegritics/ClojureDart
Peephole optimization of `seq` calls
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 1.6k
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
It's idiomatic clojure to test emptiness with seq, because most of the time you are going to iterate with the returned value. So nil/sequence is more useful than false/true.
However there are still cases where seq is purely used in a boolean or existential context.
Proposal: when the compiler encounters a call to seq in a boolean or existential context, it should replace the call by another protocol call with fast-path (no alloc) emptiness checking.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the compiler implementation for seq calls and the handling of boolean or existential contexts. Determine how protocol calls provide fast-path emptiness checking; done means those contexts avoid the seq allocation while ordinary seq usage remains unchanged, with compiler tests covering both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, dart
- Domain
- compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100