Thoughts on making Slang a "full language" #5039
Replies: 4 comments 6 replies
-
If I understand right, we’re very close to having this working. I kinda see the possibility of a CUDA-like workflow with slang, where host and device code can intermix. But then I also think having vectors / matrices included as a first class citizen of the language is also a unique benefit that CUDA misses the mark a bit on. For certain differentiable workloads, having a unified language could also enable some interesting new options for computing gradients. |
Beta Was this translation helpful? Give feedback.
-
I'd love to hear @tangent-vector's thoughts on this! |
Beta Was this translation helpful? Give feedback.
-
@LouChiSoft As you have discovered, there has been experimental work going on to make slang a good CPU language, such as the The long term vision is to make Slang a desirable option for writing heterogeneous CPU/GPU code. When designing the language, we are taking this vision into account. However our current engineering resource is still very limited and we can't invest a lot of time to bring up all the required the CPU programming features to reach product level matureness, but we are slowly working towards this goal! Please feel free to share your thoughts, and we always welcome contributions in any form! |
Beta Was this translation helpful? Give feedback.
-
Also sort of related to this topic because it might change prioritites. Has the recent announcement from MS that moving forward the IL of choice for DX12 applications will be SPIR-V change anything? I don't know the intricacies of DX specific SPIR-V vs Vulkan SPIR-V. But it sounds like it might make things easier in the future by getting two APIs to share 1 IL |
Beta Was this translation helpful? Give feedback.
-
Apologies if this has been asked elsewhere, I did a search and couldn't find anything.
The more I use Slang the more I want to be able to use it for all code in an application, with a proper main function and standard library. Writing shaders in Slang is just way simpler and more enjoyable an experience than basically any of the other languages, but then having to go back to C/C++ (or realistically any language that support the graphics API the user wants to use) is kinda a chore.
If the language itself focused on including the sort of things that GPU APIs need, like pipelines, memory management, and maybe even file management (e.g. on platforms that support direct to GPU loading, having that done automatically in the background would be excellent), I think it would be head and shoulders above anything else in the GPU programming space. Another thing I can think of is things like alignment and extending the already very good automatic bindings since the compiler could be designed to know all the information on both the CPU and GPU side of the program to tie those together automatically
It would be great if we had a true 1 language solution with a project management tool (think Cargo for Rust) that allows the user to write a whole application in Slang, and then just like slangc does now where it compiles the source to something else like SPIR-V or DXIL for runtime, it would transpile the non-GPU parts of the code to something like C or C++. E.g.
slang-proj build --windows
would make a C++/DX12 application and use DirectStorage on devices that support it, butslang-proj build --linux
on the same code would make a C++/Vulkan and potentially use the NV GPU decompression layerI realise that this isn't a small or easy task and there's a whole list of things that should be considered before an implementation could even begin. I just wanted to know if this has been considered by anyone on the time/ruled out already.
Beta Was this translation helpful? Give feedback.
All reactions