<discocaml>
<Alistair> Is there a way to unbox an existential type if you know its parameters will only be instantiated to non-float values?
<discocaml>
<NULL> What do you mean exactly ?
<discocaml>
<Alistair> E.g. for the GADT tag ```
<discocaml>
<Alistair> type 'a tag =
<discocaml>
<Alistair> | Tag1 : t1 tag
<discocaml>
<Alistair> | ...
<discocaml>
<Alistair> | Tagn : tn tag
<discocaml>
<Alistair> ```
<discocaml>
<Alistair> This (at runtime) is simply represented as an integer.
<discocaml>
<Alistair> However, suppose I was an existential type for this tag:
<discocaml>
<Alistair> ```
<discocaml>
<Alistair> type ex_tag =
<discocaml>
<Alistair> | Ex_tag : 'a tag -> ex_tag
<discocaml>
<Alistair> ```
<discocaml>
<Alistair> The only way to achieve this is with boxing since OCaml cannot infer whether some instantiation of `'a tag` will be an int / pointer / float -- but statically (regardless of what `'a` is instantiated with) we know `tag` will be represented as an int
olle has left #ocaml [#ocaml]
fcambus has left #ocaml [#ocaml]
SquidDev has quit [Quit: Bye!]
SquidDev has joined #ocaml
<discocaml>
<wokalski> What are the recommended tools to use for profiling in OCaml 5? Memtrace doesn’t work ((Failure "Gc.memprof.start: not implemented in multicore")), spacetime is long gone and we have this pretty unhelpful stack trace to look at. Before we start dissecting our codebase to empirically find what the issue is, could you suggest any tooling to find where the issue lies? I am sure that excessive allocations are the issue but I have 4 different ar
azimut has joined #ocaml
Tuplanolla has joined #ocaml
xd1le has quit [Quit: xd1le]
trillion_exabyte has quit [Ping timeout: 264 seconds]
<hannes>
wokalski: I'd try landmarks (ppx from lexifi) and instrument first the top-level module, and then going down the callchain.
<discocaml>
<wokalski> With landmarks I struggled to set it up properly for libraries (I have a setup where I have bin/main.ml and the rest in lib to be able to have inline tests). When I added landmark.ppx to the underlying libs I got a runtime exception from landmark. `failure when closing expecting "ROOT"` in the library code
<discocaml>
<wokalski> but you'r eright that the easiest option (althoguh not easy per se) besides the linux perf is manually instrumenting the code with landmark.
<hannes>
sorry to hear your struggle with landmarks, for me it worked nicely (but I have not used OCaml 5 yet)
<discocaml>
<arbipher> I wonder how can I create an issue (or maybe a PR) for projects hold in gitlab.inria.fr. The registration seems not open to public (or the ocaml community)..
Everything has joined #ocaml
John_Ivan has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
John_Ivan_ has quit [Ping timeout: 268 seconds]
mbuf has quit [Ping timeout: 240 seconds]
czy has quit [Ping timeout: 240 seconds]
Serpent7776 has quit [Quit: WeeChat 1.9.1]
<reynir>
perhaps you can contact the author by email
alexherbo2 has joined #ocaml
waleee has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
<discocaml>
<leviroth> @TheBloodlessMan I think you should be able to use the `[@@unboxed]` annotation there, does it not work?
rf has joined #ocaml
<discocaml>
<leviroth> Indeed I don’t think it should matter that the contents of the existential type there must be immediate; all that matters is that there’s only one constructor, so you don’t need an extra box to represent this type. It should also work if you had `type t = T : _ option -> t [@@unboxed]`
<discocaml>
<octachron> @arbipher , I fear the only option is to send an email (possibly on the project mailing list). The Inria gitlab instance is mostly unusable.
<discocaml>
<octachron> (at least for open source projects)
alexherbo2 has quit [Remote host closed the connection]
rf has quit [Remote host closed the connection]
rf has joined #ocaml
wingsorc__ has joined #ocaml
rf has quit [Remote host closed the connection]
trillion_exabyte has quit [Ping timeout: 250 seconds]