combparser
combparser copied to clipboard
related projects (for inspiration + comparison?)
in D:
- pry is a nice project in D, look at the readme, examples and video: https://github.com/DmitryOlshansky/pry https://www.youtube.com/watch?v=NiHU9Mcwkvg example: https://github.com/DmitryOlshansky/pry/blob/master/examples/calc/src/calc.d
maybe worthwhile to borrow some ideas from it?
- https://github.com/PhilippeSigaud/Pegged is another project but not as efficient IIRC example: https://github.com/PhilippeSigaud/Pegged/blob/master/pegged/examples/arithmetic.d
in nim
-
https://github.com/fowlmouth/glossolalia A DSL for quickly writing parsers example: https://github.com/fowlmouth/glossolalia/blob/master/examples/allocs_test.nim
-
https://github.com/Quelklef/lilt Simple language for writing parsers example: http://lilt.readthedocs.io/en/latest/examples.html#parsing-a-number
Very interesting links! Combparser was really based on this which is very functional in style. It's not really optimised at all, but it's not ridiculously slow. One issue I've found with it though is that on older versions of the Nim compiler (pre current devel branch 0.18.1) it might hit the iteration count roof and throw an error. I started writing is as neither the regex module, or the pegs module can run on compile-time, which was essential for the protobuf macro I was writing. Since protobuf now has reached a milestone I'll start looking at this again. Especially optimising how strings flow through the system to avoid copying. I like the idea of pry making efficient parsers on compile-time, seems like something Nim should be very apt for. glossolalia seems very interesting, I'll definitely look more into these when I get the time.