[Haskell-cafe] Is it possible to type a function to accept only literal values?

Olaf Klinke olf at aatal-apotheke.de
Fri Mar 1 13:52:39 UTC 2024


> Recently I was experimenting with a GCC intrinsic functions for x86
> SMID instructions to write a fast CSV parser

Could you please elaborate on what you are planning to vectorize?
Profiling shows that for usually number-heavy formats such as CSV or
JSON, decoding the data fields outweighs the work necessary to decode
the structure of the data format. Thus I assume you would want a
streaming parser to decode input into a structure of yet unparsed blobs
(cassava does this), then traverse the structure in parallel to finish
parsing. I can imagine this poses difficulties to the standard model of
parse error reporting, though, which often relies on sequential
processing. 

Pretty much every streaming framework has incorporated cassava, and
some streaming frameworks have abstractions for parsing. What is
missing? 
(Not related to the OP:) Is streaming and parallel processing
incompatible with formats such as XML or JSON, where well-formedness is
typically determined by the very last byte in the input? (The last
closing parenthesis or tag.)

Olaf



More information about the Haskell-Cafe mailing list