Programming Languages

Build Systems à la Carte with Effect Handlers

As­signed to To­bias Awotula.

Al­ge­braic ef­fect han­dlers have been gain­ing at­ten­tion in pro­gram­ming lan­guage re- search. They offer a new, ab­stract way of con­trol flow. In this the­sis we do a case study on re­pro­duc­ing a Haskell frame­work for build sys­tems in Ef­fekt, a new pro­gram­ming lan­guage with sup­port for al­ge­braic ef­fect han­dlers.

The goal of this the­sis is to show­case Ef­fekt’s fea­tures, pre­sent a suc­cess­ful re­pro- duc­tion of the build sys­tem frame­work, and as part of this re­pro­duc­tion, eval­u­ate Ef­fekt’s abil­ity to re­place mon­ads and monad trans­form­ers with ef­fects and ef­fect han­dlers.

To do this, first an in­tu­ition for al­ge­braic ef­fects han­dlers is given, to­gether with a short overview of some basic fea­tures of Ef­fekt. Then the paper pre­sent­ing the Haskell frame­work, “Build Sys­tems à la Carte”, is in­tro­duced, and an overview is given over the terms it uses, as well as an overview of the ab­strac­tions of its frame- work’s com­po­nents. Fol­low­ing that, the code of the frame­work com­po­nents that are re­pro­duced in Ef­fekt are listed side by side with their orig­i­nal Haskell coun­ter­parts, the code is com­pared against each other and the dif­fer­ences are rea­soned about. Fi­nally, the re­sults of the re­pro­duc­tion are dis­cussed.

The major find­ing of this case study is, that the Haskell build sys­tem frame­work, which heav­ily re­lies on mon­ads and monad trans­form­ers can be suc­cess­fully re­pro- duced in Ef­fekt, with ef­fects and ef­fect han­dlers re­plac­ing mon­ads, monad trans- for­m­ers and monadic op­er­a­tions, al­beit in its whole, the re­pro­duced com­po­nents are less ver­sa­tile due to Ef­fekt’s ef­fects being less poly­morph on their pa­ra­me­ter types. Ad­di­tion­ally, when trans­lat­ing a frame­work com­po­nent from Haskell to Ef­fekt, in most cases the qual­ity of min­i­mal­ity is lost.

These find­ings sug­gests that per­haps some fea­tures should be added to make the Ef­fekt lan­guage more ver­sa­tile and to show­case promi­nent up­sides when re­plac­ing mon­ads and monad trans­form­ers with ef­fects and ef­fect Han­dlers.

Con­tact

Philipp Schus­ter