Sharing Your Creations Just Got Easier with the Wolfram Language Paclet Repository
Since we released the Wolfram Function Repository in June 2019, we’ve often run into situations where someone wants to distribute content that can’t easily be contained in a single, standalone function. The answer is usually to create a paclet, the Wolfram Language equivalent to what would be called a package in other programing languages. Paclets have been around for quite some time. They are regularly used by Wolfram developers to deliver and update system-level functionality and have been documented since Version 12.1 of Wolfram Language.
It’s also becoming increasingly common for programming languages to have a central repository where users can publish and share their packages. Now, we’re excited to announce a place for our users to do the same: the Wolfram Language Paclet Repository. Until now, sharing bundles of Wolfram Language code had been done on a small collection of sites without a consistent, streamlined system to unify them. Using paclets and the Paclet Repository, our community can find and share any kind of content made to work with Wolfram Language.
But What Are Paclets?
Paclets are a way of packaging units of Wolfram System functionality so they can be easily found, distributed, updated and loaded. Many paclets contain Wolfram Language packages, but a paclet can be as simple as a single documentation notebook, all the way up to a large application with multiple packages, documentation, front end palettes, libraries, etc. Paclets have been used to distribute raw data, functions, stylesheets, palette notebooks and even entirely new use interfaces.
Once installed, a paclet is seamlessly and persistently integrated into your Wolfram Language system. If the paclet provides new functions, they’re ready to be loaded in any future session with a single line of code. If the paclet provides stylesheets or palettes, they can immediately be found in the relevant menus.
Easy to Use
What are the benefits of using the Wolfram Language Paclet Repository? First and foremost, it’s easy to find, install and update content from the repository. Every paclet gets its own set of pages to show all of its documentation and examples. Right on the front page for each paclet, we show the code you need to install it. You don’t need to download files separately and move them around to specific directories—that’s all handled automatically. The paclet is immediately ready for use in the current session as well as all future sessions:
Most paclets deliver functions and symbols for use in your own Wolfram Language code. After installing, the paclet’s Wolfram Language code is only made available and not yet loaded; load it with Needs like any other package. The front page of each paclet will usually include the “Needs statement” used to load its primary content as well.
If you want to try out a paclet but don’t want it to permanently install into your system, we’ve made that easy too. All of the examples in the Paclet Repository are click to copy and use PacletSymbol to access the paclet’s symbols:
On the surface of it, PacletSymbol is just a convenient way to pull up the full name of a symbol:
Under the hood, PacletSymbol does a lot of work in order to make using paclets low impact on your system. It will download the paclet, if necessary, and temporarily make it available in your system. If you quit your session, the system will forget all about the paclet. PacletSymbol will also do the work of calling Needs on the paclet’s context for you, but does so in a way that doesn’t change the $ContextPath. This can be useful if there are multiple paclets that use the same names for their symbols, which is often called “shadowing.”
Reputation, Trust and Security
Unlike the Wolfram Function Repository or the Wolfram Data Repository, submissions to the Paclet Repository do not require review from Wolfram staff before they are made available to the public. That means that trust and scrutiny are important when using paclets from the Paclet Repository. This is part of why we include the developer’s publisher ID in the name of every paclet.
On the main page for each paclet, below the Examples section, you can find a few pieces of information to use when deciding whether to trust the paclet. First is the publisher ID, which is built into the name of each paclet. Each publisher in the Resource System has a page that lists all of their other paclets as other content they’ve published in our repositories:
We also encourage all authors to include a link to their source code. This link can be used to verify the functionality of the paclet. It can also serve as a place where the author may allow others to contribute to their projects:
One feature in the Paclet Repository is the ability to rate a paclet as good and give it a “star.” Over time, this will reveal which paclets are being widely adopted by the community and held in good regard. We’ll be expanding this feature to other repositories in the future:
We also provide a few categories of disclosures that an author can use to tag their paclet. Disclosures are meant to communicate when a paclet may be interacting with files outside of your notebook. A paclet that provides a collection of trigonometric functions, for example, is unlikely to have any disclosures. However, a paclet that creates or edits files should have a “local files” disclosure if the files are on your local system, or “Wolfram Account” if the files are located in the Wolfram Cloud:
We do consider the disclosures to be mandatory, and any paclet using these features of Wolfram Language is expected to let users know about it. If you find any paclet that does not properly disclose these actions, you can report them to be reviewed by Wolfram staff.
When Should I Make a Paclet?
If you’ve ever submitted functions to the Wolfram Function Repository, you might wonder about the dividing line between a function and a paclet. In a lot of cases, the functionality you want can be contained in a single function. For such functions, a paclet would be adding more complexity without much benefit. If you are creating any kind of add-on content for Wolfram products that does not fit into one of our other repositories, you should create it in the form of a paclet.
Creating a paclet is useful when:
- There are multiple interdependent functions
- Supporting files are needed, like images, stylesheets or palette notebooks
- The functions, even if some are independent, should be updated at the same time to stay consistent
How Do I Make Paclets?
The process of making paclets is too large a topic to cover in this post. If you want to write a paclet, we’ve created this document to help you get started creating paclets for the Wolfram Language Paclet Repository. It will introduce you to the basic steps and guidelines for creating paclets that are used whether you are planning to publish your paclet to the repository or just want to distribute it directly to a small group.
We’ve also created a Paclet Resource Definition Notebook that contains a number of useful tools for organizing and building paclets. It will help you organize your files, fill in the paclet’s metadata, build the documentation and build the paclet itself for distribution. Submitting a paclet to the repository requires use of the definition notebook, but the notebook can also be used to share through your cloud account or just to create the distributable files.
What Else Is New?
In the process of preparing for a paclet repository that was fully open to the community, we had to do a significant amount of groundwork. Creating paclets was so much of an internal process that we had to rethink every step and sometimes question our fundamental assumptions. In Version 12.1, we started officially documenting the paclet system. In Version 13.0, we introduced more tools to create paclets, a set of Documentation Tools and more options for handling contexts and shadowed symbols with $ContextAliases.
Our work on the paclet system and the Wolfram Language Paclet Repository is far from done. In the future, you can look forward to improvements in discoverability, search and security, as well as tools for handling paclet interdependency. In the meantime, we’re very proud to have brought such a powerful tool to the hands of our community and look forward to seeing what you’ve created.
|Explore more user contributions like the paclets mentioned here or submit your own creations at the Wolfram Language Paclet Repository.|