Remix.run Logo
swyx 14 days ago

why is that impt to you? just trying to understand the problem you couldnt solve without a C-like

ryao 14 days ago | parent | next [-]

I want to write C code, not C++ code. Even if I try to write C style C++, it is more verbose and less readable, because of various C++isms. For example, having to specify extern “C” to get sane ABI names for the Nvidia CUDA driver API:

https://docs.nvidia.com/cuda/cuda-driver-api/index.html

Not to mention that C++ does not support neat features like variable sized arrays on the stack.

pjmlp 13 days ago | parent [-]

A neat feature that is so neat Google paid to get it irradicated from Linux kernel, and became optional after C11.

ryao 10 days ago | parent [-]

I think you replied to the wrong person.

kevmo314 14 days ago | parent | prev [-]

A strict C variant would indeed be quite nice. I've wanted to write CUDA kernels in Go apps before so the Go app can handle the concurrency on the CPU side. Right now, I have to write a C wrapper and more often than not, I end up writing more code in C++ instead.

But then I end up finding myself juggling mutexes and wishing I had some newer language features.