"Schuster, Joel (N-Compaq)" wrote:
>
> I was wondering if anyone has heard about something that would allow C++ to be used as a scripting language within an application. I was thinking I might be able to link in g++ functionality within my app or some such. The other thought would be to use createprocess to compile at run time my 'scripts' as dlls. This is something that Gecko! can do ( http://www.thecodeproject.com/cpp/gecko1.asp ) but I really don't like the dependancy on Perl. The key for me is also allowing this to be a cross-platform ability.
Scripting languages are usually interpreted. C++ is not commonly
used for this purpose because it needs to be compiled.
I'm aware of two narrowly domain specific apps that invoke a C++
compiler as you describe. You'd probably want to include some
sort of 'make' facility to avoid recompiling every time a script
is invoked. C++ error messages will often be harder to understand
than a scripting language's, but anyone writing scripts really
ought to know the language used. If you use g++ and stick to the
standard language, it should work on a great number of platforms.
If you're doing floating-point calculations, you'll need to take
some care to get the same results on different platforms.
|