caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] Planck: a small monadic parser combinator library for OCaml
@ 2011-05-28  2:11 Jun Furuse
  2011-05-29  9:14 ` Gabriel Scherer
  0 siblings, 1 reply; 3+ messages in thread
From: Jun Furuse @ 2011-05-28  2:11 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

Hi,

I've released a small monadic parser combinator library for OCaml, Planck
version 1.0.0, available at:

    https://bitbucket.org/camlspotter/planck/get/v1.0.0.tar.gz

It is firstly just for my fun to learn what is Parsec/parser combinators,
but it is now elaborated to something useful:

    - input positions by lines and columns
    - char specialized stream for better performance
    - operator precedence/associativity resolver
    - memoization module for efficient backtracks

For example I could implement OCaml syntax lexer and parser using Planck.

REQUIREMENTS: unfortunately Planck depends on many things:

  - ocaml 3.12.0 or higher
  - findlib
  - omake
  - type-conv 2.3.0 and sexplib 5.2.1 (available from
http://ocaml.janestreet.com/?q=node/13)
  - spotlib (my small utility functions, available at
http://bitbucket.org/camlspotter/spotlib/ )

  The followings are required to compiler ocaml syntax parser example:
  - pa_monad_custom ( http://bitbucket.org/camlspotter/pa_monad_custom/
  - ocaml 3.12.0 source tree and lablgtk-2.14.2 source code tree for testing

The combinators in Planck are implemented simply as functional monadic
combinators over streams (lazy lists). Unfortunately, it is very slow with
the current OCaml compiler (3.12.0) due to its huge closure constructions:
it is about x100 slower than the traditional ocamllex+ocamlyacc. I hope more
aggressive in-lining optimizations in the compiler might speed up the
performance of Planck greatly. You can read some of my rough considerations
in this topic at:


http://camlspotter.blogspot.com/2011/05/planck-small-parser-combinator-library.html

Enjoy,

Jun

[-- Attachment #2: Type: text/html, Size: 2120 bytes --]

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

end of thread, other threads:[~2011-06-06  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-28  2:11 [Caml-list] [ANN] Planck: a small monadic parser combinator library for OCaml Jun Furuse
2011-05-29  9:14 ` Gabriel Scherer
2011-06-06  6:42   ` Jun Furuse

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 NNTP newsgroup(s).