[Caml-list] Attn: Development Editor, Latest OCaml Weekly News

Alan Schmitt
2021-12-28T09:00:01Z

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

Hello

Here is the latest OCaml Weekly News, for the week of December 21 to 28,
2021.

Happy Winter Solstice!

Table of Contents
─────────────────

New release of Feat
Debugger support for OCaml
Old CWN

New release of Feat
═══════════════════

Archive:
<https://sympa.inria.fr/sympa/arc/caml-list/2021-12/msg00010.html>

François Pottier announced
──────────────────────────

I am happy to announce a new release of Feat, a library that offers
support for counting, enumerating, and sampling objects of a certain
kind, such as (say) the inhabitants of an algebraic data type.

This new release integrates a contribution by Jonah Beckford. The
library is now split in three packages: `feat-core' is parameterized
over an implementation of big integers; `feat' instantiates
`feat-core' with big integers provided by `zarith'; `feat-num'
instantiates it with big integers provided by `num'.

┌────
│ opam update
│ opam install feat
│ # or: opam install feat-num
└────

More details can be found here:

<https://gitlab.inria.fr/fpottier/feat/>

Debugger support for OCaml
══════════════════════════

Archive:
<https://discuss.ocaml.org/t/debugger-support-for-ocaml/9057/1>

Christian Lindig asked
──────────────────────

What is the current state of debugger support for OCaml? I am aware of
ocamldebug but every time I'm trying to use it I feel thrown back to
2000 where it essentially existed in the same form (and still has no
command line editing built in). Despite the powerful concept of time
traveling, it does not seem very useful today. For example, it can't
be attached to a running program and it does not work with native
code. What is the state of GDB support? What debugger would one use on
macOS?

linoscope replied
─────────────────

Have you taken a look at ocamlearlybird ([github], [announcement])? I
have never used it myself, but based on [the demo] it seems pretty
nice.

[github] <https://github.com/hackwaly/ocamlearlybird>

[announcement]
<https://discuss.ocaml.org/t/ann-ocamlearlybird-1-0-0-beta1/7180>

[the demo] <https://imgur.com/U3GDHXM>

Sid Kshatriya also replied
──────────────────────────

I agree that debugging in OCaml seems to be stuck in time.

This is extremely unfortunate because it is able to do time traveling
(as you mention) which is something that many other languages still
cannot boast.

• `ocamldebug' does not work properly when there is more than 1 OS
thread
• As types are erased during compile time in OCaml, it can be
difficult to debug polymorphic functions. Rust and C/C++
monomorphise all code so there is never any confusion about the type
of anything in the debugger. Golang and Java have type information
available during runtime so again, debugging is easy. In this
respect OCaml is similar to Haskell while using the byte-code
debugger.
• The future of ocamldebug is unknown on multicore

As far as GDB support is concerned, there was a project to improve GDB
support (so you could print out variables like in ocamldebug IIUC) but
it never got merged into trunk.

However, if you are interested in low level debugging in gdb, here is
a [recent] answer related to this.

My guess is that `ocamldebug' will continue to work for the single
domain, single thread case in OCaml 5.00 but ocamldebug is currently
broken in multicore there (AFAIK).

[recent]
<https://discuss.ocaml.org/t/multicore-ocaml-september-2021-effect-handlers-will-be-in-ocaml-5-0/8554/9>

Old CWN
═══════

If you happen to miss a CWN, you can [send me a message] and I'll mail
it to you, or go take a look at [the archive] or the [RSS feed of the
archives].

If you also wish to receive it every week by mail, you may subscribe
[online].

[Alan Schmitt]

[send me a message] <mailto:alan.schmitt@polytechnique.org>

[the archive] <https://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>

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