Clozure CL (CCL) Documentation
repository·master·Indexed 21 days ago
https://github.com/clozure/cclClozure CL (CCL) is a high-performance, self-hosting Common Lisp implementation. The documentation covers system compilation, the Cocoa-based IDE for macOS, code coverage analysis, and Foreign Function Interface (FFI) examples including OpenGL and GTK integrations via OpenMCL.
What's inside Clozure CL
- Clozure CL (CCL) is a Common Lisp implementation. Notably, CCL is self-hosting, meaning the source code is written in CCL itself. To compile the source, you must already have a working version of CCL installed on your system.
Use defsystem.lisp for system building
masterThe
defsystem.lispfile (version 3.4i, also known as "MK-DEFSYSTEM") is a system definition facility similar to the Unixmakeprogram. It is used for building systems in Common Lisp.Note: For historical reasons,
DEFSYSTEMwill attempt to redefine theCL:REQUIREfunction.Use asdf.lisp for system definition
masterTheasdf.lispfile provides 'Another System Definition Facility' for Clozure CL. It integrates with the environment by hooking into CCL's existingCL:REQUIREfunction to manage system definitions and dependencies.Get support for Clozure CL
masterIf you encounter problems or have questions, you can seek help through the following channels:
- Email: Send mail to
ccl-devel@clozure.com. Instructions for subscribing to the mailing list can be found at https://lists.clozure.com. - IRC: Ask on the
#cclchannel onlibera.chat. - GitHub Issues: Create an issue on GitHub, particularly if you believe you have found a bug.
- Email: Send mail to
Report bugs or request enhancements in CCL
masterTo report a bug or request a new feature, create an issue on the official GitHub repository.
https://github.com/Clozure/ccl/issuesObtain a working version of CCL for compilation
masterSince CCL is self-hosting, you cannot compile it from scratch without an existing CCL binary. To get a pre-compiled copy of CCL for your specific operating system, visit the official releases page.
https://github.com/Clozure/ccl/releases/latestCompile a Common Lisp system with code coverage
masterTo perform code coverage analysis on a Common Lisp system, follow these steps:
Load the code coverage test system using Quicklisp or direct loading:
(ql:quickload :code-cover-test) (ql:quickload :code-cover-tests)Configure your system to be tested. You can refer to
code-cover-test/cl-ppcre-tests.lispfor a concrete example of defining methods to run unit tests with coverage enabled.Compile and run tests using the
do-testsfunction. You must pass an instance of your test suite to it:(in-package :code-cover-test) (do-tests (make-instance 'cl-ppcre-tests))
To (re)compile and (re)initialize code coverage without executing the tests, use
init-code-coverage:(init-code-coverage (make-instance 'cl-ppcre-tests))(in-package :code-cover-test) (do-tests (make-instance 'cl-ppcre-tests))View code coverage reports via Hunchentoot web server
masterWhile you can view the generated
html/index.htmlfile directly in a browser, some browsers may fail to render frames or execute the Javascript UI correctly when using local file URLs. It is recommended to serve the results via a web server like Hunchentoot.Load the server system:
(ql:quickload :code-cover-test-server)Configure host and port: The defaults are
localhostand9090. Set them using*server-host*and*server-port*:(in-package :code-cover-test-server) (setq *server-port* 9090. *server-host* "localhost")Start the server:
(start-server)Access the results: Open your browser to the appropriate URL, for example:
http://localhost:9090/code-cover-test.Stop the server:
(stop-server)
(in-package :code-cover-test-server) (setq *server-port* 9090. *server-host* "localhost") (start-server)Generate code coverage reports
masterAfter running your tests, you can generate the coverage report files.
Set the output directory: The default directory is
~/tmp/code-cover-test. You can override this by setting the*output-directory-path*variable:(setq *output-directory-path* #P"~/tmp/code-cover-test/")Generate the report: Execute
report-code-coverage-testto produce the output files:(report-code-coverage-test)
(setq *output-directory-path* #P"~/tmp/code-cover-test/") (report-code-coverage-test)Overview of Phemlock
masterPhemlock (The Portable Hemlock) is an attempt to port the Hemlock editor to any system that supports ANSI Common Lisp and CLIM. It aims to decouple the editor from CMUCL-specific implementations, such as its stream interfaces and file I/O, to achieve broader portability.
Key portability improvements include:
- Streams: Replaced CMUCL-specific streams with Gray streams.
- File I/O: Replaced direct Unix system calls (
unix-read,unix-write) with standard Common Lisp line-by-line I/O. - X11 Interface: Provided a portability layer that uses the standard CLX interface instead of the CMUCL-specific
SERVE-EVENTfacility.
Currently, you can edit files using the X11 interface on any ANSI Common Lisp implementation that provides CLX.
Prerequisites for OpenMCL LinuxPPC examples
masterTo run the LinuxPPC-specific examples, ensure the following requirements are met:
- OpenMCL Version: Requires OpenMCL 0.9 or later.
- X11 Environment: Most examples require X11 runtime libraries to be installed and OpenMCL to be running under an X server.
- Shared Libraries: You must have the necessary
.solibraries installed on your system. You can verify if a library is present usingldconfig:
% /sbin/ldconfig -p | fgrep LIBNAME.soIf the command returns a path (e.g.,
LIBNAME.so (...) => /path/to/lib), the library is available. If not, you must install the appropriate package (e.g.,mesa,opengl, orglutg3) for your Linux distribution. 4. Interface Directories: OpenMCL uses "interface directories" (subdirectories ofccl:headers;containing.dbfiles) to modularize its interface database.Run the Cocoa-based IDE from a CCL session
masterTo launch the Cocoa-based IDE from within an existing Clozure CL command-line session (such as a shell, Emacs buffer, SLIME, or ILisp), use the
requirefunction with the"COCOA"argument.On the first run, the system will compile the sources, which may generate numerous compiler warnings and messages regarding new ObjC-callable methods. Once complete, a temporary application bundle is created at
ccl:temp bundle.appand activated. You will see a new menubar, a listener window, and a Clozure CL icon in the Dock.Note that the original non-GUI listener process remains active. Any diagnostic or error messages from the IDE will be directed to the standard output/error streams of that listener (e.g., the
*inferior-lisp*buffer in SLIME).(require "COCOA")