Hi Bianca,
On excessive namespacing:
If we have to load a "package" (or rather: add a namespace) to use Sin
or Pi
, that would be just ridiculous. I fully agree. Python does it, but Python is a general purpose language. Mathematica is used in a different way most of the time.
Also, namespacing doesn't have to be as fine grained as in Python. What I envision is something like this: There should be a (still large) core language which lives in System`
. Major areas of functionality, such as image processing, control systems, even geometric regions, etc. should live in their own separate namespace. They would still be builtins, implemented in the kernel itself, but they will have their own context.
Now the most controversial point will be this: should these contexts be in $ContextPath
by default or not? Some will say yes, some no. But either way, they wouldn't conflict with packages anymore because when we do BeginPackage["Pack`"]
, $ContextPath
gets set to {"Pack`", "System`"}
, and this extra functionality (image processing, etc.) would be available to use for the package author within the package unless he explicitly requests it using something like BeginPackage["Pack`", {"ImageProcessing`"}]
.
So a possible solution could be that:
- every function is available by default for interactive use, without adding contexts/namespaces
- package authors do need to add these extra contexts explicitly; but at the same time they don't need to worry about conflicts with namespaces they don't add
About a package repository:
Again, I fully agree that having this would be great. But to set this up as a community project, and actually make it successful, is very, very difficult. Somebody could step up and create such a repository, but will it become popular? Will people put their package in the correct format to work with a special installer? The challenge is to convince people to use the repository and its package format.
That's why I think the initiative should come from Wolfram Research. There should be an officially endorsed, well documented package format and Mathematica should have a built-in installer accessible both through the existing File -> Install... and programmatically. Actually there is already a package format (see PacletInfo.m
used in standard packages), but most of it is not documented. The most important bits, such as versioning, dependencies, etc. are not public.
There have been efforts to make something like this. Leonid Shifrin has his ProjectInstaller package, which has a lot of nice functionality. This is the idealistic approach, it wants to be complete and it defines its own package format with dependencies, etc. But it didn't really catch on.
There are other, more practically-minded solutions like Rolf Mertig's MathematicaPackageInstall tool, which will just unzip something.
When PackageData.net was launched, some people said that it should really act as a repository too, with auto-installable packages that handle dependencies, etc. (like Python's pip and pypi). And that would be great, but if we want to do all that, then PackageData just wouldn't happen as a community project. As a Wolfram-supported project, yes, but as something done by one guy in their spare time, very unlikely.
My hope was that if PackageData is launched in its current form, it could gradually grow and get more popular, and eventually get all these extra features.
But realistically, such an effort, completely with a versioned, dependency handling package format, has to come from Wolfram if it is to catch on.