Hi! On Sun, Oct 9, 2016 at 5:39 PM, Wouter van Ooijen wrote: > Op 09-Oct-16 om 7:50 PM schreef smplx: >> The piclist seems very quite regarding PIC topics lately so I thought I'= d >> try to add something interesting. >> >> Before we get bogged down into which is better assembler or high level >> language consider how you would feel about a compiler that generates cod= e >> that is optimised beyond your wildest dreams. >> >> Imagin that you don't need to resort to sneaky tricks or hand crafted >> assembler embedded in your high level code. That you don't need to >> labouriously generate complicated tables in excel or matlab and then >> painstakingly shoehorn them into you high level code. Imagin that you ca= n >> execute thousands of lines of complex code and have the result available >> in the time it takes to execute a single machine cycle. And better still= , >> imagin you can do all this without having to learn some new complicated >> language. >> >> Basically it comes down to this: the compiler executes as much user code >> as possible during the compilation process and works out the bare minimu= m >> that needs to be executed in the target. > > Are you aware that this is a feature of C++? It was available for a long > time in a rather convoluted form as meta-programming (templates and > SFINAE), extended to plain functions in a limited form in C++ 11 > (single-return-statement functions only), which was generalized in C++ 14= .. > > I don't fully get what you proposed, but in C++ you can use > > constexpr auto x =3D y( ... ); > > which requires that y(...) is evaluated at compile time. Y can be a > function, or an object constructor that creates a complex object. > For a good example of what current C++ compilers can do at compile time, you can see the following video: https://www.youtube.com/watch?v=3DzBkNBP00wJE It's a talk about C64 pong game written in C++. Daniel. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .