companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.3.0 released: https://ocaml.org/releases/5.3.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Haudegen has quit [Quit: Bin weg.]
keyle has quit [Quit: door slammed.]
bcksl has quit [Ping timeout: 260 seconds]
end has quit [Ping timeout: 248 seconds]
Absalom has quit [Ping timeout: 276 seconds]
bcksl has joined #ocaml
end has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk_ has joined #ocaml
_whitelogger has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
Frostillicus has quit [Remote host closed the connection]
Frostillicus has joined #ocaml
toastal has joined #ocaml
_whitelogger has joined #ocaml
Frostillicus has quit [Ping timeout: 245 seconds]
humasect has joined #ocaml
Frostillicus has joined #ocaml
toastal has quit [Ping timeout: 260 seconds]
agentcasey_ has quit [Quit: ZNC 1.10.x-git-82-9ab81d1d - https://znc.in]
agentcasey has joined #ocaml
bcksl has quit [Ping timeout: 252 seconds]
end has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
bcksl has joined #ocaml
dhil has joined #ocaml
end has joined #ocaml
humasect has quit [Quit: Leaving...]
germ_ has quit [Read error: Connection reset by peer]
Frostillicus has quit [Read error: Connection reset by peer]
germ_ has joined #ocaml
Serpent7776 has joined #ocaml
myrkraverk_ has quit [Quit: Leaving]
myrkraverk has joined #ocaml
Absalom has joined #ocaml
olle has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
<olle> Is anyone using the effect system for _all_ side-effects? Or only for concurrency/parallelsim?
<olle> Maybe better to ask on the forum.
<discocaml> <contificate> I hope not, lol - effectively amounts to obfuscation to do this if there's no effect safety/typing
<discocaml> <contificate> theoretically, not all side effects can be done with one-shot continuations
<olle> hm what could not be done that way?
<discocaml> <contificate> well, people usually note that most monads of note are tail resumptive - so can be done with one-shot delimited control
<discocaml> <contificate> others though, which involve invoking `k` twice - maybe some non-determinism tricks, would require some extra engineering
<olle> k?
<discocaml> <contificate> the continuation of the handler
<olle> oh
<discocaml> <contificate> I don't really believe in an "effect" system without safety
<discocaml> <contificate> what we have is a lightweight delimited control facility
<olle> that can be nicely abused.
<discocaml> <contificate> "nicely"
<olle> ^^
bcksl has quit [Ping timeout: 248 seconds]
end has quit [Ping timeout: 260 seconds]
Absalom has quit [Ping timeout: 276 seconds]
Anarchos has joined #ocaml
Tuplanolla has joined #ocaml
Anarchos has quit [Ping timeout: 276 seconds]
bcksl has joined #ocaml
end has joined #ocaml
Anarchos has joined #ocaml
Frostillicus has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
pi3ce has quit [Ping timeout: 276 seconds]
Anarchos has quit [Ping timeout: 260 seconds]
olle has quit [Ping timeout: 248 seconds]
olle has joined #ocaml
<discocaml> <drupyog> Are stack fragments on the heap since 5.0 ? They don't seem to be included in Gc.stat.heap_size.
<discocaml> <drupyog> Are stack fragments on the heap since 5.0 ? They don't seem to be included in any of Gc.stat's mtrics.
<discocaml> <drupyog> Are stack fragments on the heap since 5.0 ? They don't seem to be included in any of Gc.stat's metrics.
<discocaml> <drupyog> and if not, is there *any* way to evaluate stack usage nowadays ?
<discocaml> <drupyog> originally I though Memprof would record stack usage, but I'm not even sure now
Frostillicus has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Frostillicus has quit [Read error: Connection reset by peer]
<discocaml> <shalokshalom> How do you think about effect systems vs The Elm Architecture?
<olle> I'm curious about that too
<olle> Don't know much about Elm
amadaluzia has quit [Quit: ZNC 1.10.0 - https://znc.in]
amadaluzia has joined #ocaml
Frostillicus has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
<discocaml> <drupyog> @octachron do you have any idea ? 😦
inline has quit [Quit: Leaving]
<discocaml> <drupyog> @octachron do you have any idea (or if I should ask somewhere) ? 😦
ygrek has joined #ocaml
<discocaml> <contificate> It's made even more fun by the fact that calling C functions from OCaml 5 will pivot the stack (back to the system stack) - so there's 2 stacks to worry about (one being a cactus stack).
<discocaml> <contificate> I vaguely recall some discussion before about his - concerning flame graph collection using `perf` - I can't remember the exact conclusion.
<discocaml> <contificate> I vaguely recall some discussion before about this - concerning flame graph collection using `perf` - I can't remember the exact conclusion.
Frostillicus has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
humasect has joined #ocaml
Frostillicus has joined #ocaml
<discocaml> <sim642> I remember reading that OCaml stacks are on the OCaml heap indeed. And that it effectively removes stack overflows
<discocaml> <contificate> Yeah, that is often said in the context of dissuading people from the fun parlour trick of doing CPS conversion (as people did in OCaml 4) to make any function tail recursive (accumulating continuation closures on the heap as the stack frames)
<discocaml> <sim642> But continuations make the notion more confusing too: performing an effect and handling it outside and then continuing back in the deep
<discocaml> <contificate> well, the frames are never copied - so that "continuing" back/relinking of frames is adjusting a pointer
<discocaml> <sim642> Indeed and that makes it harder to measure "the" size of "the" stack
<discocaml> <sim642> Because there's a bunch of fragments lying around
<discocaml> <sim642> But maybe that's irrelevant in @drupyog 's case
<discocaml> <contificate> I don't think it makes it much harder, given that not `discontinue`ing `k` does not amount to leaking the fiber itself
<discocaml> <contificate> in other words, there must be a way to track it all - the problem is whether random outside profiling tools expecting to basically work with `rsp` and DWARF info can cope (e.g. perf)
<discocaml> <sim642> I think I recall that those should work still
<discocaml> <contificate> lots of profiling tools are just sampling
<discocaml> <contificate> so this idea of collecting many fragments isn't the default perspective
<discocaml> <contificate> you could do such a profiler by vibecoding `perf_event_open` and sampling the register holding the domain table/caml state
<discocaml> <sim642> Section 5.5 describes the DWARF unwinding for fibers
<discocaml> <sim642> Section 5.5 in the effects paper describes the DWARF unwinding for fibers
<discocaml> <contificate> then it comes down to asking which profiling tools currently work out of the box
<discocaml> <octachron> My rough understanding is that OCaml is not using system stack, but its own stacks on the heap. Fibers (stack fragments) are then stored on the heap, with a separate cache for reusing them. But as far as I can see, stack usage is not instrumented (there is at most a GC debug event when allocating new stacks). And it seems that I might have been wrong in thinking that fibers were garbage collected.
Frostillicus has quit [Read error: Connection reset by peer]
<discocaml> <sim642> My impression was that they would be GC-d but discontinue is more for triggering them to release external resources
Frostillicus has joined #ocaml
<discocaml> <octachron> Seeing as my test that was just looping and raising an effect ended up OOM-killed in seconds; while adding a finalizer to a wrapper around the continuation works, this doesn't look like it is the case.
<discocaml> <contificate> There's a telling quote from the paper
<discocaml> <contificate> > It is also useful to note that even if the memory
<discocaml> <contificate> > for the fiber stack is managed by the GC, we would still need
<discocaml> <contificate> > a finalisation mechanism to unwind the stack and release
<discocaml> <contificate> > other system resources that may be held by the continuation.
<discocaml> <contificate> they show this `Gc.finalise` resumption thing in the paper, too
<discocaml> <octachron> @drupyog , going back to your question adding a statmemprof events for stacks allocation/reallocation/freeing looks reasonably easy to do.
Frostillicus has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Frostillicus has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
bibi_ has joined #ocaml
euphores has joined #ocaml
semarie has quit [Quit: quit]
semarie has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
semarie has quit [Quit: quit]
semarie has joined #ocaml
Haudegen has joined #ocaml
inline has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 240 seconds]
Frostillicus has quit [Ping timeout: 248 seconds]
Frostillicus has joined #ocaml
_jbrown_ has joined #ocaml
Tuplanolla has quit [Ping timeout: 240 seconds]
itszor has quit [Ping timeout: 240 seconds]
casastorta has quit [Ping timeout: 240 seconds]
Tuplanolla has joined #ocaml
casastorta has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
Serpent7776 has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ocaml
Frostillicus has joined #ocaml
zor has joined #ocaml
_jbrown_ has quit [Ping timeout: 248 seconds]
<discocaml> <drupyog> mmh, do you have pointers ?
<discocaml> <octachron> The stack allocation functions are in runtime/fiber.c
<discocaml> <drupyog> (also, stack overflow definitely still exists in 5.0 :p)
<discocaml> <drupyog> ok, I will attempt something
humasect has quit [Remote host closed the connection]
inline has quit [Quit: Leaving]
<olle> Hm why this cermony of open both Effect and Effect.Deep?
<olle> Ah nevermind
humasect has joined #ocaml
<discocaml> <deepspacejohn> I don’t think there’s much of a reason to open either, IMO
buoy49__ has quit [Ping timeout: 276 seconds]
buoy49__ has joined #ocaml
humasect has quit [Quit: Leaving...]
itszor has joined #ocaml
Frostillicus has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
zor has quit [Ping timeout: 276 seconds]
euphores has quit [Ping timeout: 240 seconds]
Frostillicus has quit [Read error: Connection reset by peer]
Frostillicus has joined #ocaml
Exagone313 has joined #ocaml
Exa has quit [Ping timeout: 276 seconds]
Exagone313 is now known as Exa
bartholin has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
Serpent7776 has quit [Ping timeout: 272 seconds]
<olle> It's from the manual
olle has left #ocaml [#ocaml]
amadaluzia has quit [Quit: ZNC 1.10.0 - https://znc.in]
humasect has joined #ocaml
YuGiOhJCJ has joined #ocaml
Frostillicus has quit [Ping timeout: 276 seconds]
humasect has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
humasect has joined #ocaml
ygrek has joined #ocaml