Writing code portably is useful for easily switching between Common Lisp implementations and for building cross-platform applications. I place a lot of emphasis on portable code in my upcoming book. During my research, after a prompt from @fare, I discovered that UIOP provides some useful portability functions beyond file access.
I have always considered UIOP to be the standard file access library. I never spent the time to find out what else it provides because it seldom appears in Quickdocs searches.
After digging into UIOP a bit I found the following areas where it provides functions which are important for writing portable, distributable code:
- File access - Most of UIOP
- Run programs in the shell -
(uiop:run-program)
- Print backtraces -
(uiop:print-condition-backtrace)
- Exit from lisp -
(uiop:quit)
- Operating system identification -
UIOP/OS
package - Create standalone executables -
(uiop:dump-image)
UIOP is an enormous library. It contains many other utilities which are less important for the purpose of making a program distributable but which are still useful. Spending a few minutes going through the README may be time well spent.
Due to UIOP’s variety it can potentially make many of the single purpose libraries in Quicklisp obsolete. That is not to say that it is automatically better than the alternatives but it is something to keep in mind given the ASDF/UIOP combination’s track record.