Widgets are based on JavaScript. They are not compiled, so no, they are not programs. They're just files that are interpreted by Dashboard.
Application packages (packages are folders that contain a bunch of relevant files, which appear as and act like files in the Finder) have .app extensions. Self-contained applications, like those used in Mac OS 9, don't use file name extensions, but instead use the Mac OS type code "APPL".