Packages vs. modules
The possibility of writing packages introduces a second form of libraries for Mosel, the first being modules (see the `Mosel Native Interface User Guide' for further detail). The following list summarizes the main differences between packages and modules.
- Definition
  - Package
    - library written in the Mosel language
 
- Module
    - dynamic library written in C that obeys the conventions of the Mosel Native Interface
 
 
- Package
    
- Functionality
  - Package
    - define
      - symbols
- subroutines
- types
 
 
- define
      
- Module
    - extend the Mosel language with
      - constant symbols
- subroutines
- operators
- types
- control parameters
- IO drivers
 
 
- extend the Mosel language with
      
 
- Package
    
- Efficiency
  - Package
    - like standard Mosel models
 
- Module
    - faster execution speed
- higher development effort
 
 
- Package
    
- Use
  - Package
    - making parts of Mosel models re-usable
- deployment of Mosel code whilst protecting your intellectual property
 
- Module
    - connection to external software
- time-critical tasks
- definition of new I/O drivers and operators for the Mosel language
 
 
- Package
    
As can be seen from the list above, the choice between packages and modules depends largely on the contents and intended use of the library you wish to write.
 
