You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of classes and traits in this code base have an Alg suffix (FileAlg, GitAlg or SbtAlg for example) which is an abbreviation for algebra. The term is often used in the context of the tagless final encoding for embedding domain specific languages (DSLs) where the algebra is a set of operations over some types which are commonly encoded as traits. But in this code base Alg is not only used for algebras in the tagless final sense but also for final classes (which are sometimes called programs) that take algebras or other programs as parameters. This overly broad usage of the Alg suffix for things that are not algebras is one reason why I grew to dislike it over time and would like to replace it.
Another argument against using that term is that our algebras do not have associated laws that relate the different operations and types to each other. In the context of programming I think of an algebra as a combination of three things: types, operations, and laws. If our "algebras" do not have laws that allow us to restructure our programs according to them without changing their semantics, it is IMO a misnomer to call them algebras.
I'm currently tending to replace Alg with Dsl which I think fits equally well for traits and final classes. The final classes are just higher-level DSLs which are implemented in terms of lower-level DSLs (the traits or other final classes).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
A lot of classes and traits in this code base have an
Algsuffix (FileAlg,GitAlgorSbtAlgfor example) which is an abbreviation for algebra. The term is often used in the context of the tagless final encoding for embedding domain specific languages (DSLs) where the algebra is a set of operations over some types which are commonly encoded astraits. But in this code baseAlgis not only used for algebras in the tagless final sense but also forfinal classes (which are sometimes called programs) that take algebras or other programs as parameters. This overly broad usage of theAlgsuffix for things that are not algebras is one reason why I grew to dislike it over time and would like to replace it.Another argument against using that term is that our algebras do not have associated laws that relate the different operations and types to each other. In the context of programming I think of an algebra as a combination of three things: types, operations, and laws. If our "algebras" do not have laws that allow us to restructure our programs according to them without changing their semantics, it is IMO a misnomer to call them algebras.
I'm currently tending to replace
AlgwithDslwhich I think fits equally well fortraits andfinal classes. Thefinal classes are just higher-level DSLs which are implemented in terms of lower-level DSLs (thetraits or otherfinal classes).Beta Was this translation helpful? Give feedback.
All reactions