caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: oleg@okmij.org
To: raphlalou@gmail.com
Cc: caml-list@inria.fr, martin.jambon@ens-lyon.org
Subject: Re: [Caml-list] I never succeeded in using Format
Date: 10 Mar 2014 00:47:25 -0000	[thread overview]
Message-ID: <20140310004725.65096.qmail@www1.g3.pair.com> (raw)
In-Reply-To: <CAAmHUAnXvyZdCgcrYmWHhHkM+tXa0wh+ptVUF4f6Fh3a_DjARg@mail.gmail.com>


> Another alternative to format for pretty-printing code (or other things): PPrint
>
> Release blog post (with some examples of use):
> http://gallium.inria.fr/blog/first-release-of-pprint/
> Documentation: http://gallium.inria.fr/~fpottier/pprint/doc/PPrint.html
> Installation instruction: `opam install pprint`

That formatter uses Wadler's Pretty-printer, which is not optimal. The
optimal one takes linear time in the size of the document (regardless
of the page width), and, for constant page width, formats documents of
any size in constant space. It is obviously incremental and has
bounded latency. There are several optimal formatters. The recent one
was based on simple generators, described in
        http://okmij.org/ftp/continuations/PPYield/index.html#pp

Curiously, a Clojure programmer has read our paper and re-wrote the
algorithm in Clojure -- without any help from us. It seems he is very
satisfied with the results:
        https://github.com/brandonbloom/fipp
That web page has a few examples.



  reply	other threads:[~2014-03-10  0:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 16:34 Matthieu Dubuget
2014-03-06 16:46 ` Jeremy Yallop
2014-03-06 16:47 ` Benoit Vaugon
2014-03-06 17:02   ` Matthieu Dubuget
2014-03-06 17:06     ` David Sheets
2014-03-06 17:09       ` Matthieu Dubuget
2014-03-06 19:08         ` Martin Jambon
2014-03-07  7:20           ` Raphaël Proust
2014-03-10  0:47             ` oleg [this message]
2014-03-10 11:28               ` Bob Atkey
2014-03-11  9:32                 ` oleg
2014-03-14 10:21                   ` Francois Pottier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140310004725.65096.qmail@www1.g3.pair.com \
    --to=oleg@okmij.org \
    --cc=caml-list@inria.fr \
    --cc=martin.jambon@ens-lyon.org \
    --cc=raphlalou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).