Add haskell-src as an official machine-readable component of the
Haskell standard
Yitzchak Gale
gale at sefer.org
Wed Nov 17 03:52:47 EST 2010
Ben Millwood wrote:
> So essentially, all you are asking for is an official implementation
> of haskell parsing, so that you input a program and it spits out
> either "valid" or "not valid", according to the parts of the spec that
> it audits.
Yes, that is the most essential requirement.
It is a desirable feature for it to work as a parser, too.
It can then be used as the basis for further verification
tools, and for parsing with guarantees about standards
compliance. And haskell-exts does work as a parser,
though it perhaps not as polished as some other parsers.
If we can get a parser based on haskell-src-exts instead,
that would be great. But it's more work. haskell-exts is
basically ready today.
> ...compliance to a reference implementation...
> tends to be more painful as a process. If there are bugs in the
> reference implementation, other implementations then have to decide
> whether to "implement" them or do what they think is best. If there
> are disagreements between the reference implementation and language
> spec, or ambiguities in language spec, the spec should certainly be
> fixed! ...So I'm not convinced that converting part
> of the language description into a machine-readable form is
> necessarily for the best.
I am not suggesting converting part of the spec into code
and dispensing with that part of the document.
I am suggesting that both the human-readable document and
the reference parser should be officially part of the spec.
If there is inconsistency between them, that is a bug in the spec
which needs to be fixed like any other.
> ...fixity resolution is one of the trickiest parts of Haskell
> parsing, imo. It seems like an awful cop-out to put the really
> difficult cases - like parsing \x -> x == x == 0 - out of the scope of
> your verification tool.
Yes, it should be in scope if possible. If the fixity handling
of haskell-src-exts is deemed sufficient and we move
to that now or in the future, we'll have it.
> ...it seems a bit odd to
> have a complete parsing library that nevertheless doesn't provide AST
> inspection and manipulation, which is what I guess most people use a
> haskell parser in Haskell for.
haskell-src does provide that. It works and it is usable.
Again, if we can be based on haskell-src-exts now or in the
future, all the better.
Regards,
Yitz
More information about the Haskell-prime
mailing list