EYG a predictable, and useful, programming language by Peter Saxton

October 8, 2024

In the presentation EYG: a predictable and useful programming language by Peter Saxton, he introduces EYG, a programming language he finds predictable, useful, and confident. He emphasizes the importance of deterministic, immutable dependencies in functional programming for productivity. Peter then discusses the language’s usefulness, explaining how EYG allows for runtime requirements and manages effects, addressing common issues with functional programming. Lastly, he highlights the language’s confidence, as the type system is totally sound, ensuring no runtime bugs. Peter also touches on EYG’s serialization capabilities, allowing every value, including functions and resumed stacks, to be serialized.

EYG a predictable, and useful, programming language: A comprehensive overview

The Philosophy Behind EYG

Peter Saxton began his talk by emphasizing EYG’s core principles: predictability, usefulness, and confidence. These principles drive the design and implementation of the language, making it a solid tool for developers seeking deterministic, reliable, and functional programming environments.

  1. Predictability: EYG’s focus on deterministic and immutable dependencies ensures that the behavior of code is always predictable. This is key in functional programming, where consistency can directly improve productivity.
  2. Usefulness: EYG doesn’t just focus on predictability. It tackles real-world runtime requirements and manages effects effectively, providing practical solutions to everyday development challenges.
  3. Confidence: Thanks to a sound type system, EYG ensures confidence in code quality, guaranteeing that no runtime bugs slip through due to unsound typing.

 

Key Features of EYG

1. Structural typing and real-time type checking
One of EYG’s strengths lies in its structural nature. There’s no need for explicit type declarations because types are inferred from the values being passed around. Saxton showcased this with an example of editing records like Alice and Bob. The editor’s real-time type checking provides instant feedback on whether the code is valid, making coding both efficient and error-free.

2. Tagged unions and extendable records
EYG simplifies working with data by supporting tagged unions and extendable records, two concepts that are powerful in functional programming. These tools allow developers to handle data in a structured, clear manner, while also giving flexibility with data transformations. This flexibility is particularly valuable when working with open unions and matching values through concise syntax.

3. Function serialization and effects
Peter highlighted one of EYG’s most compelling features: function serialization. In EYG, functions can be serialized and re-serialized back into source code, making it easy to handle function passing between components.

Effects play a significant role in EYG as well. They make programs pure by suspending them when an effect is reached. A handler then resumes the program, providing the final computation and return value. Effects such as non-determinism, aborting, and property testing are seamlessly handled, allowing EYG to manage complex programming patterns.

 

Handling effects and top-level control

EYG is designed to help developers understand and control effects in their programs. Effects can be inferred automatically by the language and highlighted for easy identification and management. This effect-based architecture helps with debugging and maintaining a clean separation between functional and imperative code. Peter also cited a paper called Type-Based Effect Compilation as inspiration for EYG’s approach.

 

Compiling for different backends and hot code reloading

Looking toward the future, Peter shared his vision for using EYG in a wide range of devices, particularly ones with small boundaries. EYG supports multiple representations of a program, allowing it to compile to different backends. This flexibility is a major advantage when dealing with a variety of platforms, whether for mobile devices, desktop environments, or embedded systems.

Additionally, EYG supports hot code reloading, a feature that allows software to be updated without crashing. The ability to serialize program states when an effect is raised enables seamless upgrades and guarantees crash-free execution.

 

Building for the future

EYG’s structural typing, extendability, and robust handling of effects position it as a promising tool for developers working in functional programming. Whether you’re building complex systems or need reliable, predictable behavior in your code, EYG offers both versatility and confidence. Peters’s future vision of the language includes expanding support for multiple backends, improving tooling, and advancing hot code reloading — all aimed at making programming smoother and more efficient.

As Peter wrapped up his presentation, it was clear that EYG isn’t just an experimental language; it’s a purposeful step toward creating a more predictable and powerful programming environment. He left the audience with the reminder that there’s much more to explore and experiment with as EYG continues to evolve.

If you’re intrigued by EYG, be sure to follow its development and make room for some experimentation — it may just become your go-to language for functional programming projects.

 

Final thoughts

EYG introduces exciting possibilities in functional programming by blending deterministic design, practical functionality, and strong confidence in code integrity. Whether you’re an experienced developer or someone transitioning from traditional languages, EYG is worth exploring for its thoughtful approach to solving common challenges in software development.

 

Additional resources

Check out more from the MeetUp Func Prog Sweden. Func Prog Sweden is the community for anyone interested in functional programming. At the MeetUps the community explore different functional languages like Erlang, Elixir, Haskell, Scala, Clojure, OCaml, F# and more.