companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
myrkraverk_ has joined #ocaml
philipwhite_ has joined #ocaml
hazelmeow_ has joined #ocaml
ymherklotz_ has joined #ocaml
richardhuxton_ has joined #ocaml
sleepydog_ has joined #ocaml
cedb- has joined #ocaml
agentcasey_ has joined #ocaml
germ_ has joined #ocaml
richardhuxton has quit [Ping timeout: 276 seconds]
sleepydog has quit [Ping timeout: 276 seconds]
philipwhite has quit [Ping timeout: 276 seconds]
richardhuxton_ is now known as richardhuxton
sleepydog_ is now known as sleepydog
agentcasey has quit [Read error: Connection reset by peer]
germ- has quit [Read error: Connection reset by peer]
ymherklotz has quit [Ping timeout: 276 seconds]
hazelmeow has quit [Ping timeout: 276 seconds]
ymherklotz_ is now known as ymherklotz
hazelmeow_ is now known as hazelmeow
cedb_ has quit [Ping timeout: 276 seconds]
myrkraverk has quit [Ping timeout: 276 seconds]
bartholin has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
jutty has quit [Quit: jutty]
jutty has joined #ocaml
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 252 seconds]
<discocaml> <dubious245> Is there a reason for all the system F, Algorithm W, Algorithm J naming scheme?
<discocaml> <mm3315> > According to Girard, the "F" in System F was picked by chance.
<discocaml> <mm3315> [source](https://en.wikipedia.org/wiki/System_F)
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 276 seconds]
Serpent7776 has joined #ocaml
myrkraverk__ has joined #ocaml
myrkraverk_ has quit [Ping timeout: 248 seconds]
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
myrkraverk has joined #ocaml
nlocalhost has quit [Ping timeout: 244 seconds]
myrkraverk__ has quit [Ping timeout: 276 seconds]
nlocalhost has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 276 seconds]
Haudegen has joined #ocaml
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 276 seconds]
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 265 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 260 seconds]
bartholin has quit [Quit: Leaving]
olle has joined #ocaml
<discocaml> <lukstafi> In `f x = g x in f a` can `a` be garbage collected before `g` returns? Imagining `a` is passed through a register that is then reused, so becomes unreachable before `g` returns.
<rustyne> lukstafi: I’d think so too
<discocaml> <otini_> I’m not sure to understand the code
<discocaml> <otini_> do you mean `let f x = g x in f a`?
<discocaml> <otini_> values that are referred to by local variables of a function are not collected before the function returns
<discocaml> <otini_> if the GC runs during the execution of `g`, one of the first things it will do will be marking the local roots as live—including the argument of `g`, `x`, which is the same as `a`
zor has joined #ocaml
<discocaml> <otini_> the way registers or stack slots are allocated is handled transparently
<discocaml> <otini_> the compiler has generated information about f’s argument list and stack frame size in a table that the GC uses
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 276 seconds]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
<discocaml> <lukstafi> So `Sys.opaque_identity` might be needed for local bindings, but never for function parameters?
<discocaml> <lukstafi> i.e. is `let f x = g x; ignore (Sys.opaque_identity x) in f a` meaningless -- equivalent to the original?
pi3ce has quit [Ping timeout: 252 seconds]
pi3ce has joined #ocaml
olle has left #ocaml [#ocaml]
<discocaml> <otini_> I don’t think there’s any impact of `Sys.opaque_identity` on garbage collection 🤔
<discocaml> <otini_> You are guaranteed that a value is not collected while it is used
<discocaml> <octachron> There are some impact of `Sys.opaque_identity` on liveness because it can disallow optimisations that would remove unused variables.
Haudegen has quit [Quit: Bin weg.]
<discocaml> <octachron> But I mostly see this matters with FFI (when using finalizers to keep alive OCaml-side values owned by a C-side value)
Haudegen has joined #ocaml
tremon has joined #ocaml
<discocaml> <deepspacejohn> If I have a "fooable" module type, e.g. `module type fooable = sig type t val foo : t -> foo end`, and I want to have versions of it for type constructors with different arities. Is there any better pattern than just defining a type for every arity like `module type fooable1 = sig type 'a t val 'a foo : ('a -> foo) -> 'a t -> foo end`, `module type fooable2 = sig type ('a, 'b) t ....` etc?
zor has quit [Ping timeout: 265 seconds]
dhil has joined #ocaml
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
<discocaml> <lukstafi> `g` is a FFI call. I think in one case I'm concerned with the call should not release the OCaml lock. But also asking for the case where the `g` call releases the OCaml lock.
<discocaml> <otini_> I don’t think so
<discocaml> <otini_> but you may want to read https://www.cl.cam.ac.uk/~jdy22/papers/lightweight-higher-kinded-polymorphism.pdf for inspiration
<discocaml> <deepspacejohn> @otini_ thanks, that's what I figured. I don't want to do anything too clever but just wanted to make sure I wasn't missing something obvious.
<discocaml> <otini_> If an FFI call doesn’t explicitly release the domain lock, the GC won’t move or collect anything under its feet. If it releases the domain lock, then yes, it should abstain from accessing any OCaml data
<discocaml> <otini_> (until the lock is re-acquired)
<discocaml> <lukstafi> Right, because the data can be moved. But I think I only rely on the OCaml data not getting released. The OCaml callback from the C side re-acquires the lock.
<discocaml> <otini_> if the C function declares its parameters and locals properly, they should not be released.
<discocaml> <lukstafi> It's all handled by Ctypes.Foreign, so I'd assume so.
<discocaml> <otini_> I’d assume so too
Serpent7776 has quit [Ping timeout: 260 seconds]
zor has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
itszor has joined #ocaml
zor has quit [Ping timeout: 265 seconds]
<discocaml> <gabyfle> Hey 🙂 By any chances, does anyone knows if it's possible to force the github action setup ocaml not to use cygwin but rather msys2 ?
dhil has joined #ocaml
<discocaml> <gabyfle> My bad looks like it's an open issue there <https://github.com/ocaml/setup-ocaml/issues/846#issue-2455132430>
Haudegen has quit [Quit: Bin weg.]
dhil has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
dhil has joined #ocaml
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
dhil has quit [Ping timeout: 272 seconds]
Tuplanolla has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 272 seconds]
wbooze has quit [Read error: Connection reset by peer]
wbooze has joined #ocaml
gentauro has quit [Quit: leaving]
deadmarshal_ has quit [Quit: IRCNow and Forever!]
deadmarshal_ has joined #ocaml
Ekho has quit [Quit: CORE ERROR, SYSTEM HALTED.]
Ekho has joined #ocaml
cedb has quit [Quit: WeeChat 4.6.1]
cedb has joined #ocaml
LainIwakura has joined #ocaml
LainIwakura has quit [Ping timeout: 240 seconds]
octachron has quit [Quit: ZNC 1.9.1 - https://znc.in]
octachron has joined #ocaml
LainIwakura has joined #ocaml
wickedshell has quit [Ping timeout: 276 seconds]
LainIwakura41 has joined #ocaml
LainIwakura has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
patrick_ is now known as patrick
patrick has quit [Changing host]
patrick_ has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
wickedshell has joined #ocaml