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

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

No, you can opportunistically do processing of your data. That's what SAX/SAJ (vs. DOM) parsers allow you to do. Similar approaches are there for JSON. simdjson [1] is streaming too, but the interface is different from SAX/SAJ. - Oleg [1] https://simdjson.github.io/simdjson/md_doc_ondemand_design.html On 1.3.2024 15.52, Olaf Klinke wrote:
Is streaming and parallel processing incompatible with formats such as XML or JSON,
participants (2)
-
Olaf Klinke
-
Oleg Grenrus