caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anthony Tavener <anthony.tavener@gmail.com>
To: Hongbo Zhang <bobzhang1988@gmail.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] We need a rich standard library distributed with OCaml, really
Date: Thu, 27 Aug 2015 01:18:55 -0600	[thread overview]
Message-ID: <CAN=ouMRvhoNXoQw3uOLBTY3f+daBigvDzyXWqhSWsiq8mjhcYQ@mail.gmail.com> (raw)
In-Reply-To: <1C02B1E2-D17D-4008-998E-B17048C62DFA@gmail.com>

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

I tend to live-in and build my own ecosystem anyway, so I haven't used any
of these libraries. But I've looked at them... and I think "containers"
goes for a more self-contained-module approach like you were looking for
with string split... Looking at it now I see the 'sep' function does use a
bit from within the CCParse module it's defined in -- but that module is
built on the parser combinators it defines. I think the individual module
can be taken as-is, or parts of it, without hunting down other module
dependencies.

This doesn't address the core problem you raise. Haven't thought much about
it, as I'm one of the few(?) who is okay with the sparse standard library.
For games, it's pretty much tradition that you write your own stdlib anyway
-- things end up being different... stressing particular use-cases or
performance characteristics. And, overall, not suitable for general
purposes. DBuenzli has contributed a lot which is actually quite
game-relevant, and his style is standalone modules. You could consider his
collection of "libraries" (modules really) as a library in it's own right.
:) Maybe that style is a good model? Come to think of it, the OCaml stdlib
modules are generally quite standalone, aside from Pervasives, aren't they?
So maybe ccube-containers and dbuenzli's style are really very OCaml-ish.

My own stuff, by comparison, is horribly layered with dependencies. I
generated a dot-graph showing dependencies and nearly everything depends on
another module, often which depend on others. I don't like redundant code,
and this is the result... but it makes for modules which cannot be easily
teased apart. Probably similar to Batteries-style.

-Tony


On Wed, Aug 26, 2015 at 8:52 PM, Hongbo Zhang <bobzhang1988@gmail.com>
wrote:

