Eli Dowling, a contributor to the Roc programming language, delves into the fascinating world of language design and editor tooling. The discussion highlights innovative error recovery in parsers, the benefits of tree-sitter, and the complexities of macros. Eli shares insights on the balance between functionality and user experience, especially in code editors. They explore the implications of implementing hygienic macros and the challenges of enum types, emphasizing the need for clarity and simplicity in programming languages.
Eli Dowling's journey into functional programming began with F#, leading to his contributions in ROC and its optimizations for immutable data structures.
The integration of efficient tooling in programming language design, such as semantic navigation via TreeSitter, significantly enhances productivity and user experience.
Type inference in ROC streamlines coding but can create complex error messages, highlighting the need for better compiler error reporting to aid developers.
Deep dives
Entry into Functional Programming
The journey into functional programming for Eli Dowling began with learning F#, a language he was familiar with due to his prior experience with the .NET ecosystem. This introduction sparked an interest that eventually led him to discover other languages and research papers relevant to functional programming, including one on the Perseus project. The unique features of ROC, particularly its high-performance immutable data structures leveraging reference counting, stood out to him as significant advancements. Dowling's exploration of the functional programming landscape highlighted the performance challenges he faced with linked lists and immutable data structures, leading him to appreciate ROC's optimizations.
The Role of Tools in Language Design
Eli emphasized the importance of tooling in programming language design, asserting that the tools programmers use have a substantial impact on the outcomes of their projects. His personal experience with different text editors, such as Helix and NeoVim, illustrated the frustrations associated with setting up environments and the potential of TreeSitter for semantic navigation and syntax highlighting. Dowling's contributions to the ROC language project, particularly in improving editor tooling, stemmed from his recognition of the value these tools bring to language usability. The seamless integration of tooling into the programming experience can significantly enhance productivity and efficiency.
Parser Design and Error Recovery
The discussion on parsers brought forth the intricacies of syntax highlighting and error recovery within the ROC programming language. Dowling noted that while TreeSitter provides certain advantages, it also poses challenges, particularly in terms of recovery from syntax errors. He highlighted the need for a balance between strict compilations and the flexibility that allows editors to offer helpful feedback during development. The conversation underscored the importance of designing parsers that not only interpret code effectively but also support a smooth development process for programmers.
Type Inference and User Experience
Type inference emerged as a significant topic, with both speakers addressing the trade-offs associated with its implementation in ROC. While it provides substantial convenience by eliminating the need for type annotations, it can also lead to complex error messages that may confuse users when mistakes are made. Dowling shared his experiences of encountering frustrating type errors due to structural typing, noting that clearer error messages could potentially enhance the user's understanding and debugging process. This highlighted the ongoing need for advancements in compiler error reporting to improve the overall coding experience.
The Future of ROC and Language Features
The closing conversation focused on the future of ROC as a programming language and the potential movement towards introducing new features, including an effective macro system. Both speakers expressed caution regarding macros due to their historical complications in various programming languages, which can disrupt editor functionality and user experience. They emphasized the importance of exploring robust language features that address user needs without sacrificing simplicity and usability. The hope remains for ROC to evolve while maintaining a streamlined approach to language design that prioritizes an excellent developer experience.
Richard talks with Eli Dowling about his contributions to the Roc programming language, as well as the intersection of language design and editor tooling, parsers that recover from errors, tree-sitter, going beyond the language server protocol, and the downsides of macros.
Perceus paper - https://www.microsoft.com/en-us/research/uploads/prod/2020/11/perceus-tr-v1.pdf
The Koka Programming Language - https://koka-lang.github.io
"The Quicksort Talk" (Outperforming Imperative with Pure Functional Languages) - https://youtu.be/vzfy4EKwG_Y
Tree-Sitter - https://tree-sitter.github.io
Neovim Editor - https://neovim.io
Helix Editor - https://helix-editor.com
Zed Editor - https://zed.dev
Language Server Protocol (LSP) - https://microsoft.github.io/language-server-protocol