Thoughts on making Slang a "full language" #5039
LouChiSoft
started this conversation in
Ideas
Replies: 2 comments 3 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.
3 replies
-
I'd love to hear @tangent-vector's thoughts on this! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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