C
ccrabfo
Has anyone ever implemented embedding a "virtual host" or "virual machine"
environment inside your C/C++ programs so that end-users could write small
snippets of customized code, compile it using your custom compiler, and if
the compiled byte-code file exists, it gets loaded and ran by the embedded
virtual host engine?
My thought was to develop a basic-like compiler system that the user could
write a file called TASKA.MSC which looks like:
// File: TASKA.MSC
// Simple Task A Example
Dim userdata as TUserData
Clear userdata
if GetUserData(userdata) then
// do something with the data
// specific to this end-user install
end if
Then run this through my compiler:
mysc.exe taska.msc
This would create something like taska.mxc which is a compiled byte-code
binary file of the instructions found in the 4GL base source file. The
virtual host environment would be inclusive inside my program or a DLL which
basically is a virtual machine environment that loads the MXC file, and runs
the binary version instead of having to verify the 4GL syntax, compile it,
and then run it. All the virtual environment does is execute it (very much
like java and its JVM).
Anyone have any thoughts on:
1) How to create such a compiler
2) How to create the host environment to execute the compiled binary?
Thanks
--
environment inside your C/C++ programs so that end-users could write small
snippets of customized code, compile it using your custom compiler, and if
the compiled byte-code file exists, it gets loaded and ran by the embedded
virtual host engine?
My thought was to develop a basic-like compiler system that the user could
write a file called TASKA.MSC which looks like:
// File: TASKA.MSC
// Simple Task A Example
Dim userdata as TUserData
Clear userdata
if GetUserData(userdata) then
// do something with the data
// specific to this end-user install
end if
Then run this through my compiler:
mysc.exe taska.msc
This would create something like taska.mxc which is a compiled byte-code
binary file of the instructions found in the 4GL base source file. The
virtual host environment would be inclusive inside my program or a DLL which
basically is a virtual machine environment that loads the MXC file, and runs
the binary version instead of having to verify the 4GL syntax, compile it,
and then run it. All the virtual environment does is execute it (very much
like java and its JVM).
Anyone have any thoughts on:
1) How to create such a compiler
2) How to create the host environment to execute the compiled binary?
Thanks
--