pages/acl.cool/site/draft/assam.dj
Alexander 7e670c7406 asdf
2025-06-14 09:41:45 -04:00

17 lines
No EOL
1 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Algorithm
During the implementation of my library "Aasam", based on the paper "Precedences in specifications and implementations of programming languages" by Annika Aasa, was the first time I fully read and understood an academic CS paper. It's a nice algorithm, and worth revisiting.
If you want to look at the implementation ahead-of-time, [Hackage](https://hackage.haskell.org/package/aasam) has got you covered. Frankly though, just keep reading; it was also the first time I wrote a Haskell program, and the code not terribly penetrable.
## Distfix Grammars
_Distfix grammars and notation are more commonly referred to as "mixfix", but the paper calls them "distfix" and that's what I'm sticking with._
The idea of distfix grammars is to provide a formalism for manipulating user-defined operators. The formalism is weaker than that of context-free grammars--- CFGs can describe far more languages then DFGs--- but it is because of this weakness that we can reason about DFGs with relative ease.
Let's look at a definition.
*STUFF HERE*
As we can see, ...