Has anyone ever made a fashion of stack machine that executes
at compile time, using C++ metaprogramming?
This would be a runtime example of the type of simple machine I'm
talking about:
<
http://gameprogrammingpatterns.com/bytecode.html>
Example application would be on say a resource-limited embedded
processor controlling a graphic display where a "script" for the
animations, etc, a script sort of like Macromedia/Adobe Director, is
written by a (possibly not C++-saavy coder) using a stack-machine-type
language like Forth. And then where that VM code is evaluated at compile
time, and itself "compiles" into a sequence of more primitive C++ API
calls which are then statically linked into the main code to produce the
result.
Another example might be an implementation of Logo:
https://en.wikipedia.org/wiki/Logo_(programming_language)
where the Logo-language-stuff is evaluated by the compiler and at
run-time the actual image is generated by a sequence of primitive
drawLine calls to a low-level API.