unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Getting started with Guile Parser Combinators
@ 2016-06-19 18:57 Amirouche Boubekki
  2016-06-20 17:34 ` Thompson, David
  0 siblings, 1 reply; 2+ messages in thread
From: Amirouche Boubekki @ 2016-06-19 18:57 UTC (permalink / raw)
  To: Guile User

Héllo,


There is an implementation of guile parser combinators available here 
[1].

Here's my attempt at explaining how it works:

http://hyperdev.fr/notes/getting-started-with-guile-parser-combinators.html

HTH!

[1] git clone git://dthompson.us/guile-parser-combinators



-- 
Amirouche ~ amz3 ~ http://www.hyperdev.fr



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Getting started with Guile Parser Combinators
  2016-06-19 18:57 Getting started with Guile Parser Combinators Amirouche Boubekki
@ 2016-06-20 17:34 ` Thompson, David
  0 siblings, 0 replies; 2+ messages in thread
From: Thompson, David @ 2016-06-20 17:34 UTC (permalink / raw)
  To: Amirouche Boubekki; +Cc: Guile User

On Sun, Jun 19, 2016 at 2:57 PM, Amirouche Boubekki
<amirouche@hypermove.net> wrote:
> Héllo,
>
>
> There is an implementation of guile parser combinators available here [1].
>
> Here's my attempt at explaining how it works:
>
> http://hyperdev.fr/notes/getting-started-with-guile-parser-combinators.html

This was lovely, thanks!  Glad to see someone using my parser
combinator library.

Knowing that someone is actually using this library makes me a bit
embarrassed about its naive implementation.  I said some of these
things on IRC, but I'd like to list some desired future improvements
here too in the hope that maybe some interested hackers will read it
and jump in to help:

- Stop using SRFI-41 streams. It's very elegant, but wrapping each
character in a stream-pair is inefficient. In order to replace it, we
need another abstraction around a port that allows for backtracking
across the entire text without all of the allocation.

- Temporarily memoize parse results.  It happens often enough that the
same parser will be used on the same character of the stream, so
memoization would improve performance.  The usual memoize
implementation uses a hash table that will not be GC'd as long as the
procedure is alive.  This unbounded memory growth would be a big
problem for a parsing library, so it would be better if the hash table
could be cleared once parsing a file has completed.

- Unlock GLL parsing abilities. With some control-flow hackery[0], it
is possible to handle left-recursive grammars without entering an
infinite loop.  Would be cool to have this ability while also
preserving the purely functional semantics of the current design.

- Dave

[0] https://github.com/epsil/gll#continuation-passing-style



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-20 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-19 18:57 Getting started with Guile Parser Combinators Amirouche Boubekki
2016-06-20 17:34 ` Thompson, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).