Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] C Interface, Libraries, and Books?

Expand Messages
  • Francois Berenger
    ... Even just an OCaml pocket reference a la O Reilly would be nice...
    Message 1 of 13 , May 14, 2012
    • 0 Attachment
      On 05/15/2012 03:08 AM, Ashish Agarwal wrote:
      > On Sun, May 13, 2012 at 12:27 PM, jr <jrvelman@...
      > <mailto:jrvelman%40gmail.com>> wrote:
      >
      > > **
      > >
      > > 2. How about standard libraries?
      > >
      > Right now there are two viable standard libraries, Batteries and Core. Both
      > are good, and I end up using both in most of my projects. Core is
      > undergoing significant updates, and is currently in an unstable state. That
      > should change soon, a few weeks or sooner. I think Batteries has better
      > documentation and is easier for a beginner to get started with.
      >
      > Does "Batteries" compile on OS X Lion
      > >
      > Yes.
      >
      > > (how about upcoming Mountain Lion)?
      > >
      > Not sure, but as always there can be problems when a new OS comes out.
      > Various issues have arisen with previous OS X updates, so I'd avoid it if
      > you want to be sure OCaml will work right away.
      >
      > I see that there are a number of packages out there that emulate
      > > Parsec. Is one 'standard'?
      > >
      > Which ones have you found? Actually, I don't think OCaml has a library
      > comparable to Parsec. There is an OCaml port of Parsec, but it was not
      > developed after its initial release, and as far as I know is not in a
      > usable state.
      >
      > 3. Is there a decent physical book available (in English)
      > >
      > No, but you can print the free PDFs. :) Otherwise, you have to wait for
      > Real World OCaml.

      Even just an "OCaml pocket reference" a la O'Reilly would be nice...

      > [Non-text portions of this message have been removed]
      >
      >
    • Sergei Steshenko
      ... Even though I grew up with traditional books, I do not understand fascination with them. Electronic documents (unless they are just pixel scans) allow
      Message 2 of 13 , May 14, 2012
      • 0 Attachment
        ----- Original Message -----
        > From: Francois Berenger <berenger@...>
        > To: ocaml_beginners@yahoogroups.com
        > Cc:
        > Sent: Tuesday, May 15, 2012 3:45 AM
        > Subject: Re: "ocaml_beginners"::[] C Interface, Libraries, and Books?
        >
        > On 05/15/2012 03:08 AM, Ashish Agarwal wrote:
        >> On Sun, May 13, 2012 at 12:27 PM, jr <jrvelman@...
        >> <mailto:jrvelman%40gmail.com>> wrote:
        >>
        >>   > **
        >>   >
        >>   > 2. How about standard libraries?
        >>   >
        >> Right now there are two viable standard libraries, Batteries and Core. Both
        >> are good, and I end up using both in most of my projects. Core is
        >> undergoing significant updates, and is currently in an unstable state. That
        >> should change soon, a few weeks or sooner. I think Batteries has better
        >> documentation and is easier for a beginner to get started with.
        >>
        >> Does "Batteries" compile on OS X Lion
        >>   >
        >> Yes.
        >>
        >>   > (how about upcoming Mountain Lion)?
        >>   >
        >> Not sure, but as always there can be problems when a new OS comes out.
        >> Various issues have arisen with previous OS X updates, so I'd avoid it
        > if
        >> you want to be sure OCaml will work right away.
        >>
        >> I see that there are a number of packages out there that emulate
        >>   > Parsec. Is one 'standard'?
        >>   >
        >> Which ones have you found? Actually, I don't think OCaml has a library
        >> comparable to Parsec. There is an OCaml port of Parsec, but it was not
        >> developed after its initial release, and as far as I know is not in a
        >> usable state.
        >>
        >> 3. Is there a decent physical book available (in English)
        >>   >
        >> No, but you can print the free PDFs. :) Otherwise, you have to wait for
        >> Real World OCaml.
        >
        > Even just an "OCaml pocket reference" a la O'Reilly would be
        > nice...
        >

        Even though I grew up with traditional books, I do not understand fascination with them.

        Electronic documents (unless they are just pixel scans) allow _search_ in them - a very helpful feature.

        Regards,
          Sergei.
      • jr
        ... A quick google search gave me PCL, Plank, Mparser, and ocaml-parsec. I hadn t looked into any of them further than the google headlines. Further look
        Message 3 of 13 , May 15, 2012
        • 0 Attachment
          On May 14, 2012, at 11:08 AM, Ashish Agarwal wrote:

          > On Sun, May 13, 2012 at 12:27 PM, jr <jrvelman@...> wrote:
          >
          > > **
          > >
          > > 2. How about standard libraries?
          > >
          > [snip]
          >
          > I see that there are a number of packages out there that emulate
          > > Parsec. Is one 'standard'?
          > >
          > Which ones have you found? Actually, I don't think OCaml has a library
          > comparable to Parsec. There is an OCaml port of Parsec, but it was not
          > developed after its initial release, and as far as I know is not in a
          > usable state.

          A quick google search gave me PCL, Plank, Mparser, and ocaml-parsec. I hadn't looked into any of them further than the google headlines. Further look hasn't given me much confidence.

          Asking about Parsec style parsers was probably too limiting, and showed my own lack of experience. I one time created a parser with Parsec to parse the concrete syntax for conceptual graphs that was to be contained in ISO/IEC 24707 standard for Common Logic. My parser didn't go anywhere, except while the draft standard was under development I was able to suggest some corrections and clarifications to the authors. (http://www.jfsowa.com/cg/cgdpansw.htm)

          I've also used prolog's definite clause grammar a good deal more, but quite a long time ago. (Tinkering with natural language processing, and writing a parser for my own language to verify my bank statement.)

          I have a number of things in mind that I might want a parser for, but nothing too specific at the moment.

          In ancient times, I used lex and yacc, but want something more integrated in the language (like, for example, DCG or parsec).

          I now see that Batteries has a simple parser combinator library, BatParserCo. , but said to be very rough.



          >
          > 3. Is there a decent physical book available (in English)
          > >
          > No, but you can print the free PDFs. :) Otherwise, you have to wait for
          > Real World OCaml.

          I'm doing this. There are some very good PDFs.

          > [snip]
          >
        • Ashish Agarwal
          On Tue, May 15, 2012 at 7:27 PM, jr wrote: ** ... I m not a big fan of lex/yacc either, but if you do need to go that route keep Menhir in
          Message 4 of 13 , May 15, 2012
          • 0 Attachment
            On Tue, May 15, 2012 at 7:27 PM, jr <jrvelman@...> wrote:

            **
            > In ancient times, I used lex and yacc, but want something more integrated
            > in the language (like, for example, DCG or parsec).
            >

            I'm not a big fan of lex/yacc either, but if you do need to go that route
            keep Menhir in mind. It is like lex/yacc but much better.


            [Non-text portions of this message have been removed]
          • Francois Berenger
            ... There are also ocamllex and ocamlyacc: http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html
            Message 5 of 13 , May 15, 2012
            • 0 Attachment
              On 05/16/2012 11:21 AM, Ashish Agarwal wrote:
              > On Tue, May 15, 2012 at 7:27 PM, jr <jrvelman@...
              > <mailto:jrvelman%40gmail.com>> wrote:
              >
              > **
              > > In ancient times, I used lex and yacc, but want something more integrated
              > > in the language (like, for example, DCG or parsec).
              > >
              >
              > I'm not a big fan of lex/yacc either, but if you do need to go that route
              > keep Menhir in mind. It is like lex/yacc but much better.

              There are also ocamllex and ocamlyacc:
              http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html

              > [Non-text portions of this message have been removed]
              >
              >
            • Gabriel Scherer
              Menhir is noticeably better than ocamlyacc; it does not replace ocamllex (I sometimes use ulex, I think it helps to parse UTF8 input).
              Message 6 of 13 , May 16, 2012
              • 0 Attachment
                Menhir is noticeably better than ocamlyacc; it does not replace
                ocamllex (I sometimes use ulex, I think it helps to parse UTF8 input).

                http://cristal.inria.fr/~fpottier/menhir/

                Quoting this web page:

                > Why prefer Menhir to ocamlyacc?
                >
                > - Menhir allows the definition of a nonterminal symbol to be
                > parameterized by other (terminal or nonterminal)
                > symbols. Furthermore, it offers a library of standard parameterized
                > definitions, including options, sequences, and lists. It offers some
                > support for EBNF syntax, via the ?, +, and * modifiers.
                >
                > - ocamlyacc only accepts LALR(1) grammars. Menhir accepts LR(1)
                > grammars, thus avoiding certain artificial conflicts.
                >
                > - Menhir's %inline keyword helps avoid or resolve some LR(1) conflicts
                > without artificial modification of the grammar.
                >
                > - Menhir explains conflicts in terms of the grammar, not just in terms
                > of the automaton. Menhir's explanations are believed to be
                > understandable by mere humans.
                >
                > - Menhir offers an interpreter that helps debug grammars
                > interactively.
                >
                > - Menhir allows grammar specifications to be split over multiple
                > files. It also allows several grammars to share a single set of
                > tokens.
                >
                > - Menhir produces reentrant parsers.
                >
                > - Menhir is able to produce parsers that are parameterized by OCaml
                > modules.
                >
                > - ocamlyacc requires semantic values to be referred to via keywords:
                > $1, $2, and so on. Menhir allows semantic values to be explicitly
                > named.




                On Wed, May 16, 2012 at 4:43 AM, Francois Berenger <berenger@...> wrote:
                > On 05/16/2012 11:21 AM, Ashish Agarwal wrote:
                >> On Tue, May 15, 2012 at 7:27 PM, jr <jrvelman@...
                >> <mailto:jrvelman%40gmail.com>> wrote:
                >>
                >> **
                >>  > In ancient times, I used lex and yacc, but want something more integrated
                >>  > in the language (like, for example, DCG or parsec).
                >>  >
                >>
                >> I'm not a big fan of lex/yacc either, but if you do need to go that route
                >> keep Menhir in mind. It is like lex/yacc but much better.
                >
                > There are also ocamllex and ocamlyacc:
                > http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html
                >
                >> [Non-text portions of this message have been removed]
                >>
                >>
                >
                >
                >
                > ------------------------------------
                >
                > Archives up to December 31, 2011 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners
                > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
                > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo! Groups Links
                >
                >
                >
              • Dario Teixeira
                Hi, ... Indeed.  This cannot be stressed enough: Menhir is not only better than ocamlyacc in the sense that it is more powerful and it has more features, but
                Message 7 of 13 , May 16, 2012
                • 0 Attachment
                  Hi,

                  > Menhir is noticeably better than ocamlyacc; it does not replace

                  > ocamllex (I sometimes use ulex, I think it helps to parse UTF8 input).

                  Indeed.  This cannot be stressed enough: Menhir is not only better
                  than ocamlyacc in the sense that it is more powerful and it has more
                  features, but also because it is a much better tool for beginners.
                  You do get the best of both worlds with Menhir, and there's really
                  no reason to "start with ocamlyacc and switch to Menhir if necessary".

                  Cheers,
                  Dario Teixeira
                • Ashish Agarwal
                  On Wed, May 16, 2012 at 5:00 AM, Gabriel Scherer ... Yes, thanks for the correction. ... [Non-text portions of this message have been removed]
                  Message 8 of 13 , May 16, 2012
                  • 0 Attachment
                    On Wed, May 16, 2012 at 5:00 AM, Gabriel Scherer
                    <gabriel.scherer@...>wrote:


                    > Menhir ... does not replace
                    > ocamllex (I sometimes use ulex, I think it helps to parse UTF8 input).
                    >
                    Yes, thanks for the correction.

                    Quoting this web page:
                    >
                    > > Why prefer Menhir to ocamlyacc?
                    > >
                    > > - Menhir allows the definition of a nonterminal symbol to be
                    > > parameterized by other (terminal or nonterminal)
                    > > symbols. Furthermore, it offers a library of standard parameterized
                    > > definitions, including options, sequences, and lists. It offers some
                    > > support for EBNF syntax, via the ?, +, and * modifiers.
                    > >
                    > > - ocamlyacc only accepts LALR(1) grammars. Menhir accepts LR(1)
                    > > grammars, thus avoiding certain artificial conflicts.
                    > >
                    > > - Menhir's %inline keyword helps avoid or resolve some LR(1) conflicts
                    > > without artificial modification of the grammar.
                    > >
                    > > - Menhir explains conflicts in terms of the grammar, not just in terms
                    > > of the automaton. Menhir's explanations are believed to be
                    > > understandable by mere humans.
                    > >
                    > > - Menhir offers an interpreter that helps debug grammars
                    > > interactively.
                    > >
                    > > - Menhir allows grammar specifications to be split over multiple
                    > > files. It also allows several grammars to share a single set of
                    > > tokens.
                    > >
                    > > - Menhir produces reentrant parsers.
                    > >
                    > > - Menhir is able to produce parsers that are parameterized by OCaml
                    > > modules.
                    > >
                    > > - ocamlyacc requires semantic values to be referred to via keywords:
                    > > $1, $2, and so on. Menhir allows semantic values to be explicitly
                    > > named.
                    >
                    >
                    > On Wed, May 16, 2012 at 4:43 AM, Francois Berenger <berenger@...>
                    > wrote:
                    > > On 05/16/2012 11:21 AM, Ashish Agarwal wrote:
                    > >> On Tue, May 15, 2012 at 7:27 PM, jr <jrvelman@...
                    > >> <mailto:jrvelman%40gmail.com>> wrote:
                    > >>
                    > >> **
                    > >> > In ancient times, I used lex and yacc, but want something more
                    > integrated
                    > >> > in the language (like, for example, DCG or parsec).
                    > >> >
                    > >>
                    > >> I'm not a big fan of lex/yacc either, but if you do need to go that
                    > route
                    > >> keep Menhir in mind. It is like lex/yacc but much better.
                    > >
                    > > There are also ocamllex and ocamlyacc:
                    > > http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html
                    > >
                    > >> [Non-text portions of this message have been removed]
                    > >>
                    > >>
                    > >
                    > >
                    > >
                    > > ------------------------------------
                    > >
                    > > Archives up to December 31, 2011 are also downloadable at
                    > http://www.connettivo.net/cntprojects/ocaml_beginners
                    > > The archives of the very official ocaml list (the seniors' one) can be
                    > found at http://caml.inria.fr
                    > > Attachments are banned and you're asked to be polite, avoid flames
                    > etc.Yahoo! Groups Links
                    > >
                    > >
                    > >
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  Your message has been successfully submitted and would be delivered to recipients shortly.