> Ah, C. Still the language of modern high-performance computing. Yet its major compilers are written in C++ nowadays, and C++ is the main language for GPGPU computing, including the memory model used by NVidia on their cards. I suggest some benchmarks updates to the author.
CUDA kernels look very much like C, you cannot use the STL and a bunch of other things. For practical purposes, it is C.
Learn C in Y Minutes
51–60 of 81 posts
Re: Learn C in Y Minutes
#52As a web developer, who mostly spends time with Go and Python, is there any benefits of learning C?
C is a low level language that compiles down directly to assembly. It is similar to Go in this regard, but is a bit lower level. You have to manage memory yourself and pointers in C are much more dangerous. Reasons to learn C would include: absolute performance needed maybe for say a Python C extension, kernel hacking, some other project you want to contribute to uses C. I think it’s good to at least play with C and…
Directly to machine code, not assembly.
Re: Learn C in Y Minutes
#53I wonder if there even is a language where something like this IS required. Most of the languages I know are case-sensitive yet the case doesn't mean anything specific in any of them, the case seemingly always is a matter of style.
Re: Learn C in Y Minutes
#54Earlier quoted context omitted.
Writing correct C is REALLY hard and slow (strings, manual memory management, concurrency pitfalls). So the investment is not paying off unless you are writing highly performance critical backend services. What can pay-off is learning to read C. Node.js, Firefox, Postgres, Linux are all written in C/C++ so if you ever want to really understand what's going on or have to debug a nasty bug, then you will need to be abl…
> So the investment is not paying off unless you are writing highly performance critical backend services. You took it too far. C opens the door for today's embedded, like, you know, blinking an LED with some microcontroller.
Re: Learn C in Y Minutes
#55Earlier quoted context omitted.
For someone planning on learning C in the next couple of months (through K&R), do you have any advice on where to learn best modern practices afterwards?
I like Effective C: An Introduction to Professional C Programming https://nostarch.com/Effective_C but I would since I wrote it.
My sincere thanks for the book.
Re: Learn C in Y Minutes
#56My takeaway from this thread is that C programmers are completely insufferable.
Re: Learn C in Y Minutes
#57As a web developer, who mostly spends time with Go and Python, is there any benefits of learning C?
C is a low level language that compiles down directly to assembly. It is similar to Go in this regard, but is a bit lower level. You have to manage memory yourself and pointers in C are much more dangerous. Reasons to learn C would include: absolute performance needed maybe for say a Python C extension, kernel hacking, some other project you want to contribute to uses C. I think it’s good to at least play with C and…
Re: Learn C in Y Minutes
#58> Constants are written in all-caps out of convention, not requirement I wonder if there even is a language where something like this IS required. Most of the languages I know are case-sensitive yet the case doesn't mean anything specific in any of them, the case seemingly always is a matter of style.
Re: Learn C in Y Minutes
#59Earlier quoted context omitted.
CUDA kernels look very much like C, you cannot use the STL and a bunch of other things. For practical purposes, it is C.
To be fair, C++ just brings over templated wrappers around battle-tested C CUDA libraries like cuDNN, cuBLAS, etc.
https://www.youtube.com/watch?v=VogqOscJYvk
Future of ISO and CUDA C++
https://developer.nvidia.com/gtc/2020/video/cwe21284-vid
Thrust, the CUDA C++ template library
https://docs.nvidia.com/cuda/thrust/index.html
Optix, single-ray shader programming model using C++, and ray Tracing acceleration using RT Cores.
https://developer.nvidia.com/optix
Phew, so many wrappers yet to list.