Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Leonid Rozenberg <leonidr@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Learning about compiler-libs
Date: Sat, 8 Aug 2015 00:46:48 +0200	[thread overview]
Message-ID: <CAPFanBGO2arRHTjhmBY8oRpdL=reUbup_aMGkW4vAFrdisSnhA@mail.gmail.com> (raw)
In-Reply-To: <CACR9qb_D2Oy9MQLO84BKePmxRzV6-+Yq1DJ5RwKPa2-WgeL1bA@mail.gmail.com>

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

The short answer is: no, there is no documentation.

The long answer: compiler-libs was made available following the demand of
expert users, that were already familiar with the compiler codebase,
willing to reuse its internals to develop tooling around the language.
Nobody had the time back then to contribute a comprehensive documentation,
or even to define a reasonable API subset to expose (so basically
everything is exposed). Finally, there is no guarantee of API compatibility
across OCaml versions, so reusing this makes you tightly coupled to the
compiler evolution.

Documentation emerges slowly under the form of blog posts, discussions, and
evolution of the codebase. In particular, over the course of his work on
-ppx, Alain Frisch enriched parsing/parsetree.mli with invaluable comments
describing the mapping between concrete and abstract syntax. Everyone is
warmly welcome to contribute such improvements to the (codebase)
documentation.

On Sat, Aug 8, 2015 at 12:25 AM, Leonid Rozenberg <leonidr@gmail.com> wrote:

> Are there any resources besides the couple of blog posts and reading the
> source?
>
> I found this surprising:
>
>         OCaml version 4.02.1
>
> # #use "topfind" ;;
> - : unit = ()
> Findlib has been successfully loaded. Additional directives:
>   #require "package";;      to load a package
>   #list;;                   to list the available packages
>   #camlp4o;;                to load camlp4 (standard syntax)
>   #camlp4r;;                to load camlp4 (revised syntax)
>   #predicates "p,q,...";;   to set these predicates
>   Topfind.reset();;         to force that packages will be reloaded
>   #thread;;                 to enable threads
>
> - : unit = ()
> # #require "compiler-libs.toplevel" ;;
> /Users/leonidrozenberg/.opam/4.02.1/lib/ocaml/compiler-libs: added to
> search path
> /Users/leonidrozenberg/.opam/4.02.1/lib/ocaml/compiler-libs/ocamlcommon.cma:
> loaded
> /Users/leonidrozenberg/.opam/4.02.1/lib/ocaml/compiler-libs/ocamlbytecomp.cma:
> loaded
> /Users/leonidrozenberg/.opam/4.02.1/lib/ocaml/compiler-libs/ocamltoplevel.cma:
> loaded
> # let a x = x + 1 ;;
> >> Fatal error: a unbound at toplevel
> Fatal error: exception Misc.Fatal_error
>

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

      reply	other threads:[~2015-08-07 22:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 22:25 Leonid Rozenberg
2015-08-07 22:46 ` Gabriel Scherer [this message]

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='CAPFanBGO2arRHTjhmBY8oRpdL=reUbup_aMGkW4vAFrdisSnhA@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=leonidr@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