Cicada is a small interpreted language that plugs into C (or C++) code. That gives you both:
Embedding Cicada into a C program:
Here’s an example:
#include <cicada.h>
ccInt countOddsF(argsType args) // (for positive numbers)
{
ccInt *n, *c, i; // by default, ccInt = int
getArgs(args, &n, &c);
*c = 0;
for (i = 0; i < args.indices[0]; i++) *c += n[i] % 2;
return 0;
}
const char *wrapperScript =
"numOdd :: { n :: [] int, c :: int; n[] = args[1], $countOdds(n, c), return c }";
int main(int argc, char **argv)
{
const Cfunction fs[] = { { "countOdds", &countOddsF } };
return runCicada(fs, wrapperScript, true);
}
Running this program lets us interactively process any data we want. And since the counting is done in C, it’ll run fast even on a huge dataset.
> numOdd({ 3, 5, 6, 7, 8 })
3
> if numOdd(bigList) > 1e6 then ...
Last update: November 12, 2025