paint-brush
Viva la Revolution Part 1: Future Proofing Digital Infrastructure with Applied Category Theoryby@salkimmich
420 reads
420 reads

Viva la Revolution Part 1: Future Proofing Digital Infrastructure with Applied Category Theory

by Sal KimmichJune 25th, 2023
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Applied Category Theory (ACT) requires seamless integration into languages developers commonly use in domains like cybersecurity, SRE, and green technology. Haskell, Rust, and Python stand tall as champions reaping rich rewards from ACT. Not all languages are cut from the same cloth.
featured image - Viva la Revolution Part 1: Future Proofing Digital Infrastructure with Applied Category Theory
Sal Kimmich HackerNoon profile picture


What even is Applied Category Theory, anyway?

Applied Category Theory offers a mathematical approach that considers systems' overall structure rather than their individual components. This structure-preserving perspective enables us to uncover hidden patterns and relationships, offering new insights into system behavior. As a consequence, ACT has the potential to revolutionize our understanding and problem-solving capabilities in the fields of cybersecurity, SRE, and green technology.


If that still sounds like nonsense to you, I’ll simplify it down to the very basics: it’s an alternative mathematical representation to algebra, which you may have heard of before. Algebra is the practice of representing relationships between things with an equal sign, like a balancing act. Category theory is a way of looking at the exact same problems using an arrow instead of an equal sign. This preserves the direction of the information, making it easier to represent complex systems, particularly when they are connected by APIs.


If you want to get philosophical, this is the mathematical way of thinking about Turtles all the way up, not all the way down.


Turtles all the way down assumes that there’s complexity you can’t pull away enough to see the truth. Turtles all the way up finds categorical conditions that preserve across all levels.


It’s something we have to think a lot about in modern digital infrastructure. It’s why we have the very cute clusterAPI logo to the right.


Category Theory is an abstract, complex field of mathematics and is challenging to understand and apply. The success of finding solutions hinges on bridging this gap of making ACT accessible to practitioners and demonstrating its real-world applications.


The applied is the most important part here, and these are the people I need to apply it:


  1. Cybersecurity professionals can leverage ACT to design more robust security systems, taking advantage of its ability to model complex, interrelated systems to anticipate and prevent potential vulnerabilities.


  2. Site reliability engineers can use ACT to better understand system dependencies, enhancing their ability to predict and mitigate service disruptions.


  3. Green technology developers can apply ACT to create more efficient algorithms, reducing the energy footprint of digital services and contributing to sustainability goals. Particularly important for chip development.


Ok great, now to the good stuff:

Leveraging the Full Potential of ACT: Integrating Haskell, Rust, and Python

Today, we set our sights on three heavyweights: Haskell, Rust, and Python. Strap in, developers, because we're about to dive into the details.

Haskell and Rust: Where Memory-Safe Architectures Thrive

If you're in pursuit of memory-safe architectures, Haskell and Rust are the prime playgrounds to explore the vast benefits of ACT. These languages don't mess around when it comes to type safety and fine-grained control over memory management.


All that is to say, if you represent a complex system in Haskell, it’s much more likely to run like the system you are representing, rather than adding another turtle of complexity, unlike the well-known deployment wild rodeo of object-oriented micro-services systems.


Haskell, a purely functional language, boasts a world free of side effects, allowing us to dissect program behavior with laser precision. But that's not all—Haskell's advanced type system perfectly aligns with ACT's structure-focused nature, transforming it into a hotbed for translating complex category-theoretic concepts into functional code that just works.



On the other side of the ring, we have Rust—a heavyweight system programming language that prioritizes safety, speed, and concurrency. With its ownership system ensuring memory safety without the shackles of garbage collection, Rust becomes an attractive option for those looking to craft memory-efficient software designs with the guiding principles of ACT.


Python: Building Bridges Across Domains and Paradigms

Python, the darling of simplicity and power, emerges as a multi-paradigm language straddling both object-oriented and functional programming styles. Its broad adoption across various scientific domains positions Python as the ideal candidate for exploring the cross-domain applications of ACT. But wait, there's more—Python's flexibility, combined with ACT's prowess, unlocks the door to tackling hard computational problems. Think P=NP problem and beyond. The Python-ACT combo can empower developers to devise groundbreaking strategies, shaking up the computational landscape like never before. We’ll come back to this idea later.


Not All Languages Are Created Equal in the ACT Arena

While Haskell, Rust, and Python stand tall as champions reaping rich rewards from ACT, we must acknowledge that not all languages are cut out for sustainable infrastructure. Let's take a moment to shed some light on the contenders that might face a tougher battle.


  1. Imperative Languages: Languages like C and Java, known for their imperative programming paradigm, might not immediately see the value in ACT. These languages prioritize action sequences over the intricate relationships between data types and functions. Although it's not a lost cause, integrating ACT into imperative contexts can be challenging as the focus on the mutating state can overshadow the structural relationships that ACT thrives upon.


  2. Scripting Languages: JavaScript and PHP enthusiasts, buckle up. Scripting languages often excel at small tasks and web development, but embracing the full benefits of ACT might be a taller order. These languages prioritize flexibility and ease of use, which sometimes comes at the cost of rigorous structure. While ACT can find its niche in these domains, the complexity-utility tradeoff might not always tip in favor of adopting ACT.


  3. **Domain-Specific Languages (DSLs):**DSLs tailored to specific problem domains might not naturally lend themselves to ACT unless they harmoniously align with category theory's conceptual framework. Take SQL, for instance—an excellent fit for querying databases but not necessarily an ACT haven. However, let's not forget that even in such cases, ACT can offer valuable insights into software structure and design principles, inspiring novel solutions and better programming practices.

In the grand scheme of things, direct applicability might vary, but the knowledge gained from ACT can empower developers across the board. The wisdom and rigor behind ACT can lay the groundwork for enhanced software structure and design principles, irrespective of the language at hand. Do I have your attention? Great, because there’s a Part Two.


Let the ACT revolution begin!

Future Topics

Here are the future topics I’d like to extend this section on, let me know which one you’d like to know more about (or, even better, would be interested in helping me research):


  1. Historical Development of Category Theory: Explore the origins and evolution of category theory, highlighting key milestones and influential figures. Understanding the historical context provides a solid foundation for grasping its practical applications.


  2. Category Theory Fundamentals: Dive deeper into the core concepts and principles of category theory, including objects, morphisms, functors, and natural transformations. This resource will elucidate the theoretical underpinnings of ACT.


  3. ACT Case Studies: Examine real-world case studies where applied category theory has been successfully utilized, demonstrating its potential in solving complex problems across different domains. This resource will provide concrete examples of ACT's practical applications.


Where do you want to see this go next? Town Hall mode is on this Hackernoon article, so feel free to comment anywhere on this article where you have a question, comment, or better idea than myself. The author will absolutely read it.


The lead image for this article was generated using DeepAI with excerpts from this blog post.