HNHacker News
TopNewBestAskShowJobs

kjhrklewiou

23 karma · joined December 26, 2019

submissionscomments
kjhrklewiou··on I love coding in C
I was talking about stuff like CUDA, not OpenGL.
kjhrklewiou··on I love coding in C
In GPU programming (CUDA for example), every time you allocate memory you need to explicitly specify where (general memory, L3, L2, L1, register). Because C doesn't support this, they added language extensions.

So C is too high level for GPU programming, and needed to be extended.

kjhrklewiou··on I love coding in C
In a way this already happened, with GPU programming, which has a more realistic model of what modern hardware is (explicit memory hierarchy for example).

Because the speed advantage is so huge, people went through the pain of learning this new model and redesigning algorithms to better fit it.

kjhrklewiou··on I love coding in C
> an expensive check+branch on each array access

I'm curious if this still stands in general today, given today's advanced branch predictors and the fact that the CPU tends to be memory-bandwidth-bound, thus you have more "free computation" while waiting for memory (what GPU programmers call compute to memory ratio).

kjhrklewiou··on I love coding in C
I enjoy using C++ from Python through Cython.

This way you can have the speed and memory tightness of C++ where it matters, but do the other stuff, like initial data parsing and munging or overall control and sequencing in Python, thus avoiding the general clumsiness and unproductivity of C++