Software:Cassowary

From HandWiki
Revision as of 07:56, 9 February 2024 by BotanyGa (talk | contribs) (update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Cassowary is an incremental constraint solving toolkit that efficiently solves systems of linear equalities and inequalities. Constraints may be either requirements or preferences. Client code specifies the constraints to be maintained, and the solver updates the constrained variables to have values that satisfy the constraints. Cassowary was developed by Greg J. Badros, Alan Borning and Peter J. Stuckey, and was optimized for user interface applications.[1] Badros used Cassowary amongst others for implementing Constraint Cascading Style Sheets (CCSS), an extension to Cascading Style Sheets (CSS). CCSS adds support for layout constraints. These allow designers to describe the layout of a web page in a more flexible manner. Cassowary is used to solve these constraints and calculate the final layout.

The original distribution,[2] unmaintained since 2000, included Smalltalk, C++ and Java implementations, along with bindings for GNU Guile, Python, and STk. Third-party implementations exist for JavaScript,[3] Dart,[4] Squeak,[5] Python,[6][7] the .NET Framework,[8] and Rust.[9]

Applications

  • As of September 2014, GSS, a layout language and layout engine for the web, is being developed by The Grid.[10] It is a modern extension of CCSS.[11]
  • Layx, a layout language for the web designed with ease of use in mind.[12]
  • Scwm, the Scheme Constraints Window Manager.
  • As of 2011, Cassowary is being used as the algorithm in the layout engine for Mac OS X (Lion and greater) and iOS (6 and greater).[citation needed]
  • Enaml's layout engine is built on top of the Cassowary linear constraint optimizer.[13][14][15][16]

References

  1. The Cassowary linear arithmetic constraint solving algorithm, Authors: Greg J. Badros, Alan Borning & Peter J. Stuckey
  2. "Cassowary Constraint Solving Toolkit". University of Washington. https://www.cs.washington.edu/research/constraints/cassowary/. 
  3. on GitHub
  4. google/cassowary.dart, Google, 2020-08-12, https://github.com/google/cassowary.dart, retrieved 2020-12-08 
  5. Cassowary
  6. on GitHub
  7. on GitHub
  8. Vermeulen, Jo. "Cassowary.Net". http://jovermeulen.com/Software/CassowaryNet?from=Software.Software. 
  9. on GitHub
  10. "Grid Style Sheets development history". https://github.com/gss/engine/network. 
  11. "About CCSS". http://gridstylesheets.org/guides/ccss/. 
  12. "Layx website's homepage". http://www.layx.org/. 
  13. "Casuarius provides Python bindings to a C++ implementation of the Cassowary algorithm.". https://nucleic.github.io/enaml/docs/get_started/installation.html#casuarius. 
  14. on GitHub
  15. Kiwi, a replacement for Casuarius/Cassowary. The new solver removes that bottleneck. It still uses the same Cassowary algorithm, but it's a from-scratch implementation of the algorithm based on the Cassowary paper, not the existing Cassowary source code. While the Cassowary algorithm is good, the existing C++ implementation has many inefficiencies. The new solver is anywhere between 12x and 500x faster depending on the problem (40x typical) and uses around 5x less memory. And as I typically do, I chose to write the Python bindings by hand in C++ rather than use Cython. The resulting code is faster, and we now have one less external dependency.
  16. on GitHub