HMV2 (GitHub): an IR, runtime, and interaction combinator evaluator which allegedly “achieves near-ideal speedups as a function of available cores.”...
This blog post is about Agda Core, a project to build a a formally specified core language for (a reasonable subset of) Agda together with a reference implementation of a type checker for it. If you have been following my work, you might know that I have been working on this project on and off for the past few years, yet the...
For the last year and a half, I and my recently-added collaborator Jane Losare-Lusby have been working in secret on a safe systems language that could be learned about as quickly as one can learn Go. I think we might have something worth exploring....
This was a conference at MIT that was held 2 days ago. The presentations are all recorded here, and there are summaries and links to the presented papers on the main site....
Algebraic Subtyping is a type system devised by Stephen Dolan in 2016, in his dissertation. It extends Hindley-Milner with subtyping, in a way that preserves decidability and principality. Over the past few years, I have implemented Algebraic Subtyping in my language Pinafore (omitting record types). Pinafore is, as far as I...
Befreak is a purely reversible two-dimensional programming language. It was inspired by the Chris Pressey’s Befunge programming language. Like Befunge, all Befreak instructions are written as a single character, and execution can flow north, south, east, and west....
Today I am pleased to announce Beatrice, which is a finally tagless, dependently typed, self-aware functional programming language that I have been working on for quite a while. In this short blog post, I will demonstrate its most prominent features and contrast them to those of mainstream programming languages....
One of my research group’s major goals is to create technologies that enable self-improving compilers. Taking humans out of the compiler-improvement loop will make this process orders of magnitude faster, and also the resulting compilers will tend to be correct by construction. One such technology is superoptimization, where...
For the past few months I’ve been mulling over some things that Russell Johnston made me realize about the relationship between effect systems and coroutines. You can read more of his thoughts on this subject here, but he made me realize that effect systems (like that found in Koka) and coroutines (like Rust’s async...
Narya is eventually intended to be a proof assistant implementing Multi-Modal, Multi-Directional, Higher/Parametric/Displayed Observational Type Theory, but a formal type theory combining all those adjectives has not yet been specified. At the moment, Narya implements a normalization-by-evaluation algorithm and typechecker for...
Hey. I have made some DSLs before, and for all of them, most of which were in C, I have used Flex and Bison. But this time I wanna use Scheme, Cyclone Scheme to be exact. I can potentially use Flex/Bison this time too, because Cyclone has a strong FFI to C....
I find writing the parser by hand (recursive descent) to be easiest. Sometimes I use a lexer generator, or if there isn’t a good one (idk for Scheme), write the lexer by hand as well. Define a few helper functions and macros to remove most of the boilerplate (you really benefit from Scheme here), and you almost end up writing the rules out directly.
Yes, you need to manually implement choice and figure out what/when to lookahead. Yes, the final parser won’t be as readable as a BNF specification. But I find writing a hand-rolled parser generator for most grammars, even with the manual choice and lookahead, is surprisingly easy and fast.
The problem with parser generators is that, when they work they work well, but when they don’t work (fail to generate, the generated parser tries to parse the wrong node, the generated parser is very inefficient) it can be really hard to figure out why. A hand-rolled parser is much easier to debug, so when your grammar inevitably has problems, it ends up taking less time in total to go from spec to working hand-rolled vs. spec to working parser-generator-generated.
The hand-rolled rules may look something like (with user-defined macros and functions define-parse, parse, peek, next, and some simple rules like con-id and name-id as individual tokens):
Since you’re using Scheme, you can almost certainly optimize the above to reduce even more boilerplate.
Regarding LLMs: if you start to write the parser with the EBNF comments above each rule like above, you can paste the EBNF in and Copilot will generate rules for you. Alternatively, you can feed a couple EBNF/code examples to ChatGPT and ask it to generate more.
In both cases the AI will probably make mistakes on tricky cases, but that’s practically inevitable. An LLM implemented in an error-proof code synthesis engine would be a breakthrough; and while there are techniques like fine-tuning, I suspect they wouldn’t improve the accuracy much, and certainly would amount to more effort in total (in fact most LLM “applications” are just a custom prompt on plain ChatGPT or another baseline model).
Higher Order Company: developing a massively parallel language, proof checker, and runtime using interaction nets/combinators (higherorderco.com)
HMV2 (GitHub): an IR, runtime, and interaction combinator evaluator which allegedly “achieves near-ideal speedups as a function of available cores.”...
Meta, a Human-Friendly Programming Language (language.metaproject.frl)
From the site:...
Agda Core: The Dream and the Reality (jesper.cx)
This blog post is about Agda Core, a project to build a a formally specified core language for (a reasonable subset of) Agda together with a reference implementation of a type checker for it. If you have been following my work, you might know that I have been working on this project on and off for the past few years, yet the...
Exploring the c4... compiler? (registerspill.thorstenball.com)
c4 (“C in four functions”; GitHub)...
Compiling higher order functions with GADTs (injuly.in)
Implementing first class functions in a bytecode interpreter is trivial....
The search for easier safe systems programming (blog post + language) (www.sophiajt.com)
For the last year and a half, I and my recently-added collaborator Jane Losare-Lusby have been working in secret on a safe systems language that could be learned about as quickly as one can learn Go. I think we might have something worth exploring....
Jolie, the service-oriented programming language (www.jolie-lang.org)
From the homepage:...
MIT PL Review 2024 (proceedings) (plr.csail.mit.edu)
This was a conference at MIT that was held 2 days ago. The presentations are all recorded here, and there are summaries and links to the presented papers on the main site....
Notes on Implementing Algebraic Subtyping (blog post + language) (semantic.org)
Algebraic Subtyping is a type system devised by Stephen Dolan in 2016, in his dissertation. It extends Hindley-Milner with subtyping, in a way that preserves decidability and principality. Over the past few years, I have implemented Algebraic Subtyping in my language Pinafore (omitting record types). Pinafore is, as far as I...
Cognition (language with powerful metaprogramming) (ret2pop.nullring.xyz)
From the GitHub:...
Borgo (language) (borgo-lang.github.io)
GitHub...
PLDI 2024 List of Accepted Papers (pldi24.sigplan.org)
Befreak (esolang) (tunes.org)
Befreak is a purely reversible two-dimensional programming language. It was inspired by the Chris Pressey’s Befunge programming language. Like Befunge, all Befreak instructions are written as a single character, and execution can flow north, south, east, and west....
Composability: Designing a Visual Programming Language (johnaustin.io)
*Lattice is a high-performance visual scripting system targeting Unity ECS. Read more here....
Borrow checking, RC, GC, and the Eleven (!) Other Memory Safety Approaches (verdagon.dev)
The author of this blog is also the creator of Vale, an experimental language with generational references (which is one of the named approaches)....
Beatrice: A finally tagless, dependently typed, homoiconic programming language (hirrolot.github.io)
Today I am pleased to announce Beatrice, which is a finally tagless, dependently typed, self-aware functional programming language that I have been working on for quite a while. In this short blog post, I will demonstrate its most prominent features and contrast them to those of mainstream programming languages....
Dataflow Analyses and Compiler Optimizations that Use Them, for Free (blog.regehr.org)
One of my research group’s major goals is to create technologies that enable self-improving compilers. Taking humans out of the compiler-improvement loop will make this process orders of magnitude faster, and also the resulting compilers will tend to be correct by construction. One such technology is superoptimization, where...
Parsing and all that (blog.jeffsmits.net)
A longer article on the different types of parsers and how they work, with a lot of state machine diagrams and some Rust code samples.
Coroutines and effects (article) (without.boats)
For the past few months I’ve been mulling over some things that Russell Johnston made me realize about the relationship between effect systems and coroutines. You can read more of his thoughts on this subject here, but he made me realize that effect systems (like that found in Koka) and coroutines (like Rust’s async...
Narya: A proof assistant for higher-dimensional type theory (GitHub) (github.com)
Narya is eventually intended to be a proof assistant implementing Multi-Modal, Multi-Directional, Higher/Parametric/Displayed Observational Type Theory, but a formal type theory combining all those adjectives has not yet been specified. At the moment, Narya implements a normalization-by-evaluation algorithm and typechecker for...
1ML - ML with true first-class modules, “everything is a module” (old) (people.mpi-sws.org)
Project has been dead for several years but the idea seems interesting....
19 April 2024 (sh.itjust.works)
Writing an EBNF -> Scheme parser generator using AI for machine-unfriendly descriptions, and further enhancements?
Hey. I have made some DSLs before, and for all of them, most of which were in C, I have used Flex and Bison. But this time I wanna use Scheme, Cyclone Scheme to be exact. I can potentially use Flex/Bison this time too, because Cyclone has a strong FFI to C....
Zest: syntax (design of a programming language) (www.scattered-thoughts.net)
This article sketches out the syntax for a small language and explains the design decisions....
It's time to mentally prepare yourselves for this (lemmy.world)