freenode/#lisp - IRC Chatlog
Search
17:48:36
jasom
contrapunctus: if you backtrack alot, esrap will be fast, if you backtrack rarely, it will be slow. I wrote an esrap parser for json and then basically the identical code as a recursive-descent parser and the latter was faster just because there was no backtracking. On the other hand I did a parser for restructured-text tables with a monadic parser and esrap beat the pants off of it, because it
17:52:43
jasom
contrapunctus: aren't smug and MaxPC very similar interfaces? They are both monadic parsers.
18:12:31
contrapunctus
jasom: thanks for telling me about the effect of backtracking on performance; I'll try to analyze how often the language I'm trying to implement requires it, and keep it in mind when choosing a library.
18:13:29
jasom
contrapunctus: I mostly use esrap unless I know parsing will impact performance of the system, fwiw
18:43:32
fiddlerwoaroof
contrapunctus: I wrote a parser for EDN with smug, and it was fast enough but significantly slower than Clojure's implementation (for $work I have to be able to process EDN files that are 10s of MB)
18:44:09
fiddlerwoaroof
The interface isn't horrible, if you know a little about parser-combinators :)
18:46:19
fiddlerwoaroof
ACTION is havign weird issues with emacs allocating and never gcing like 10GB of memory
18:48:18
rig0rmortis
fiddlerwoaroof: have you tweaked gc-cons-threshold? I have (setq gc-cons-threshold 50000000) in my init to gc after 50mb
18:54:32
fiddlerwoaroof
If you need a textual way to serialize data structures, it's one of the better ones :) Fewer limitations than JSON, less annoying than YAML
20:36:09
pve
_death: a follow-up to my metaclass trouble: it seems your suggestion to have one supermetaclass worked, so big thanks
22:40:10
no-defun-allowed
fiddlerwoaroof: If it looks vaguely like s-expressions, could a dispatch table technique work for EDN? That might be faster.
22:43:53
contrapunctus
Trying to understand how to emit the IR for CommonDoc. There is documentation for defining the format as a GF with the associated methods, as well as for constructing a document as CLOS objects, but that seems different from what the Scriba parser does - it returns some plists. I could start trying to replicate its output, but I'd feel more confident if I could see some documentation on this subject...
22:44:30
contrapunctus
...hm, maybe I could go through the CommonDoc sources to understand what it expects 🤔
23:51:34
elioat
does anyone know of a way to "pretty print" an s-expression when it is written to a file? I have a function that saves an s-expression to a file to later read it back
23:57:09
Bike
keep in mind that if you pretty print it it's very possible it can't be read back (by CL:READ)
23:59:06
elioat
that's a good point, Bike thanks! -- I'm thinking that a may actually just have a dump function that is for displaying this data in a human friendly manner, and then keep things as is.