Nice!
C, The Beautiful Language
11–20 of 85 posts
Re: C, The Beautiful Language
#12C is more a description of a Harvard machine than a von Neumann machine. In fact, a useful new language feature would be dynamic generation of machine code.
Re: C, The Beautiful Language
#13This is a nicely written tribute, but there are two generalisations that I feel are worth pointing out. Many parts of Linux kernel are really, really nice C code. Sadly, in my experience most C code is not especially nice. I don't know how this extends to the football metaphor, but certainly I wish most of the C code I have encountered (not to mention written) in my career to date was one tenth as neat. On balance, I…
Re: C, The Beautiful Language
#14Earlier quoted context omitted.
Of course this isn't a feature of the language -- but most implementations (e.g. gcc) technically allow this, if you really, really know what you're doing. For example: http://www.cesarbs.org/blog/2010/07/19/run-time-machine-code...
Yes, you can generate machine code yourself, but then you have to write machine code ... I'm suggesting a JIT compiler as a built-in language feature so that you could write code in a high-level language and have machine code generated that was specialized based on the program's dynamic state. It could be done as a library, but it would benefit from language integration so that you wouldn't have to write the code as…
"With libtcc, you can use TCC as a backend for dynamic code generation." from http://bellard.org/tcc/
Re: C, The Beautiful Language
#15> In other languages, the abstractions and sweet (if helpful) syntactic sugar that attend the code conceal the heartbeat. IMO, that means they're failed abstractions and syntactic sugar. Proper ones should result in better understanding due to simplification - you can learn it in levels, easily encapsulating the knowledge at each level so you know you can "trust" what it's doing without having to remember all of it.
As such, any abstraction or syntactic sugar that distances you from the flow of the program fail. Bu that's for programs that are procedural. Functional programming has no flow. Truth neither moves nor changes. To use an analogy, a procedural program is like music, where rhythm and motion of the instrument are the essence of what you are representing. Functional programming is more like sculpture, where you create an…
Interesting that it still seems to apply, though. If your abstractions in functional programs obscure that flow, they still strike me as a failure. Though I'd be interested in if functional programmers would disagree, I obviously don't know functional design patterns.
Re: C, The Beautiful Language
#16> we watch Ronaldo doing things on the pitch Hmmm... Lionel Messi does crazy things you never thought were possible. He's Lisp. Gareth Bale has few fancy tricks, but does what he does very well, and often relies on pure speed - C. Joey Barton is good, but has a bad reputation and a sordid history - Fortran? Etc :-)
I hope he meant Brazil's Ronaldo circa 2002 :)
Re: C, The Beautiful Language
#17C is more a description of a Harvard machine than a von Neumann machine. In fact, a useful new language feature would be dynamic generation of machine code.
Re: C, The Beautiful Language
#18This is a nicely written tribute, but there are two generalisations that I feel are worth pointing out. Many parts of Linux kernel are really, really nice C code. Sadly, in my experience most C code is not especially nice. I don't know how this extends to the football metaphor, but certainly I wish most of the C code I have encountered (not to mention written) in my career to date was one tenth as neat. On balance, I…
Re: C, The Beautiful Language
#19In my experience it is more 'fun' to write C code then to lay down yet another line of boiler-plate high level code. However, it seems to take longer to get things done and the resulting code is also much more error-prone (at least my code that is).
Re: C, The Beautiful Language
#20This is a nicely written tribute, but there are two generalisations that I feel are worth pointing out. Many parts of Linux kernel are really, really nice C code. Sadly, in my experience most C code is not especially nice. I don't know how this extends to the football metaphor, but certainly I wish most of the C code I have encountered (not to mention written) in my career to date was one tenth as neat. On balance, I…
What are some specific examples of beautiful C code in your view? Asking for a friend.
The code is very readable, follows good style guidelines, and has its fair share of brilliant workings. I found that the source code served as much better documentation than a lot of _actual_ documentation that I've read.