MX (.mx)

Wolfram Language serialized package format.
Used for the distribution of Wolfram Language packages.
Stores arbitrary Wolfram Language expressions in a serialized format optimized for fast loading.
Binary file format.
MX files cannot be exchanged between different operating systems or versions of the Wolfram System.
Developed by Wolfram Research.
  • Import and Export fully support Wolfram Language MX files.
  • Wolfram Language MX files can be created with DumpSave and read with Get.

Import and ExportImport and Export

  • Import["file.mx"] reads in an MX file and returns an expression.
  • Export["file.mx",expr] serializes an arbitrary Wolfram Language expression and saves it as an MX file.
  • Import["file.mx",elem] imports the specified element from an MX file.
  • The import format can be specified with Import["file","MX"] or Import["file",{"MX",elem,}].
  • Import["file.mx"] is equivalent to Get["file.mx"].
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the MX format.

ElementsElements

  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Import elements:
  • "Expression"reads and evaluates all expressions, returning the last one
    "HeldExpression"list of unevaluated expressions
  • Import by default uses the element for Wolfram Language MX files.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Export an arbitrary Wolfram Language expression to the MX format:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input

Show the available Import elements:

In[3]:=
Click for copyable input
Out[3]=

Import as an expression:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 1999
(4.0)
| Updated in 2007
(6.0)