Foreign Code

Embed some foreign code into an external DSL to provide more elaborate behavior than can be specified in the DSL.

By definition, a DSL is a limited language that only does a few things. Sometimes, however, you need to describe something in the DSL script that is beyond the capabilities of the DSL. One solution may be to extend the DSL to handle this capability, but taking this path may significantly complicate the DSL, removing much of the simplicity that makes it appealing.

Foreign Code embeds a different language—often, a general-purpose language—into certain places in the DSL.

For more details see chapter 27 of the DSL book

| Catalog of DSL patterns |