Features
The tool produces the full call graph of a program as a dot file.
A start point can be specified to analyze only the call graph that begins at that function.
Each node (function) in the call graph includes the local stack usage of the function, if available (see -Z emit-stack-sizes).
The maximum stack usage of each function is also computed, or at least a lower bound is provided. Maximum stack usage of a function here refers to the stack usage that includes the stack used by functions that the function may invoke.
The tool has imperfect support for calls through function pointers (fn()) and dynamic dispatch (dyn Trait). You will get a call graph from programs that do indirect calls but it will likely be missing edges or contain incorrect edges. It's best to use this tool on programs that only do direct function calls.
Welcome to Category Theory in Programming, a journey into the conceptual world where mathematics meets software development. This tutorial is designed for Racket programmers who are curious about the mathematical ideas underlying computational systems. It offers insights into how familiar programming concepts can be reinterpreted through the lens of category theory, and even goes further to directly borrow from category theory, using programming language constructs to describe these abstract concepts.
In addition to this tutorial, you may find the following resources helpful for further exploration of category theory:
Category Theory for Computing Science by Michael Barr & Charles Wells
Computational Category Theory by D.E. Rydeheard & R.M. Burstall
Category Theory in Context by Emily Riehl
Category Theory by Steve Awodey
Categories for the Working Mathematician by Saunders Mac Lane
nLab
TheCatsters YouTube Channel
Category theory, a branch of mathematics that deals with abstract structures and relationships, may seem esoteric at first glance. However, its principles are deeply intertwined with the concepts and patterns we encounter in programming. Through this tutorial, we aim to bridge the gap between these two worlds, offering a unique perspective that enriches the programmer’s toolkit with new ways of thinking, problem-solving, and system design.
In the following chapters, we will explore the core concepts of category theory — objects, morphisms, categories, functors, natural transformations, Yoneda Lemma, 2-categories, (co)limits, sketches, Cartesion closed categories & typed lambda, Curry–Howard–Lambek corresponding, adjunctions, (co)monads, kan-extensions, toposes, and more — and how these can be represented and utilized within the Racket programming language. The goal is not to exhaustively cover category theory or to transform you into a category theorist. Instead, we will focus on mapping these abstract concepts into programming constructs, providing a foundation that you, the reader, can build upon and apply in your work.
Why study category theory as a programmer? The answer lies in the abstraction and generalization capabilities provided by category theory. It allows us to see beyond the specifics of a particular programming language, problem, or system, revealing the underlying structures that are common across different domains. By identifying connections between a system and the constructs of category theory, you can leverage existing categorical results and structures to expand and improve the system, applying well-established theories and techniques to refine and extend your design. This tutorial aims to open the door to this broader perspective, enriching your approach to programming.
As you embark on this journey, keep in mind that the real value of understanding category theory in the context of programming is not merely in acquiring new knowledge but in developing a new way of thinking about problems or systems. We encourage you to approach the material with an open mind and to explore how the concepts presented here can be applied or extended in your programming endeavors.
Category Theory in Programming is an invitation to explore, to question, and to discover. It is a starting point for a deeper inquiry into the vast and fascinating intersection of mathematics and programming. We hope this tutorial will inspire you to delve further into both fields, exploring new ideas and forging connections that will enhance your work as a programmer.
Let the journey begin.
These are lecture notes for the Logical Relations course at OPLSS 2023. The notes cover an introduction to logical relations, along with detailed examples, namely: normalization and type safety for simply-typed lambda calculus (STLC), step-indexed logical relation for recursive types, and a brief look at binary logical relations for parametric polymorphism.
A powerful effect-oriented programming language
Flix is a principled effect-oriented functional, imperative, and logic programming language developed at Aarhus University and by a community of open source contributors. Why effect-oriented? And why Flix?
Why Effects? Effect systems represent the next major evolution in statically typed programming languages. By explicitly modeling side effects, effect-oriented programming enforces modularity and helps program reasoning. User-defined effects and handlers allow programmers to implement their own control structures.
Why Flix? We claim that of all the upcoming effect-oriented programming languages, Flix offers the most complete language implementation, the most extensive standard library, the most detailed documentation, and the best tool support.
Moreover, Flix builds on proven programming language technology, including: algebraic data types and pattern matching, extensible records, traits, higher-kinded types, associated types and effects, structured concurrency, and more.