software-mansion / software-mansion/TypeGPU

[RFC] feat: Infix op shorthands

Open
#1,825 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.2k
Forks
122
Avg merge
3d 5h
Merged PRs (30d)
34

Description

This idea come to me during Konrad's live-coding session. Seems useful, but I am not 100% sure about it.

const uv = d.vec2f();

// before:
uv.add(d.vec2f(1, 0))
// after:
uv.add(1, 0)

It seems nice for small arguments, but could get confusing for larger strings of expressions

uv.add(d.vec2f(time.$ * 20 + 0.543, time.$ * 50 + 0.122))
// after:
uv.add(time.$ * 20 + 0.543, time.$ * 50 + 0.122)

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 locating the TypeGPU vector-operation API and its existing tests; no file or entry point is named in the issue. Compare the current explicit vector-argument calls with the proposed shorthand, then establish whether the behavior is sufficiently clear for both simple and longer expressions before defining completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.