The problem that took him 5 years to fix in C++, I solved in a minute with D

Bruce Carneal bcarneal at gmail.com
Fri Mar 11 09:37:41 UTC 2022


On Friday, 11 March 2022 at 06:41:37 UTC, Paulo Pinto wrote:
> On Friday, 11 March 2022 at 04:03:50 UTC, Nicholas Wilson wrote:
>> On Thursday, 10 March 2022 at 15:49:36 UTC, Paulo Pinto wrote:
>>> C# metaprogramming is called T4 templates, Roslyn plug-ins, 
>>> compiler attributes, reflection and code generators.
>>>
>>> Are they clunkier than D?
>>>
>>> Surely, however C# comes with Unity (what happened to 
>>> Remedy?), Orleans, CUDA (including GPGPU debugging), IoT 
>>> (Meadows), Cloud SDKs for GCP/AWS/Azure, Blazor, Uno, 
>>> MAUI,....
>>>
>>> D, well it has MIR and vibe.d, that is about it.
>>
>> I feel compelled to mention dcompute here as a competitor for 
>> CUDA. It is a substitute for the kernel language and the 
>> runtime is just as easy to use. It can run on CUDA ( as a 
>> backend) so all the same tools will work including debugging 
>> (modulo probably demangling support).
>
> What is dcompute answer to Hybridizer alongsiside Visual Studio 
> and Nsights?
>
> https://developer.nvidia.com/blog/hybridizer-csharp/
>
> https://developer.nvidia.com/nsight-visual-studio-edition

I enjoyed the pretty graphs and summaries produced by Nsight back 
in my CUDA days but I was then, and still am, more interested in 
the leverage provided by language directly.

That said, we can add tooling, and we should.  For all I know 
hooking dcompute code into Nsight, for example, may be as easy as 
running under a C++ main and linking with nvcc.  I plan to pitch 
in on dcompute myself after the current project and enabling 
Nsight seems like a good place to start (maybe someone has 
already done it, I've not looked for it...)

dcompute can be improved but in my experience it is, already, 
head and shoulders above C++ when it comes to producing readable, 
performant, kernels quickly.  OTOH, if you're a total tool fanboy 
you're probably better off with something else, at least for now.

I've not tried Csharp on GPUs, hybridizer or otherwise.  Was the 
GPU meta programming capability there not too "clunky"?  How did 
your performance compare to well crafted C++/CUDA implementations?



More information about the Digitalmars-d mailing list