New semester in my university started and I am once again "forced" to quit abstractions and explore the deep waters of low level programming in c++
. My mind is already partially contamined with folds, high order functions, etc., and I don't find any fun in writing for example:
bool allEven = true;
for(int i = 0; i < arr.length; i++){
if (arr[i] % 2 != 0){
allEven = false;
break;
}
}
when I know that I can write val allEven = arr forall (_ % 2 == 0)
.My question is: is there any tool|technique|language construct|metaprogramming stuff, that can bring some c++ code without writing it actually? I need to the whole source but it can be eventually obfuscated, only machine is going to process it.
And please don't me accuse of being lazy, I value it as one of my best virtues. :-)
EDIT It's not entirely clear what are you asking for... At best, I would like to use something like
GWT
but instead compiling Java
sources to JavaScript
sources It would compile Scala
or Haskell
or F#
to C++
sources, but since I don't believe that something like this exists, I would like to have something... helpful. I appreciate the suggested anon functions, for example.