There are 4 file types use the .M file extension:
- Objective-C Implementation File
- Mercury Source Code File
- MATLAB Source Code File
- Mathematica Input File
1. Objective-C Implementation File
An M file is a class implementation file used by programs written in Objective-C. It begins with the @implementation directive and initializes variables and functions that can be referenced by other Objective-C source files. M files may also reference header (.H) files.
Objective-C is most commonly used to implement applications for Apple's Mac OS X and iOS operating systems. Apple's Cocoa API provides the Objective-C programming interface for Mac OS X, and the iOS API provides the programming interface for the iOS platform.
Updated: May 8, 2016
2. Mercury Source Code File
Source code file written using Mercury, a functional programming language that was developed at the University of Melbourne, Australia; saved using plain text formatting and uses syntax similar to Prolog.
Mercury was written in order to provide a robust language for large real world applications. It includes several error-checking features not provided by other logic programming languages. For example, the language incorporates static analysis that can catch type checking errors before runtime. This enables greater assurance over the correctness of the program and also allows the compiler to generate more efficient code. However, the developer must specify each of the "type," "mode," and "determinism" constructs while programming, which is not necessarily required by other languages.
NOTE: The developmental version of the Mercury compiler is currently distributed in a source code format and does not include compiler binaries. However, a Windows port of Mercury, called winmercury, includes binaries. It also includes Vim syntax highlighting files for source code editing.
Updated: July 21, 2011
3. MATLAB Source Code File
An M file is a text file used by MATLAB, an application used for mathematical computations. It can store a script, class, or an individual function in the MATLAB language. M files are used for executing algorithms, plotting graphs, and performing other mathematical operations.
Updated: September 22, 2017
4. Mathematica Input File
Contains functions or a set of instructions used by the Mathematica, a program for creating and running mathematical functions; saved in a text format, which can be viewed and edited with a basic text editor.
Files named "init.m" are initialization files that contain settings that are loaded when the Mathematica program is opened.
Updated: February 21, 2011