Over a quick lunch break I've made some additions to the VM, mainly in two areas: external DLL calls, and lexical scoping. Lexical scoping and function parameter passing are now solidly in place; it is possible to pass a variable's value into a function.
I also implemented the subtract operation, which permits the following code:
external "user32.dll" MessageBoxW : (integer windowhandle, string message, string caption, integer typeflags) -> (integer)entrypoint : () -> (){ integer(typeflags, 66) string(message, "This is a test message.") string(caption, "Epoch/C Interop Test") if(equal(typeflags, 66)) { assign(typeflags, add(typeflags, 1)) } integer(temp, 0) assign(temp, MessageBoxW(0, message, caption, typeflags)) do { MessageBoxW(0, "Foo", "Bar", 0) assign(temp, subtract(temp, 1)) } while(greater(temp, 0))}
Depending on which button is clicked in the message box, a different return value is assigned into temp, and then that number of iterations of the loop are executed. (I went with a do/while because there's no for loop implemented yet.)
The final bit of glue is to get Epoch functions to be able to accept parameters and return values. I've got a few implementation-level decisions to make before tackling that, so I'll leave it alone for now.
Anyone interested in an interim code release with the new functionality in place? It's now technically possible (although slightly awkward) to write a working Win32 program in Epoch... I'm curious to see it tried.