Live data from Hacker News

Block rewriting with Clang

techtalk.intersec.com

11–20 of 23 posts

Re: Block rewriting with Clang

#11
I remember reading an article a few years ago from, if I remember correctly, Coverity. One of their challenges for customer acceptance was that many organizations write invalid code that is preprocessed in custom ways. This means that Coverity can't understand the code to analyze it. In all cases, the default customer result is to say that the tool is useless. Doubly so if the invalid bit is buried deep in the system where few of the developers go.

To compensate, they had to build a robust capacity to recognize invalid syntax, and work around it to analyze the parts that they could analyze.

The described block rewriting extension is a perfect example of what threw them.

Another amusing challenge that they encountered is that they could correctly report on complex race conditions, but the developers who created those race conditions tended not to understand the problem reports. The result is that the engineer would wrongly become confident that the tool was crap. The "solution" was to deliberately not report provable bugs!

If this is enough to trigger anyone else's memory of an article that was going around 4 or 5 years ago, I'd love to read it again. :-)

Re: Block rewriting with Clang

#12
post #6
post #5

Earlier quoted context omitted.

What language would you happen that has both ridiculous portability (you can use it from any language) and performance? Sounds like a fairy tale to me.

Languages such as Go, Rust or Swift aim to fill that gap, but in 2010 they were either nascent or simply inexistent.

I'm not sure that Swift belongs on that list. It was announced back in June and there still no compiler for any non-Apple platforms. It's safe to say, at this point, that portability isn't one of Swift's goals.

Re: Block rewriting with Clang

#13
post #11

I remember reading an article a few years ago from, if I remember correctly, Coverity. One of their challenges for customer acceptance was that many organizations write invalid code that is preprocessed in custom ways. This means that Coverity can't understand the code to analyze it. In all cases, the default customer result is to say that the tool is useless. Doubly so if the invalid bit is buried deep in the system…

This? http://cacm.acm.org/magazines/2010/2/69354-a-few-billion-lin... http://web.stanford.edu/~engler/BLOC-coverity.pdf

Re: Block rewriting with Clang

#15
post #5
post #2

While kudos to getting this to work, seems like a huge amount of effort and voodoo when instead one could have used a different language in the first place.

What language would you happen that has both ridiculous portability (you can use it from any language) and performance? Sounds like a fairy tale to me.

C++

Re: Block rewriting with Clang

#16
I don't get it, they are interested in closure and have a codebase in C, why not simply using C++11 with lambda? This would make the code portable to GCC/MSVC... Arguably they started before C++11 was officially released, but clang and gcc supported lambda before the official release, and also since then they could have used a rewriter to transform their blocks into lambda to help for the conversion.

Re: Block rewriting with Clang

#17
post #10
post #6

Earlier quoted context omitted.

Languages such as Go, Rust or Swift aim to fill that gap, but in 2010 they were either nascent or simply inexistent.

D? why does everybody hate/ignore D?

Interesting question. I'm not intimately familiar with D, but it does seem like it's designed as a saner alternative to C++. How many C++ alternatives are out there? From my memory D seemed like one of the first major attempts to get away from C++. Maybe they didn't go far enough to meet peoples expectations. Or maybe they were too far ahead of their time.

Anyway, when you said that the first thing that popped into my mind was Ewan McGregor going all "you were the chosen one" and actually I think that kind of describes my feeling about D. At first it sounded very exciting, but then it seemed like there really wasn't a payoff and I ended up feeling kind of bleh about it. I wonder how many other people feel similarly. Maybe D's problem is kind of an emotional one?

Re: Block rewriting with Clang

#19
post #5
post #2

While kudos to getting this to work, seems like a huge amount of effort and voodoo when instead one could have used a different language in the first place.

What language would you happen that has both ridiculous portability (you can use it from any language) and performance? Sounds like a fairy tale to me.

C++ has lambda and std::function.

Re: Block rewriting with Clang

#20
post #6
post #5

Earlier quoted context omitted.

What language would you happen that has both ridiculous portability (you can use it from any language) and performance? Sounds like a fairy tale to me.

Languages such as Go, Rust or Swift aim to fill that gap, but in 2010 they were either nascent or simply inexistent.

Go: not that performant, unless you're writing network code.

Rust: not even 1.0 stable.

Swift: not cross platform.

Post reply on HN