Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Common Lisp
  3. magicl

magicl

BSD-3-ClauseCommon Lispv0.9.1

A Common Lisp library for matrix algebra with pure Lisp and accelerated backends via BLAS/LAPACK.

GitHubGitHub
255 stars49 forks0 contributors

What is magicl?

MAGICL (Matrix Algebra proGrams In Common Lisp) is a comprehensive linear algebra library for Common Lisp, originally developed by Rigetti Computing. It provides a portable pure Lisp core for matrix operations and optional accelerated backends using BLAS, LAPACK, and Expokit, making it suitable for scientific and quantum computing applications where performance and flexibility are needed.

Target Audience

Common Lisp developers working on scientific computing, numerical analysis, or quantum computing projects that require efficient linear algebra operations. It is also aimed at researchers or engineers who need a blend of portability and high performance in their Lisp-based numerical code.

Value Proposition

Developers choose MAGICL for its dual approach: a dependency-free pure Lisp core ensures portability, while extensible backends allow leveraging optimized C/Fortran libraries like BLAS and LAPACK for speed. Its flexible backend system with dynamic selection and priority control gives fine-grained performance tuning, and its high-level interface eases adoption for users familiar with MATLAB or NumPy.

Overview

Matrix Algebra proGrams In Common Lisp.

Use Cases

Best For

  • Implementing linear algebra operations in Common Lisp with a focus on portability and no foreign dependencies (using the pure Lisp core).
  • Accelerating numerical computations in Common Lisp by integrating with optimized BLAS and LAPACK libraries for better performance.
  • Quantum computing applications in Common Lisp that require efficient matrix manipulations and exponential functions (via Expokit).
  • Scientific computing projects in Common Lisp where dynamic backend selection is needed to balance speed and compatibility.
  • Developing high-level numerical interfaces in Common Lisp that mimic MATLAB or NumPy for easier adoption by users from those ecosystems.
  • Generating and using automatic Lisp bindings from Fortran reference sources like BLAS, LAPACK, and Expokit for direct library access.

Not Ideal For

  • Projects using Lisp implementations other than SBCL, CCL, or ECL, due to non-portable code restrictions.
  • Production systems that require a stable, non-experimental API, as the high-level interface is subject to change.
  • Environments where installing foreign dependencies like libffi, BLAS, and LAPACK is restricted or overly complex.
  • Teams seeking a simple, drop-in linear algebra solution without the overhead of backend configuration and priority management.

Pros & Cons

Pros

Pure Lisp Portability

The MAGICL/CORE system is entirely ANSI Common Lisp with no foreign dependencies, ensuring it runs portably on supported implementations without external libraries.

Performance Extensions

Optional extensions like MAGICL/EXT-BLAS and MAGICL/EXT-LAPACK leverage optimized C/Fortran libraries for significant speed improvements in numerical computations.

Dynamic Backend Control

The with-backends macro allows fine-grained, dynamic prioritization of backends (e.g., :blas over :lisp) for performance tuning, as detailed in the backend system documentation.

Familiar High-Level API

Functions mimic MATLAB and NumPy interfaces, easing adoption for users from those ecosystems, as described in the high-level documentation.

Automatic Fortran Bindings

Lisp bindings are automatically generated from reference BLAS, LAPACK, and Expokit sources, ensuring accurate and direct low-level access without manual coding.

Cons

Limited Implementation Support

MAGICL only works with SBCL, CCL, and ECL on AMD64, excluding other Common Lisp implementations due to non-portable code in specific files.

Experimental High-Level Interface

The README explicitly warns that the high-level interface is experimental and subject to change, making it risky for long-term or production use.

Complex Dependency Setup

Accelerated versions require installing and configuring foreign libraries like libffi, BLAS, and LAPACK, which can be challenging and system-dependent.

Backwards Compatibility Risks

The default loading of all extensions may change in future versions, forcing developers to manage dependencies explicitly to avoid breakage, as noted in the README.

Frequently Asked Questions

Quick Stats

Stars255
Forks49
Contributors0
Open Issues59
Last commit1 month ago
CreatedSince 2017

Tags

#blas#scientific-computing#lapack#quantum-computing#matrix-computations#linear-algebra#numerical-computing#common-lisp#lisp-library

Built With

B
BLAS
C
CCL
S
SBCL
l
libffi
Q
Quicklisp
C
Common Lisp
E
ECL
L
LAPACK

Included in

Common Lisp2.9k
Auto-fetched 1 day ago

Related Projects

LLALLA

Lisp Linear Algebra

Stars19
Forks3
Last commit4 months ago
3d-matrices3d-matrices

A library implementing common matrix calculations, with an emphasis on 2x2,3x3, and 4x4 matrices as commonly used in graphics. It provides some numerical functions as well, but those are not the focus. The library is heavily optimised, so it is not made of pretty code. zlib

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub