@hackage symantic-parser0.1.0.20210201
Parser combinators statically optimized and staged via typed meta-programming
Categories
License
GPL-3.0-or-later
Maintainer
Julien Moutinho <julm+symantic-parser@sourcephile.fr>
Links
Versions
- 0.2.1.20210803 Tue, 31 Aug 2021
- 0.2.0.20210703 Sun, 11 Jul 2021
- 0.1.0.20210201 Mon, 1 Feb 2021
- 0.0.0.20210102 Sat, 2 Jan 2021
- 0.0.0.20210101 Fri, 1 Jan 2021
Installation
Tested Compilers
Dependencies (10)
- array
- base >=4.10 && <5
- bytestring
- containers
- ghc-prim
- hashable Show all…
Dependents (0)
Package Flags
dump-core
(off by default)
Dump GHC's Core in HTML
dump-splices
(off by default)
Dump code generated by Template Haskell
Main differences with respect to ParsleyHaskell
-
Extensible primitive grammar combinators, including their underlying optimization passes, by leveraging reciprocal injections between a tagless-final encoding of syntaxes (aka. type-classes) and a corresponding tagful-initial encoding to pattern-match syntaxes (aka. data-instances). This enable a very principled, yet flexible source code. Moreover
DefaultSignaturesare supplied to succinctly derive new semantics (aka. type-class-instances) using automatictransformations. -
Error messages based upon the farthest input position reached (not yet implemented in
ParsleyHaskell). -
Minimal input length checks ("horizon" checks) required for a successful parsing are factorized using a different static analysis than
ParsleyHaskell's "piggy bank" which I've not understood well. This analyis can see beyond calls to subroutines, but maybeParsleyHaskell's analysis can also be adjusted to do the same. Both analysis are not well documented and studied. -
No dependency upon GHC plugins:
lift-pluginandidioms-plugin, because those are plugins hence introduce a bit of complexity in the build processes using this parser, but most importantly they are experimental and mostly cosmetics, since they only enable a cleaner usage of the parsing combinators, by lifting Haskell code inpureto integrate theTemplateHaskellneeded. I do not understand them that much and do not feel confortable to maintain them come the day that their authors abandon them. -
No dependency upon
dependent-mapby keeping observed sharing insidedefandrefcombinators, instead of passing by aDMap. And also when introducing the join-points optimization, where freshTemplateHaskellnames are also directly used instead of passing by aDMap. -
No support for general purpose registers in the
Machineproducing theTemplateHaskellsplices (maybe it will come if I need and understand what's done inParsleyHaskell). -
License is
GPL-3.0-or-laternotBSD-3-Clause.
Main goals
-
For me to better understand ParsleyHaskell, and find a manageable balance between simplicity of the codebase and features of the parser. And by doing so, challenging and showcasing symantic techniques.
-
To support the parsing of tree-like data structures instead of only string-like data structures. Eg. to validate XML using RelaxNG in symantic-xml or to perform routing of HTTP requests in symantic-http-server. This is currently done in those packages using
megaparsec, butmegaparsecis not conceived for such input, and is less principled when it comes to optimizing, like merging alternatives.