Embedding vs. Extending

In the embedding style of Tcl integration, one compiles and links several packages into a single program, so that at program startup, several packages are already available.

One very well known example of the embedding style is the wish program. It is a single program that starts up with the Tcl and Tk packages already provided.

The alternative to embedding is extending.

In extending, you have an existing Tcl interpreter and dynamically load extra packages (whether defined in Tcl, as a loadable library, or as a combination of the two) into it.


This page tries to stay focused on clearly explaining the difference between these two alternatives of integrating Tcl with one or more extensions.

There are lots of pages on the Wiki already that dance around these subjects. Some of them are too overgrown for my taste, and none seems to have the focus intended for this page.

Please choose carefully whether to add more comments here that might better fit in one of these other pages.