plugin architectures in haskellhal2016.haskell.org/slides/hal2016-graf.pdf · haskell 3 stand-alone...

20
Plugin Architectures in Haskell An Overview over the ecosystem Sebastian Graf September 15, 2016 https://github.com/sgraf812/hal16

Upload: others

Post on 17-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto

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

Motivation

Page 3: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto

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

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

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

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

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

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

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

Shootout

Page 11: Plugin Architectures in Haskellhal2016.haskell.org/slides/HAL2016-graf.pdf · Haskell 3 Stand-alone UsestheGHCAPI,includingcompilationspecific settingspaths7 Type safety throughbrokenTypeableoverloads,fallingbackto

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

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

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

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

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

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

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

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

Thanks! Questions?

10