zlacker

[return to "PyTorch for WebGPU"]
1. crubie+Id[view] [source] 2023-05-19 22:26:08
>>mighdo+(OP)
This is huge! For me the one thing preventing Typescript to replace python is the lack of availability of CV ML libraries. WebGPU and this kind of libraries changes everything
◧◩
2. Subopt+3B[view] [source] 2023-05-20 02:41:45
>>crubie+Id
And operator overloading. TS code tends to look like this `c.add(b.add(a))` or `add(add(a, b), c)` instead of `a + b + c` as you might write in Python.

That was my biggest pain-point with using TS for graphics related projects. If operator overloading existed, then TS would be a no brainer for entry level graphics + AI/ML projects.

Edit: This gets more complicated when doing operations that force you to manually respect PEMDAS. For example, `add(div(a, b), multiply(c, d))` in TypeScript would simplify to `a / b + c * d` in Python. The TS version is unreadable.

◧◩◪
3. killth+LC[view] [source] 2023-05-20 03:11:15
>>Subopt+3B
Another option that's not quite as good as `a + b + c` but that is possible with TypeScript is a fluent API:

  const sum = a.add(b).add(c);
[go to top]