4 ms·
> The code relies heavily on preprocessor macros and some weird gcc-only syntax that made my head hurt. The preprocessor is generally recognized as one of C's
by luriel 14y ago
> The code relies heavily on preprocessor macros and some weird gcc-only syntax that made my head hurt.
The preprocessor is generally recognized as one of C's biggest flaws, is not for nothing that Ken Thompson, the first C programmer and the greatest influence on the language other than DMR himself, cut down most of the preprocessor when he wrote his own set of C compilers for Plan 9: http://doc.cat-v.org/plan_9/4th_edition/papers/comp http://doc.cat-v.org/plan_9/4th_edition/papers/comp
And of course Go has no preprocessor.
As for your second complaint, one can't blame C for gcc's extensions ;)
You should try Go, many people would consider it C's spiritual successor (or as somebody put it: the language the people who created C would come up if they had 40 years to think about how to polish and improve it), it keeps all the simplicity of C, while being probably the most readable language I have used, it is concise but keeps everything explicit, and figuring what code does is very easy, because code does what it says and says what it does, no dark magic needed.
- jaybill 14y agoI second your thoughts about Go. Much like the author of the post, I was really tired of Java and all the bloat that went with doing most things. I was going to get back into C and I had even blown the dust off my K&R. By random coincidence I saw a post about Go on HN and I've been using it ever since. It's a really great language. It does everything I wanted to get back into C for without any of the things I was dreading.
- eli_gottlieb 14y agoIt keeps all the simplicity of C, without actually being able to write a kernel or device driver!
- 4ad 14y agoYou can write kernels in Go, it even used to ship with a bare metal runtime and several people wrote kernels using it. You cannot easily write device drivers for existing operating systems in Go because the existing operating systems provide a particular environment unsuited for Go and expect certain constraints from the device drivers themselves, constraints which Go breaks. In principle, it could be made to work.