IKOS: Static analyzer for C/C++ based on the theory of Abstract Interpretation
github.com
github.com
It's not completely turn key if you use it for a cross compiled code base, but once set-up I prefer it to another professional tool: much less false alarms. Although it's good to have both, each one found issues not seen by the other.
[1] https://github.com/Ericsson/codechecker
[2] https://clang-analyzer.llvm.org/
[3] https://github.com/Z3Prover/z3I really envy productivity people using more "dynamic" languages have had over C/C++ developers just because of tooling. Of course, each language is like a tool tailored for a more adequate domain and I'm sure better tooling wouldn't magically fix all of old languages' traps. Nevertheless I miss it.
I should also note there used to exist some great tooling that failed in the market, because they were too soon with heavy hardware requirements.
Energize C++ and Visual Age for C++ version 4.
I'm glad there are good front-ends to the llvm language server though and that static analyzers are slowly improving and becoming more popular even to the sporadic hobbyist.
I will never understand why clang and GCC extensions are considered part of C or C++, while other compilers aren't.
Refactoring exists for 20 years in Visual Studio with plugins like Visual Assist.
The tools I mentioned as ahead of their time allowed for a Lisp Machines or Smalltalk like experience for C++, respectively.
By your definition.
> I will never understand why clang and GCC extensions are considered part of C or C++, while other compilers aren't.
Didn't say so.
> Refactoring exists for 20 years in Visual Studio with plugins like Visual Assist.
That one is new for me. Didn't know it. Would love to have it not locked to a single proprietary non multi-platform IDE.
> The tools I mentioned as ahead of their time allowed for a Lisp Machines or Smalltalk like experience for C++, respectively.
And they didn't succeed, become popular and were mostly completely unreachable to the sporadic hobbyist.
Once you have
#ifdef FOO
...
#else
...
#endif
you have to completely preprocess the compilation unit to find out which branch is taken. That means you have to interpret the build script (which may do -DFOO, possibly only for some compilation targets)You have to do that even for such simple things as syntax coloring. Now, you say “I simply parse both branches, check what things they define, somehow merge the two, and we’re good to go”. That won’t work, as the not taken branch(es) need not contain valid C/C++, and their validity may depend on whether other branches are taken.
the preprocessor also has concatenation (https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html). That makes writing a refactoring tool as good as impossible (for example, how do you rename quit_command to commandExit in the example on that page?)
Now, lots of code is fairly reasonable in its use of the preprocessor, but writing a reliable tool is a lot harder, if it’s possible at all, than with Java.
Like, this static analyzer looks interesting but 5 years ago clang --analyze had no trouble producing me a nice html indicating the 27 steps across 6 functions that lead to a pointer being dereferenced after being deleted. Tooling is there but it seems that pretty much no one is aware of it - see e.g. this: https://github.com/cpp-best-practices/cppbestpractices/blob/... or this: https://github.com/fffaraz/awesome-cpp for a quick look at what exists (and both are very non-exhaustive).
Maybe my feeling is wrong, but I always had a feeling that more "modern" more "dynamic" languages implemented development tools faster or even before the same features became available and popular for C/C++.
In the C++ world, although I am not experienced enough, so take my words with a pinch of salt, there is more fragmentation for the tooling part. AFAIK, there is not a single "community" saying "this is the recommended way". Scala had (and still has) for a long time a very similar issue: lots of tools popping up left and right, lots of "experiments" become production-ready stuff. Then after several years, they decided to face the issue and proposed a centralized place (scalacenter) to offer some sort of "official" support. It's not "finished" yet, but it's a good move into the right direction which will only help adopt the language.
My experience so far with C++ has been a little bit different: you have a lot of different tools, very good ones, so you're undecided which one to use, but finally thanks to the books/resources you read, you'll eventually stick to some of them: it's decentralized and community-based (like other languages) vs [very] centralized (go/rust). It's two different philosophies, and from my understanding, C++ tries very hard NOT to enforce anything on the developers, which can be a burden for newcomers because there is just too much to learn. A stupid example: I use clang-format/clang-tidy: which style am I supposed to use to format the code? I am freaking new, "just pick whatever you want", but hey the default is "none".
Also, by their very nature, dynamic languages offer less information at development time about things such as types and function signatures, so very often IDEs can't even tell you the type associated with a name by hovering over it.
It goes against the principle of "crash-only recovery" to try to recover from a bad state instead of being able to start over from the beginning.
Fair enough. I did say "some of the best debuggers I've used". I've never used Common Lisp. I have no idea what the debugging experience is like on it.
Incidentally, I don't find edit & continue to be a terribly useful feature.
>I'm not even sure they've caught up on class redefinition and instance upgrade at runtime yet, which has been supported in CL since the 1980s.
That has nothing to do with the tooling, though. C++ just doesn't support those features. You also say "caught up" as if committee members had been trying to add those features to C++ but just hadn't been able to. It's much more likely that there hasn't been enough (or any) interest to add them.
In principle I don't see how language definition not supporting this would make this entirely impossible. It's just not possible to ask for such a running program transition to be requested from within the language, but with some modest restrictions on program behavior this might be possible to request from within the IDE. The restrictions I imagine to be similar to the restrictions that would enable C++ code to be subject to code-agnostic tracing GC, such as no user-defined XOR-linked lists.
Visual Age for C++ v4, a Smalltalk like experience.
Live++ used by Unreal.
Edit-and-Continue has been replaced by hot reload on VS.
For example there were some tools Mozilla maintained: Elsa, pork, treehydra etc but (as far as I can quickly find on my phone) it looks like the burden of maintaining them proved too much a while back.
The bigger problem is that in some programmer circles there seems to be an "ideological resistance" against using debugging tools (e.g. https://lemire.me/blog/2016/06/21/i-do-not-use-a-debugger/), which is frankly baffling to me.
cbmc --bounds-check test.c
test.c function main
[main.array_bounds.1] line 6 array 'a' upper bound in a[(signed long int)i]: SUCCESS
[main.array_bounds.2] line 8 array 'a' upper bound in a[(signed long int)i]: FAILURE
** 1 of 2 failed (2 iterations)
VERIFICATION FAILED
gcc and clang both failed to find anything at compile-time.Is anyone familiar with it? Is it OSI certified? (it's not on the OSI's site).
I don't know about you all, but I get a bit scared when people tell they're basing what they're doing to me on some kind of abstract interpretations :-(