Many people's initial reaction to coNCePTuaL is that the English-like syntax is excessively verbose and makes a coNCePTuaL program longer and more tedious to type than the corresponding C program. In fact, because coNCePTuaL has richer, higher-level semantics than C, a coNCePTuaL program is typically much shorter than its C counterpart. Let's consider the core of the wavefront program, the part that performs all of the communication operations:
When expressed in C and using MPI as the communication library the preceding code looks like this:
…and that doesn't even include all of the variable declarations and initializations! Unlike the coNCePTuaL code, the C code has to explicitly post a matching receive for every send; and, it has to ensure that it neither sends to nor receives from a nonexistent task.
Which requires less typing? To be fair to C, let's compare versions of those two code excerpts with all unnecessary spaces removed:
versus
(If you make your browser window really, really wide or make the font size really, really small the C code will appear as a single line that contains only one space, between else and if.)
Let's see which language requires less code to express a wavefront communication pattern:
Metric | C | coNCePTuaL |
---|---|---|
Statements | 6 | 2 |
Tokens | 158 | 45 |
Characters | 432 | 170 |
And the winner in all categories is…coNCePTuaL! In case you're still not convinced, take a look at the complete wavefront program written in C. C requires the programmer to include header files, declare variables, allocate memory, compute performance statistics, and include various other bits and pieces of code. None of these requires much code by itself but they add up to a total program length much greater than the equivalent coNCePTuaL program.
Remember, though, that coNCePTuaL is a domain-specific language. It's designed to reduce the effort of writing robust, portable tests of network performance. However, that's all that coNCePTuaL does; hence, you shouldn't think of it as a replacement for a general-purpose language like C but rather as a useful complement to it.
As an aside, coNCePTuaL provides some limited support for executing non-coNCePTuaL code. If you're using a C-based compiler backend (such as the C+MPI backend) this means that you can include C statements within a coNCePTuaL program as follows: