SE Radio 665: Malcolm Matalka on Developing in OCaml with Zero Frameworks
Apr 23, 2025
auto_awesome
Malcolm Matalka, founder of Terrateam, shares insights on developing in OCaml without relying on frameworks. He explains the benefits of strong typing while discussing the seamless integration of front-end and back-end systems. Matalka highlights the importance of community support in a niche language and reflects on the challenges of using OCaml in a Go-centric world. The conversation also covers the pros and cons of monolithic architecture, type management complexities, and custom framework development, all emphasizing a leaner, more controlled software engineering approach.
Malcolm Matalka discusses the advantages of OCaml's strong typing features, which enhance reliability and minimize runtime errors in programming.
TerraTeam's approach to avoiding external frameworks allows for greater control and flexibility, leading to a leaner development process with custom solutions.
The podcast emphasizes the importance of context in technology choices, considering team dynamics, project scope, and personal language familiarity for effective development.
Deep dives
Overview of TerraTeam and Its Unique Approach
TerraTeam operates in the infrastructure as code space, specializing in collaborative software centered around Terraform and OpenTofu. Unlike traditional tools, TerraTeam integrates directly with platforms like GitHub and GitLab, allowing users to manage infrastructure through pull requests, which streamlines development workflows. This approach ensures that developers do not have to alter their existing routines, as creating a Kubernetes cluster involves writing Terraform code, triggering a pull request, and receiving approval before execution. This collaborative model is designed to enhance team efficiency and support a seamless development experience.
Rationale Behind Choosing OCaml
The decision to utilize OCaml stems from both a personal affinity for the language and its strong typing capabilities, which facilitate more structured programming compared to languages like Python. OCaml allows developers to create specific data types, such as a zip code type, enforcing accuracy throughout the codebase and minimizing runtime errors. This strong typing offers advantages in terms of clarity and guarantees that the inputs conform to expected types, improving overall program reliability. Malcolm Matalka's long-standing experience with OCaml since 2002 plays a significant role in this choice, reinforcing the notion that developers should work with technologies they enjoy and understand deeply.
Advantages of a Zero Frameworks Approach
The decision to avoid external frameworks in favor of custom-built solutions provides significant control over software development, allowing the team to avoid being bound by outside release cycles and feature deprecations. This autonomy leads to a leaner development environment where only necessary functionalities are included, minimizing bloat and potential conflicts between competing frameworks. While TerraTeam may still utilize certain libraries, the avoidance of frameworks allows more straightforward modifications and debugging processes. By crafting their own systems, the team can adapt to their specific operational needs without the overhead associated with pre-established frameworks.
The Benefits and Challenges of OCaml for Development
While OCaml’s integration capabilities with JavaScript are advantageous for building both back-end and front-end applications, working predominantly within the OCaml ecosystem presents some challenges. The language's smaller community may limit access to certain third-party libraries, necessitating the development of proprietary tools for common tasks, such as parsing HashiCorp configuration language for Terraform integration. Moreover, the dominance of languages like Go in the infrastructure domain can complicate interoperability with external tools and libraries. As a result, while the technical merits of OCaml are evident, real-world constraints introduce substantial considerations regarding ecosystem compatibility.
Lessons Learned from Building with OCaml
The experience of building software with OCaml and a zero frameworks approach highlights the importance of context in technology decision-making. Factors such as team size, project scope, and individual familiarity with particular languages are crucial as they shape product development and technical choices. Additionally, embracing a flexible mindset where developers are willing to consider the trade-offs of building custom solutions versus adopting existing frameworks can lead to more effective and tailored applications. Ultimately, fostering a systems-level perspective prompts critical thinking about how each component interacts, offering insights beneficial for future software projects.
Malcolm Matalka, founder of Terrateam, joins host Giovanni Asproni to talk about the reasoning behind choosing a not-so-widespread language (OCaml) and (almost) totally avoiding frameworks for the development of Terrateam. While discussing the reasons for choosing this specific programming language and the advantages and disadvantages of using external frameworks, they also consider a range of related topics, including static vs. dynamic typing, the use of monorepos, and the advantages of choosing a single language that can be used both for web front ends and server back ends. The episode ends with lessons learned that can be applied to other contexts and projects.