![Page 1: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/1.jpg)
Plugin Architectures in HaskellAn Overview over the ecosystem
Sebastian GrafSeptember 15, 2016https://github.com/sgraf812/hal16
![Page 2: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/2.jpg)
Motivation
![Page 3: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/3.jpg)
Problem Description
[1] [2]
1
![Page 4: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/4.jpg)
Plugin Architecture Requirements
Extensibility through third party codeHaskell as extension language
Stand-alone No compiler toolchain should berequired on the client
Type safety Early and graceful recognition ofincompatible extensions
Maturity Easy integration in a Cabal buildprocess
2
![Page 5: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/5.jpg)
Plugin Architecture Requirements
Extensibility through third party code
Haskell as extension languageStand-alone No compiler toolchain should be
required on the clientType safety Early and graceful recognition of
incompatible extensionsMaturity Easy integration in a Cabal build
process
2
![Page 6: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/6.jpg)
Plugin Architecture Requirements
Extensibility through third party codeHaskell as extension language
Stand-alone No compiler toolchain should berequired on the client
Type safety Early and graceful recognition ofincompatible extensions
Maturity Easy integration in a Cabal buildprocess
2
![Page 7: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/7.jpg)
Plugin Architecture Requirements
Extensibility through third party codeHaskell as extension language
Stand-alone No compiler toolchain should berequired on the client
Type safety Early and graceful recognition ofincompatible extensions
Maturity Easy integration in a Cabal buildprocess
2
![Page 8: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/8.jpg)
Plugin Architecture Requirements
Extensibility through third party codeHaskell as extension language
Stand-alone No compiler toolchain should berequired on the client
Type safety Early and graceful recognition ofincompatible extensions
Maturity Easy integration in a Cabal buildprocess
2
![Page 9: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/9.jpg)
Plugin Architecture Requirements
Extensibility through third party codeHaskell as extension language
Stand-alone No compiler toolchain should berequired on the client
Type safety Early and graceful recognition ofincompatible extensions
Maturity Easy integration in a Cabal buildprocess
2
![Page 10: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/10.jpg)
Shootout
![Page 11: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/11.jpg)
Contenders
3
![Page 12: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/12.jpg)
hslua
Extensibility can’t be easier for third parties, see WoW. 33
Haskell is not lua. 7
Stand-alone The C bits are statically linked, no furtherdependencies. 33
Type safety Neither in called code nor at API boundaries, also luastack. 77
Maturity lua is battle-tested and dead simple to include, yethslua’s API is rather low-level. 3
4
![Page 13: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/13.jpg)
hint
Extensibility Just drop in source files, although packagedependencies are resolved through GHC packageregistry 3
Haskell 3
Stand-alone Uses the GHC API, including compilation specificsettings paths 7
Type safety through broken Typeable overloads, falling back toread/show serialization. 7
Maturity Most-used (52 reverse deps) contender according tohackage. 3
5
![Page 14: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/14.jpg)
dyre
6
![Page 15: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/15.jpg)
dyre
Extensibility You can’t have more than one config file. Merging themrequires knowledge of Haskell. 7
Haskell 3
Stand-alone Needs a complete compiler/stack toolchain available.77
Type safety There are no API boundaries, it’s all one program andconsequently type-checked as one. 33
Maturity Rotting. Only really works with GHC and the globalpackage registry. Mind-bending API. 7
7
![Page 16: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/16.jpg)
dynamic-loader
Extensibility Just drop in object archives. 33
Haskell 3
Stand-alone Although it depends on the GHC API, it works on afresh installation. 3
Type safety Needs reproducible builds in order to work seamlessly.Installed package id needed to find objects. Typeerrors at API boundaries lead to crashes at runtime. 7
Maturity Unwieldy, scarcely documented API. Handling GHCgenerated symbols is low-level and unresolved. 0reverse deps. 7
8
![Page 17: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/17.jpg)
A word about plugins
Extensibility Just drop in object files. Package dependencies viapackage.confs (outdated) 33
Haskell 3
Maturity Nicer API than dynamic-loader, but it’s horriblyoutdated and broken. 777
9
![Page 18: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/18.jpg)
Summary
hslua hint dyre dynamic-loader pluginsExtensibility 33 3 7 33 33
Haskell 7 3 3 3 3
Stand-alone 33 7 77 3 ?Type safety 77 7 33 7 ?Maturity 3 3 77 7 broken
10
![Page 19: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/19.jpg)
Thanks! Questions?
10
![Page 20: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto](https://reader034.vdocuments.net/reader034/viewer/2022050121/5f51d3a491bff915905146b0/html5/thumbnails/20.jpg)
References
http://www.ebay.com/itm/Anime-Cosplay-Pokemon-Go-Pocket-Monster-Ash-Ketchum-Baseball-Trainer-Cap-Hat-/232012326919.Accessed: 2016-09-09.https://upload.wikimedia.org/wikipedia/commons/1/17/Rogue_Screen_Shot_CAR.PNG.Accessed: 2016-09-09.
Check out the code of this talk at https://github.com/sgraf812/hal16
11