> Dear OCaml developers,
>     I would like to spend one hour in writing down my experience that why
> I had to write some small utilities again and again, since this happened so
> many times that I believe you might come across such issues before.
>     I am doing some compiler hacking tonight, I needed a utility function
> “String.split” which split a string into a list of strings by whitespace,
> it is just one liner if you use str library. However, since I am doing some
> low level stuff, I would try to avoid such big dependency, and I am pretty
> sure that I have ever written it  for at least three times, I just hoped
> that I could get it done quickly, so I am looking into batteries that if I
> can steal some code, I have to copy some code instead of depend on
> batteries, batteries is too big for my projects. `BatString.nsplit` seems
> to fit for what I needed, I copied the definition of `BatString.nsplit`
> into REPL, no luck, it depends on some previously defined functions, then I
> copied the whole module `BatString` into REPL, still no luck, it depended
> on another module `BatReturn`, then I stopped here, it’s time to write my
> own ad-hoc thrown-away `String.split` function again.
>    OCaml is my favorite programming language, and I am very productive at
> it, however, I was annoyed by such things from time to time. We do have
> four *standard libraries* alternatives: batteries, core, extlib and
> ocaml-containers. In my opinion, none of them matches the beauty of the
> OCaml language itself and probably will never catch up if we don’t do
> anything.
>     Note that I don’t want to be offensive to any of these libraries, just
> my personal feedback that why I think it is not a good standard library, *I
> appreciated a lot to people who contribute their precious time in
> maintaining these libraries, better than nothing* : )
>     - Batteries(extlib)
>       It’s big with dependencies between different modules (OCaml does not
> have a good story in dead code elimination), some of its modules are of low
> quality, for example, batEnum is used everywhere while its implementation
> is buggy. batIO makes things even worse since it is not compatible with
> standard library, some type signatures mismatched IIRC.
>     - ocaml-containers
>       Mostly one man’s project
>     - core
>       I believe core has high quality, however, it suffers the same
> problem as batteries, a big dependency. There is a blocking issue, its
> development process is opaque, for an open source community, I would prefer
> a standard library developed in an open environment.
>     I am not expecting that we could have a  standard library as rich as
> python, but for some utilities, I do believe that shipped with standard
> library or officially supported is the best solution.
>    Thanks — Hongbo
>

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

  parent reply	other threads:[~2015-08-27  7:18 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27  2:52 Hongbo Zhang
2015-08-27  6:59 ` Christoph Höger
2015-08-27  7:18 ` Anthony Tavener [this message]
2015-08-27  8:17   ` Gabriel Scherer
2015-08-27 10:35     ` Romain Bardou
2015-08-27 19:55       ` Martin DeMello
2015-08-27 20:10         ` Yotam Barnoy
2015-08-27 23:24           ` Drup
2015-08-28 13:23           ` Philippe Veber
2015-08-27 20:17         ` Raoul Duke
2015-08-27 23:10       ` Martin Jambon
     [not found]     ` <20150827174554.14858.6618@localhost>
2015-08-27 18:42       ` [Caml-list] Fwd: " Emmanuel Surleau
2015-08-27 21:17     ` [Caml-list] " Paolo Donadeo
2015-08-27 21:51       ` Oliver Bandel
2015-08-27 21:56         ` Oliver Bandel
2015-08-27 22:04           ` Oliver Bandel
2015-08-28  0:50     ` Hongbo Zhang
2015-08-31 16:06     ` Stéphane Glondu
2015-08-31 16:14       ` Francois Berenger
2015-08-31 16:44         ` Hendrik Boom
2015-08-31 18:04           ` Ian Zimmerman
2015-08-31 17:26         ` Stéphane Glondu
2015-09-01 15:06           ` Anil Madhavapeddy
2015-08-31 17:34       ` Oliver Bandel
2015-09-01 13:46       ` Gabriel Scherer
2015-08-27  8:07 ` Sébastien Hinderer
2015-08-27  8:20   ` Daniil Baturin
2015-08-27  9:34     ` Edouard Evangelisti
2015-08-28  9:07       ` r.3
2015-08-27  8:12 ` Francois Berenger
2015-08-27 11:57   ` Drup
2015-08-27 14:17 ` Yaron Minsky
2015-08-27 16:00   ` Jesse Haber-Kucharsky
2015-08-28  0:33     ` Hongbo Zhang
2015-08-28  1:53       ` Daniel Bünzli
     [not found]       ` <20150828.140826.2157566405742612169.Christophe.Troestler@umons.ac.be>
2015-08-28 12:38         ` Thomas Braibant
2015-08-28 13:00           ` [Caml-list] opam license field (was Re: We need a rich standard library distributed with OCaml, really) Daniel Bünzli
2015-08-28 13:06             ` David Sheets
2015-08-28 14:01         ` [Caml-list] We need a rich standard library distributed with OCaml, really Oliver Bandel
2015-08-31 15:26           ` Hendrik Boom
2015-08-28 14:35         ` Alain Frisch
2015-08-29 19:02           ` David MENTRÉ
2015-08-31 12:37             ` Jon Harrop
2015-08-31 15:05               ` Emmanuel Surleau
2015-08-31 17:31                 ` Oliver Bandel
2015-08-28 15:02         ` Simon Cruanes
2015-08-28 15:27           ` Gabriel Scherer
2015-08-28 15:51         ` Oliver Bandel
2015-08-31 18:40       ` Ashish Agarwal
2016-03-27 20:54     ` Jon Harrop
2016-03-27 21:21       ` Simon Cruanes
2016-03-27 23:48       ` Yaron Minsky

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='CAN=ouMRvhoNXoQw3uOLBTY3f+daBigvDzyXWqhSWsiq8mjhcYQ@mail.gmail.com' \
    --to=anthony.tavener@gmail.com \
    --cc=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    /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).