48
$\begingroup$

In Mathematica 10.x, one now has both .wl Wolfram Language Packages and .m Wolfram Mathematica Packages.

  • What's the difference?
  • Is one of the two formats to be preferred in certain situations and, if so, which one and where?
  • Why, after making the menu selection File > New > Package, entering code, and saving, is it offered as default to save in the .wl format?

I have read the discussion here, but failed to see there satisfactory answers to those questions.

Note: I don't find any listing of Wolfram Language Package here.

$\endgroup$
  • 6
    $\begingroup$ 1. just the file ending AFAIK, 2. if you have installed matlab (or another software which also uses .m file extension) it is easier to let the OS distinguish between matlab files and mathematica packages, 3. because that now seems to be the extension prefered by WRI, most probably more for marketing reasons than because of 2. My impression is that .m was just left to work for compatibility reasons, but maybe I'm wrong with that... $\endgroup$ – Albert Retey Nov 9 '15 at 15:11
  • 3
    $\begingroup$ it seems that there are differences in the order in which package files are loaded (check the wolfram groups discussion mentioned in your question). But that will probably only be relevant when you mix old (.m+Kernel/init.m) and new (.wl only) conventions... $\endgroup$ – Albert Retey Nov 9 '15 at 15:16
  • 2
    $\begingroup$ one more thing: it seems that workbench still doesn't know about .wl files, but maybe I just don't know how to get the most recent version, does anyone know what the newest is? The update site announces 2.0.138 to be the newest for years... $\endgroup$ – Albert Retey Nov 9 '15 at 15:42
  • 3
    $\begingroup$ avoiding collision with matlab is a very good / welcome reason! $\endgroup$ – george2079 Nov 9 '15 at 18:20
  • 5
    $\begingroup$ Currently all descriptions involving packages in Wolfram Language Documentation use files ending with .m instead of .wl, which is quite weird. $\endgroup$ – Han Xiao Nov 15 '15 at 5:47
18
$\begingroup$

As after half a year there is still no answer, here are some very short answers from my comments:

  1. the difference is just the file ending as far as I know.

  2. if you have installed MATLAB (or another software which also uses .m file extension) it is easier to let the OS distinguish between MATLAB files and Mathematica packages.

  3. because that now seems to be the extension preferred by WRI, most probably more for marketing reasons than because of answer 2. My impression is that .m was just left to work for compatibility reasons, but maybe I'm wrong with that...

Despite answer 1. there is obviously a new problem when Mathematica needs to load a package and there are both a .m and a .wl file with the same name. It seems that there are differences in the order in which package files are loaded and that has seen some changes at least in early 10.x versions (check the Wolfram Groups discussion mentioned in your question). But that will probably only be relevant when you mix old (.m) and new (.wl) conventions which is something you obviously should avoid.

One more difference is the support within the Workbench which still doesn't know about .wl files. But maybe I just don't know how to get the most recent version, does anyone know what the newest is? The update site announces 2.0.138 to be the newest for years (still true in June 2016)...

$\endgroup$
  • $\begingroup$ I am agree with your second viewpoint, so I didn't install the MATLAB on my laptop. In addtion, the recent Workbench version I think is V3.0, because I achieved a copy from my friend. Please see here $\endgroup$ – xyz Jun 4 '16 at 11:11
  • $\begingroup$ @ShutaoTANG: I know that V3.0 of Workbench exists and is used by WRI internally since many years. The problem is that it still seems to not be officially released according to official product site $\endgroup$ – Albert Retey Jun 4 '16 at 13:28
  • $\begingroup$ I have installed the V3.0 (64bit) on my working PC, unfortunately, that PC is 32bit, so it @Albert Retey cannot be used normally. In addtion, I known that the V2.0 cannot debug with the Mathematica 10. $\endgroup$ – xyz Jun 4 '16 at 13:32
  • 2
    $\begingroup$ @ShutaoTANG: I know that V3 exists and is used internally and usually can be received for beta testing form WRI if one asks for it. But that is the state now for years, I'd guess about 2008. My point is that there still is no official release of a newer version than 2.0.138... $\endgroup$ – Albert Retey Jun 4 '16 at 21:14
  • $\begingroup$ To keep this uptodate: Please note this. Workbench is now being supported and continued exclusively as a plugin to Eclispe IDE: Wolrfram Website Information. And as of today, Workbench does not seem to know about any .wl files. So no rebranding for the techies it seems. :) $\endgroup$ – gwr Apr 15 '17 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.