consider adding `hashof` to immutables
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
Description
This came out of @Chriscbr 's recent cachebale function proposed example. Since Wing is heavy on immutables, compiler internally can efficiently generate unique hashes for all sorts of immutable objects. That way users can access this hash through something like hashof to do cache-keying. We need to implement this anyway internally for the compiler in order to be able to efficiently do equality checks between immutables, so might as well expose it to the user through a global hashof in the MVP spec to stay consistent with other xxxxof(...) globals. This would be equivalent to Java's Object.hashCode or similar mechanic in Python.
Contributor guide
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
Review the compiler work needed for immutable hashing and equality, along with the MVP specification, using the cacheable-function example as context. Define the user-facing hashof behavior and verify that it supports cache-keying while remaining consistent with the compiler’s internal equality requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100