feat: add WGSL (WebGPU Shading Language) support#1724
feat: add WGSL (WebGPU Shading Language) support#1724
Conversation
Add WGSL to the supported languages list with ASCII art based on the W letterform and WGSL abbreviation. Uses blue color matching the WebGPU brand identity. Closes o2sh#1527
spenserblack
left a comment
There was a problem hiding this comment.
Please see our contributing guidelines regarding AI usage: https://github.com/o2sh/onefetch/blob/main/CONTRIBUTING.md#ai-policy
Was there any human review before PR submission? Because the ASCII art looks incomprehensible to me TBH.
languages.yaml
Outdated
| {0} WW GG SSSS LL | ||
| {0} WW GG SS LL | ||
| {0} WW W GG SSS LL | ||
| {0} WWWWWGG SS LL | ||
| {0} WW GGG SSSS LLLL |
There was a problem hiding this comment.
This honestly just looks unreadable to me.
Traced from the actual W3C WebGPU logo SVG geometry (webgpu-notext.svg), which is 5 blue triangles forming a W mark. - 5-color blue gradient matching the SVG's triangle shading (#005A9C darkest to #0093FF brightest) - 17 lines x 36 chars, within 25x40 bounds - Asymmetric W shape faithful to the original logo proportions Signed-off-by: Matt Van Horn <matt@mvanhorn.dev>
The right peak (Triangle 5) starts at y=87 in the SVG, same as Triangle 1's top edge. Adjusted sampling threshold so the small peak renders at the same row as the large triangle. Signed-off-by: Matt Van Horn <matt@mvanhorn.dev>
|
You're right, and I apologize for the quality of the original submission. I should have caught that before opening the PR. I've reworked the ASCII art from scratch, tracing it from the official W3C WebGPU SVG (the 5-triangle W mark). Used a 5-shade blue gradient to match the logo's triangle coloring. It passes cargo check and fits within bounds. That said, I'm honestly not sure if it's good enough yet - the logo is an unusual shape for ASCII art and there's no existing reference to work from. Happy to take direction on what needs improving, or if you'd prefer a completely different approach. |
spenserblack
left a comment
There was a problem hiding this comment.
Overall it looks good to me, I appreciate the work! Equilateral triangles are very hard to do in ASCII art, but you might have better luck approximating each "pixel" as 2 units tall and 1 unit wide, and so use 2 characters for horizontal alignment for each 1 character of vertical alignment.
X
XXXXX
XXXXXXXXX
XXXXXXXXXXXXX
To be a bit more precise, I usually treat characters as 1 unit wide and roughly 1.5 units tall, but that fractional scaling can be difficult. Note how the above might feel a bit too wide, while the below doesn't have uniform scaling on each row.
X
XXX
XXXXXXX
XXXXXXXXX
XXXXXXXXXXXXX
Summary
Adds WGSL (WebGPU Shading Language) to onefetch's supported languages.
Changes
languages.yaml: Added WGSL entry with:tokei already supports WGSL for line counting (confirmed in tokei's languages.json).
References
Closes #1527
This contribution was developed with AI assistance (Claude Code).