In this engaging discussion, Peter Saxton, the creator of the EYG programming language, shares his journey in developing a tool designed to address functional programming challenges. He dives into the revolutionary features of EYG, like a type-safe eval() operation and effect types. The conversation also covers concepts such as error handling, the intricacies of number representation, and the importance of transparency in programming design. Together, they explore how EYG improves interoperability and sets new standards for modularity and performance.
EYG, a programming language by Peter Saxton, aims to solve JSON serialization challenges and improve error handling in functional programming.
The language features unique design elements like structural typing and effect types, allowing versatility in compiling across various runtime environments.
EYG introduces a hash-based system for function upgrades, promoting stability and modularity while tracking changes efficiently in the codebase.
Deep dives
Introduction to EYG Programming Language
EYG, short for Eat Your Greens, is a new programming language created by Peter Saxton. This language draws inspiration from various existing programming languages, particularly ROC and Unison, focusing on solving specific problems observed in functional programming. Peter discusses how EYG aims to ease challenges such as JSON serialization, a common pain point in many functional languages. The language began as a personal experiment before evolving into a standalone production tool, highlighting a design evolution driven by real-world programming needs.
Unique Design Features
EYG incorporates unique design features such as structural typing and effect types, offering a different approach compared to traditional programming languages. The language is intentionally built to allow for multiple compilation targets, enabling greater flexibility and adaptability in various runtime environments. Unlike Gleam, which was originally tied to a specific runtime, EYG aims to facilitate the creation of interpreters and compilers that can easily be customized. Peter emphasizes that the simplicity and ease of writing an interpreter for EYG is a significant advantage for developers looking for portability.
Challenges in Functional Programming
Peter highlights some of the main challenges faced in functional programming, particularly regarding error handling and JSON manipulation. He mentions the difficulties with certain functions returning non-meaningful responses due to missing fields and the importance of having clear, reliable error messages. The design philosophy behind EYG favors explicit abort effects, allowing developers to manage errors gracefully rather than struggling with unexpected crashes. This reactive design encourages developers to handle potential issues upfront, improving code reliability and maintainability.
Program Upgrades and Hashing
The conversation explores the topic of program upgrades within the EYG language, emphasizing the importance of stability and consistency. Through a hash-based system, each version of a function or module is associated with a unique hash, ensuring that changes to implementation details do not disrupt existing functionality unless explicitly updated. Peter discusses the challenge of promoting modularity without sacrificing the integrity of the codebase, aiming for a design where hashes provide the foundation for stable upgrades. This method allows for tracking changes effectively and minimizes the risk of unintended side effects from changes in the code.
Handling Effects and Error Management
EYG's approach to handling effects and errors is a central theme in its design, as it allows for a more manageable interaction between functional purity and real-world application requirements. The language utilizes an effects system that captures potential failures while prioritizing simplicity in code execution. This design empowers developers to specify clear effects for their functions without cluttering the code with excessive type annotations. The goal is to create a manageable environment, where errors are efficiently captured and can be quickly addressed during development.
JSON Decoding and Type Providers
The complexity of JSON decoding in functional programming languages is another focal point, with Peter detailing how EYG plans to address this issue. He explains the potential for using build scripts to generate AST structures dynamically from API specifications, streamlining the process of decoding JSON. By leveraging type safety through type providers, developers can achieve reliable and predictable JSON parsing without the pitfalls associated with manual handling. This strategy reinforces the goal of making EYG responsive to real-world programming demands while retaining the flexibility of functional paradigms.
Richard talks with Peter Saxton, creator of the EYG programming language, about the problems Peter aims to solve with EYG, and some of the unique design decisions he's made with it. A type-safe eval() operation even comes up in the discussion!