Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Yotam Barnoy <yotambarnoy@gmail.com>
To: Ocaml Mailing List <caml-list@inria.fr>
Subject: [Caml-list] Fwd: Proposal: re-design of ocaml headers
Date: Fri, 27 Sep 2013 11:25:08 -0400	[thread overview]
Message-ID: <CAN6ygO=LeHdg0rWexQfkBhFdNo76=+s=5rrb8iG-ypUvPGp08Q@mail.gmail.com> (raw)
In-Reply-To: <CAN6ygOmuCX6HLfSns0tXQCF3LWMANqhpnSN0vGWcNg0one2QzQ@mail.gmail.com>

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

>
>   Can you please share your experience of writing bindings to some C
> libraries for <your preferable language>?  How it compares to  writing
> bindings for OCaml?  (this is a thread about runtime values
> representation, I suppose.)
>
>
This isn't really relevant to this topic, since this discussion is just
about ocaml headers, rather than the ocaml C FFI. The FFI would remain
largely the same.



>   Why will anyone ever need more than 200 constructors of a sum type?
> (also note the presence of polymorphic variant types.)
>

I thought so too, but as mentioned in the previous discussion thread
(entitled 'Expanding the Float Array Tag'), code generators can easily run
out of 200 constructors. However, it's possible that 65,000 constructors is
really excessive, in which case some bits can be shifted around. I'd be
happy to get some feedback on this.


> > random access to this data is never needed
>
>   mkay...  :[
>

This is only talking about automatic ocaml functions, which work without
any type information. Proper ocaml code is typed, so it doesn't need this
information. But internal mechanisms such as the GC, marshal module, and
polymorphic comparison are 'dumb' in the sense that they're missing all of
the crucial type information. For these functions, there needs to be some
basic type information within the data structure itself. Currently, floats
are stored in their own independent data structure with a 'double_tag'
header, or otherwise they're in a 'double_array'. Having some information
in the header about internal floats and pointers is much more efficient,
but it doesn't need to have random access -- the internal ocaml functions
that use this information process the entire data structure at once.

Yotam

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

  parent reply	other threads:[~2013-09-27 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 14:05 [Caml-list] " Yotam Barnoy
2013-09-27 15:08 ` Dmitry Grebeniuk
     [not found]   ` <CAN6ygOmuCX6HLfSns0tXQCF3LWMANqhpnSN0vGWcNg0one2QzQ@mail.gmail.com>
2013-09-27 15:25     ` Yotam Barnoy [this message]
2013-09-27 16:20       ` [Caml-list] Fwd: " Dmitry Grebeniuk
2013-09-27 18:08         ` Yotam Barnoy
2013-09-27 18:12           ` Yotam Barnoy
2013-09-27 18:15           ` Paolo Donadeo
2013-09-27 18:41             ` Yotam Barnoy
2013-09-27 15:31   ` [Caml-list] " Anthony Tavener
2013-09-27 15:37     ` Yotam Barnoy
2013-09-27 16:50     ` Dmitry Grebeniuk
2013-09-30 14:48 ` Goswin von Brederlow
2013-09-30 15:31   ` Yotam Barnoy
2013-10-08 10:52     ` Goswin von Brederlow
2013-10-11 15:48       ` Yotam Barnoy
2014-01-30 20:53         ` Yotam Barnoy
2014-02-01 15:27         ` Goswin von Brederlow
2013-10-06 10:39 ` Florian Weimer

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='CAN6ygO=LeHdg0rWexQfkBhFdNo76=+s=5rrb8iG-ypUvPGp08Q@mail.gmail.com' \
    --to=yotambarnoy@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