You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#517 is a good idea but seems like an occasion to rethink/rationalize the various lexers/parsers we currently support (Links, json, XML).
The XML lexer/parser was added a while ago and is not used internally in Links but is exposed as a library function parseXml. I don't know if we have any active use cases where we need this.
@SimonJF has a use case for an HTML parser (i.e. to handle auto-closed tags and non-quoted attributes), which is currently implemented in plain Links using parser combinators, and is probably a lot slower than an ocamllex/yacc parser would be. We could in principle do the same thing to parse plain XML.
The JSON lexer/parser exists to allow parsing JSON messages but is not accessible from Links. Might it be useful to support a parseJson library function - especially if we also were to support sending RPC-calls to other REST-style services (or serving such calls from Links)?
Alternatively, if we want to support efficient parsing of all three either internally or exposed as Links library functions, I can also imagine that there might be standard JSON, XML or HTML parsing libraries available for OCaml that we could simply reuse here. From a quick google of OPAM, yojson appears to support JSON parsing and markup appears to support HTML and XML parsing, and we already depend on both libraries.
The text was updated successfully, but these errors were encountered:
#517 is a good idea but seems like an occasion to rethink/rationalize the various lexers/parsers we currently support (Links, json, XML).
The XML lexer/parser was added a while ago and is not used internally in Links but is exposed as a library function
parseXml
. I don't know if we have any active use cases where we need this.@SimonJF has a use case for an HTML parser (i.e. to handle auto-closed tags and non-quoted attributes), which is currently implemented in plain Links using parser combinators, and is probably a lot slower than an ocamllex/yacc parser would be. We could in principle do the same thing to parse plain XML.
The JSON lexer/parser exists to allow parsing JSON messages but is not accessible from Links. Might it be useful to support a
parseJson
library function - especially if we also were to support sending RPC-calls to other REST-style services (or serving such calls from Links)?Alternatively, if we want to support efficient parsing of all three either internally or exposed as Links library functions, I can also imagine that there might be standard JSON, XML or HTML parsing libraries available for OCaml that we could simply reuse here. From a quick google of OPAM,
yojson
appears to support JSON parsing andmarkup
appears to support HTML and XML parsing, and we already depend on both libraries.The text was updated successfully, but these errors were encountered: