When comparing MacPorts vs Hammerspoon, the Slant community recommends Hammerspoon for most people. In the question“What are the best power user tools for macOS?” Hammerspoon is ranked 33rd while MacPorts is ranked 53rd. The most important reason people chose Hammerspoon is:
Hammerspoon's Lua scripting and broad API allows you to perform any action you can imagine on your mac. It hooks into many OS APIs directly and has some high-level APIs to manipulate things like Spotify or iTunes. See the full list [here](https://www.hammerspoon.org/docs/).
Ranked in these QuestionsQuestion Ranking
Pro Provides a consistent experience across OS X versions
MacPorts eschews Apple-supplied libraries and links sources against its own making sure that the experience is the same regardless of what OS X version is used.
Pro Generally very up to date
MacPorts generally gets new software soon after it's available. This way users will not have to worry if their software is up to date.
Pro Nice variants system
MacPorts has a variants system that allows customizing builds with author provided options.
Written in Tcl & C, it's generally significantly faster than the competition. Tcl is also quite readable and comparable to Ruby, so it's also friendly to newcomers.
Pro Deeply customizable
Hammerspoon's Lua scripting and broad API allows you to perform any action you can imagine on your mac. It hooks into many OS APIs directly and has some high-level APIs to manipulate things like Spotify or iTunes. See the full list here.
Pro Automate actions based on the operating system
Hammerspoon lets you hook into OS level events and trigger any action you can imagine. From setting up a simple keyboard shortcut to launching a complex workflow using multiple apps and scripts.
Con Downloads unneeded libraries duplicating functionality already provided by Apple's libraries
As MacPorts eschews Apple-supplied libraries and links sources against its own a large duplication of functionality across MacPorts and Apple libraries can be found.
Con Bad at limiting dependencies
MacPorts has a habit of pulling very specific versions of dependencies for each package. It downloads different version of already existing dependencies even in cases where the existing dependency version would have worked seamlessly.
Con Some knowledge of programming required
Hammerspoon is scripted in the Lua programming language, and some familiarity with programming in general will be needed to use it. Some plugins exist that can be used by adding some files to a specific folder, but this will not give the flexibility that is so key to Hammerspoon