News for hackers. Stuff that matters.
Re:C for Rubyists by agumonkey on Tuesday September 30, 2014 @03:38PM (#8390644)
Very pretty C code. Rarely I find myself thinking 'C is beautiful'
Re:C for Rubyists by skylan_q on Tuesday September 30, 2014 @05:58PM (#8391575)
I thought the same thing. It's like Matz writes C the way he'd like to write ruby. I also see some smalltalk inspiration in his style.

Very neat.

Re:C for Rubyists by agumonkey on Tuesday September 30, 2014 @07:18PM (#8391986)
If I was able to write that kind of C code, I'd never feel the need to use ruby, python maybe even lisp :)
Re:C for Rubyists by TickleSteve on Thursday October 02, 2014 @02:28PM (#8402239)
Sorry, I have to disagree with you there, as someone with decades of C and c++ experience, this is very dense, averagely-tidy, but using some very-definitely-bad-practice macros (See the definition of "SHOW"). C and C++ can look a hell of a lot better than this....
Re:C for Rubyists by pjc50 on Wednesday October 01, 2014 @08:20AM (#8393914)
In what way is it beautiful? I had a look and found it to be covered in nasty #ifdefs.
Re:C for Rubyists by yoklov on Wednesday October 01, 2014 @09:19AM (#8394114)
As someone who has written C professionally in the past, I agree. IMO this is fairly ugly C. Definitely can't see why someone would consider it to be beautiful.

That said, there are some neat things I've seen in the ruby C code in the past. I thought [1] was pretty clever (this pattern shows up several times in the ruby source) the first time I saw it, since it lets you access the members of the union like `foo->as.thing`, which is fairly pretty IMO.

[1] https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#...