Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
peter-winter
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
peter-winter
5y ago
I just relased a new version. GCC compiles a JSON parser example in less than 8 seconds. Still on a low resource VM.
2.
▲
by
peter-winter
5y ago
Not at all. I didn't try too hard to optimze it yet, and when I use a modern physical machine, it will probably be more like 20 seconds already. I bet I could make it twice as fast after optimization.
3.
▲
by
peter-winter
5y ago
It produces bunch of arrays, the parse algorithm is trivial. For json grammar the arrays measure in kilobytes. For a programming language, probably several megabytes. Anyways, the binary should be comparable to Bison generated, at least if
4.
▲
by
peter-winter
5y ago
Personal. But would galdly use it in production if given opportunity.
5.
▲
by
peter-winter
5y ago
I'm the author, let me just answer this one. Spirit produces recursive descent parser, ctpg produces LR(1). So the parse speed is just much better. And the set of possible language grammars is bigger. Plus (this is just my opinion) ctp
6.
▲
by
peter-winter
5y ago
Well, the json parser example is th heaviest one, compiling about a minute on my 2 core virtual machine. I guess it doesn' really matter, you can always put the parser definition is a separate compilation unit. The language grammar you
7.
▲
by
peter-winter
5y ago
Yes OP (me) is the author. Thanks for the kind words:) I will consider your suggestions. As for the eror recovery, the newest version has error recovery feature.
8.
▲
Show HN: I made a C++ header only library for compile-time parser generation
(github.com)
2 points
by
peter-winter
5y ago
|
0 comments