instaparse

If you're not trampolining your parser, why bother getting up in the morning?
meow 2016-01-12T08:01:52.000009Z

what is performance like for instaparse - someone I'm working with had a problem in the past with it being slow but never tracked down the source of the problem

ska 2016-01-12T10:12:28.000010Z

When parsing becomes slow, it might be due to the grammar being ambiguous. In general, I'd say that Instparse is good enough for many use cases, even if I've read papers complaining about the perf. The one that I still have was written in German, though.

meow 2016-01-12T10:27:53.000011Z

I'll tell the #C0J20813K devs to come here to find out how to parse fast

meow 2016-01-12T10:28:19.000012Z

@rafd: ^

meow 2016-01-12T10:29:01.000013Z

@ska: thanks for the info! :simple_smile:

rafd 2016-01-12T13:06:37.000016Z

@jamesnvc ^

2016-01-12T15:47:20.000019Z

hello

2016-01-12T15:47:52.000020Z

Yeah, I really like using instaparse server-side, but I tried writing one in cljs (pretty simple, just extracting links) and it was noticeably slow...

2016-01-12T15:48:06.000021Z

it was being called on a lot of text, but is there something I should be doing?

ska 2016-01-12T15:55:09.000022Z

@jamesnvc: sometimes it is possible to chunk the text before parsing it. For example, when parsing logfiles use instaparse just for the lines not the whole file.

2016-01-12T15:55:45.000023Z

This is a bunch of little chunks of text; being called on the text of each message in a chat client

2016-01-12T15:56:16.000024Z

I’ll try writing the grammar again and make sure it isn’t ambiguous

ghadi 2016-01-12T16:15:12.000025Z

I have a new parser that should be much faster than instaparse if you have no ambiguity

ghadi 2016-01-12T16:15:31.000026Z

https://github.com/ghadishayban/pex

ghadi 2016-01-12T16:15:56.000028Z

needs better docs 😃

2016-01-12T16:35:51.000030Z

oh cool, I’ll give that a shot, thanks!

2016-01-12T16:37:32.000031Z

@ghadi oh, does this work in clojurescript though? That is my issue with instaparse — my clj perf is fine, but cljs leaves something to be desired

ghadi 2016-01-12T16:37:55.000032Z

oh, no it doesn't

ghadi 2016-01-12T16:38:15.000033Z

should perform well there too, want to port a virtual machine ? 😉

2016-01-12T16:50:08.000037Z

Oh, interesting...

2016-01-12T16:50:35.000038Z

I may consider that, if just as a fun project!

ghadi 2016-01-12T17:07:17.000039Z

Peg.js is pretty nice, IMHO