# My Joy Engine

## cpcogan — 2007-01-07 21:50:41

    My Joy engine is an "object" that allows the calling code to use Joy

    as an internal macro or scripting language. Each instance is

    independent of any others, so different dictionaries can be used for

    each, and one instance can be used as a macro language for a Joy IDE,

    so the IDE itself can be extended by the programmer, while the code

    being developed is executed in another instance of the engine. This is

    analogous to using C as a macro language in an IDE for developing

    programs in C.

    I have two source-code interfaces for the Joy engine itself (that is,

    means of passing source to the Joy engine). One takes ordinary source

    code, with directives, comments and such, and processes it, compiling

    code or executing directives as it goes. The other assumes that there

    are no comments, no directives, nothing to confuse a simple interface.

    It won't even do includes. This is intended for quick

    expression-handling, not passing Joy a whole application.

    Of course, the calling code can also access the dictionary and other

    parts of the engine, because virtually all of it is public. This means

    that an application can basically manipulate everything that the

    engine's own code uses, so a calling application can clean out unused

    functions from the dictionary, or set various flags and so on. As I

    get more experience, I will probably write property-wrappers for the

    variables, so that the engine is protected against invalid values

    being given to its internal variables, but, for now, my current

    interfacing seems adequate.