TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Khronos Group adopts the Slang shading language

40 点作者 coffeeaddict16 个月前

9 条评论

esperent5 个月前
Slang looks interesting, I&#x27;ve been reading a bit about it over the last few weeks.<p>However, I&#x27;ve already run into the problem that, while it&#x27;s a clever name for a shading language, it&#x27;s a terrible name when trying to find anything in a search engine.<p>Making sure that devs can search and find answers quickly is an extremely important aspect of developer ergonomics, and I hope this issue isn&#x27;t reflected in other subtle design flaws throughout the project.<p>A much less clever name that isn&#x27;t already a common English word is always preferable. Call it xyzSL or something boring like that, which is unique and will always return meaningful search results.
评论 #42302386 未加载
评论 #42303678 未加载
jitl5 个月前
I poked around a bit on their docs site [1] to get a feel for the language, and these two features stood out to me:<p>&gt; - <i>Interfaces and generics</i> provide first-class alternative to hacky preprocessor-based or string-pasting shader specialization. Preprocessor hacks can be replaced with a well-understood language feature already used in Rust, Swift, C#, Java, and more.<p>&gt; - Automatic differentiation greatly simplifies the implementation of learning-based techniques in shaders. Slang supports automatically generating both forward derivative and backward derivative propagation functions from forward computation code.<p>&gt; - Slang supports a first class module system, which enables true separate compilation and semantic checking of shader code.<p>I am a total beginner at shaders, but when I&#x27;ve dabbled in them they are mostly surrounded by string concatenation and a variety of wild macros, so it&#x27;s cool to see a &quot;typescript for shaders&quot; with such broad support, both of vendors, and of target shader languages.<p>[1]: <a href="https:&#x2F;&#x2F;shader-slang.com&#x2F;slang&#x2F;user-guide&#x2F;introduction.html" rel="nofollow">https:&#x2F;&#x2F;shader-slang.com&#x2F;slang&#x2F;user-guide&#x2F;introduction.html</a>
评论 #42302414 未加载
merksoftworks5 个月前
I have a use case for slang, I want to use it to transpile user provided shaders to WGSL and then use it&#x27;s custom user attributes to provide metadata for setting up composable image processing shaders with minimal developer intervention, like shader toy or compute toy. The thing that is making this annoying is that the tooling is very bound to C++. Has anyone found a good rust wrapper for slang?
jmclnx5 个月前
I wish these people would make up their own names instead of using what already is in use :)<p>At first I thought it was S-lang used in jed.<p><a href="https:&#x2F;&#x2F;www.jedsoft.org&#x2F;jed&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.jedsoft.org&#x2F;jed&#x2F;</a>
dang5 个月前
Recent and related:<p><i>The Slang Shading Language</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42244472">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42244472</a> - Nov 2024 (44 comments)
TinkersW5 个月前
It looks interesting and I&#x27;m considering switching to Slang, currently using HLSL but I&#x27;ve never really liked it or GLSL, they are both overly simple.
评论 #42397564 未加载
taminka5 个月前
i’m confused who the intended userbase for this is<p>you either use like a game engine that generates all the platform specific gpu code and shaders for you, or you can take advantage of writing all the different gpu specific and shader code yourself (bc you need specific features or can make it faster or some such), i can’t really imagine something in between tbh<p>and a generalised tool like this is destined to not fit platform specific features that well; for example, i couldn’t find any mention of an interface to use tensor cores, and automatic differentiation w&#x2F;o a relatively complex expression optimiser is kinda useless for machine learning, where tensor wrt tensor derivatives&#x27; dimensionality explodes w&#x2F;o using an expression optimiser…<p>it’s kind of the same story as w&#x2F; cross platform gpu frameworks: they’re destined to just kind of do everything but badly bc different platforms have different architectures that you can’t map to w&#x2F; a single api… imo the best solution remains to have domain specific solutions that generate separate cross platform code solely in that domain...
评论 #42302665 未加载
n425 个月前
does anyone understand how this fits in with the weird mess of SPIR-V&#x2F;WGSL&#x2F;Vulkan&#x2F;GSL&#x2F;HSL?<p>is this supposed to take the place as the officially blessed frontend language for SPIR-V? or is this just another standard attempting to replace the other standards (insert XKCD)?
评论 #42302388 未加载
评论 #42302328 未加载
Animats5 个月前
<i>Another</i> shader compiler to support?
评论 #42303811 未加载
评论 #42302443 未加载