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/
alfiee has quit [Ping timeout: 260 seconds]
Tuplanolla has quit [Quit: Leaving.]
infinity0 has quit [Ping timeout: 252 seconds]
infinity0 has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
Haudegen has quit [Quit: Bin weg.]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 245 seconds]
szkl has quit [Quit: Connection closed for inactivity]
polykernel has quit [Remote host closed the connection]
polykernel has joined #ocaml
<discocaml> <kiranandcode> Hihi everyone!!!
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> This year, the [ICFP](https://icfp25.sigplan.org) (International conference on Functional Programming) Programming Languages conferences will be held in Singapore (colocated with [SPLASH](https://2025.splashcon.org) in fact!)!
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> Continuing this community's annual tradition from 2012, we will be hosting the OCaml workshop after the ICFP conference, on the **17th October 2025 (Friday)**. The workshop is intended to cover all different kinds of aspects of the OCaml programming language as well as the OCaml ecosystem and its community, such as scientific and/or research-oriented, engineering and/or user-oriented, as well as social and/or community-oriented.
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> ## Call for talk proposals
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> The [call for talk proposals](https://conf.researchr.org/home/icfp-splash-2025/ocaml-2025) for the workshop is now open!
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> ### Dates
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> Here are the important dates:
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> - Talk proposal submission deadline: **July 3rd (Thursday)**
<discocaml> <kiranandcode> - Author notification: **August 7th (Thursday)**
<discocaml> <kiranandcode> - Workshop: **October 17th (Friday)**
<discocaml> <kiranandcode> ### Submissions
<discocaml> <kiranandcode> Submissions are typically around 2 pages long (flexible), describing the motivations of the work and what the presentation would be about.
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> We encourage everyone who might be interested in giving a talk to submit a proposal! We truly mean everyone, and also have strongly anyone in mind who belongs to a group that’s traditionally underrepresented at OCaml workshops, e.g. due to your gender(s) or non-gender, where you’re from or based or whatever other kinds of characteristics you might have. You should all be able to find all information you’ll need to submit a proposal
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> ### Quota on accepted talks per affiliation
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> Following the approach from last year which worked well, this year again we will try to enforce a quota of a maximum of four talks given by speakers with the same company/university/institute affiliation. In order to guarantee a coverage of a diverse range of topics and perspectives, we’ll experiment with the same affiliation quota again.
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> Do not hesitate to submit your talk proposal in any case: quotas, if needed, will be taken into account by the PC after reviewing all submissions, so there’s no reason to self-select upfront.
<discocaml> <kiranandcode> ### Hybrid attendance and cost for speakers
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> We’re aiming to make the workshop hybrid with the same streaming modalities as last year, meaning that **talks as well as participation can be either in-person or remote**, and **remote attendance will be free**. To promote a good atmosphere, communication and engagement, we prefer to have most talks in-person, but remote talks will be most welcome as well.
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> There may be opportunities for speakers who would not have funding otherwise (via their employer or university) to attend, although we are still in the process of confirming this. (Please keep an eye on this post, which will be updated once we get confirmation!)
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> We will do our best to provide the best workshop experience possible for remote participants, within the constraints of the hybrid format. While attending in-person does come with advantages, it also comes with an environmental cost, and we strongly support transitioning to a less plane-intensive organization for conferences and community events 🌳 .
<discocaml> <kiranandcode> ### Related events
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> The day before the OCaml workshop, i.e. Oct 16th (Thursday), is the day of the [ML workshop](https://conf.researchr.org/home/icfp-splash-2025/mlsymposium-2025), with focus on more theoretical aspects of OCaml and the whole family of ML languages in general. The ML workshop and tends to be very interesting for OCaml lovers as well.
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> That aside, this year, I believe, is the first year that both the ICFP and SPLASH programming languages conferences are going to be co-located, so this is an exciting opportunity to experience the whole breadth of two of the top-ranked PL conferences over the span of a week! What a time to be alive!
<discocaml> <kiranandcode>
<discocaml> <kiranandcode> We’re looking forward to the the talk submissions and to the workshop!
<discocaml> <kiranandcode> Let us know if you have any questions.
<discocaml> <kiranandcode> @kiranandcode & @yasunariw
alfiee has joined #ocaml
<discocaml> <kiranandcode> (Oh, would it be possible for a mod to pin this @admin ?)
<discocaml> <yawaramin> what's the venue, NUS?
alfiee has quit [Ping timeout: 245 seconds]
<discocaml> <yawaramin> oh i see it's Marina Bay Sands and NUS
euphores has quit [Ping timeout: 260 seconds]
euphores has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
deadmarshal_ has quit [Ping timeout: 246 seconds]
<dh`> realistically, remote conferences suck. but singapore's also a long way to fly from a lot of places
<qu1j0t3> pretty sure that's true of every point on the globe
alfiee has joined #ocaml
myrkraverk_ has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
myrkraverk has quit [Ping timeout: 265 seconds]
cross has quit [Quit: Lost terminal]
deadmarshal_ has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 265 seconds]
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 245 seconds]
Exagone313 has joined #ocaml
Exa has quit [Ping timeout: 244 seconds]
Exagone313 is now known as Exa
nirvdrum741 has quit [Quit: Ping timeout (120 seconds)]
nirvdrum741 has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 245 seconds]
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 245 seconds]
bartholin has quit [Quit: Leaving]
Haudegen has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
humasect has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
dhil has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
Haudegen has quit [Quit: Bin weg.]
humasect has quit [Quit: Leaving...]
<discocaml> <_4ad> you're right, I think this is much much better: http://okturing.com/src/24178/body
myrkraverk_ has joined #ocaml
<discocaml> <_4ad> Note that `bool option` represents something with a Top, while `value option` is something with a Bottom, but that's ok..
myrkraverk has quit [Ping timeout: 272 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
casastorta has quit [Quit: ZNC 1.9.1 - https://znc.in]
Haudegen has joined #ocaml
casastorta has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
<discocaml> <romain.beauxis> I made some progress on this, asked the client to switch the allocation strategy and got a stacktrace pointing to a direct fault line:
<discocaml> <romain.beauxis> ```
<discocaml> <romain.beauxis> if (packet->flags & AV_PKT_FLAG_KEY && _on_keyframe != Val_none) {
<discocaml> <romain.beauxis> caml_acquire_runtime_system();
<discocaml> <romain.beauxis> caml_callback(Field(_on_keyframe, 0), Val_unit);
<discocaml> <romain.beauxis> caml_release_runtime_system();
<discocaml> <romain.beauxis> }
<discocaml> <romain.beauxis> ```
<discocaml> <romain.beauxis> Here's the full call stack:
<discocaml> <romain.beauxis> ```
<discocaml> <romain.beauxis> CAMLprim value ocaml_av_write_stream_frame(value _on_keyframe, value _stream,
<discocaml> <romain.beauxis> value _frame) {
<discocaml> <romain.beauxis> CAMLparam3(_on_keyframe, _stream, _frame);
<discocaml> <romain.beauxis> CAMLlocal1(_av);
<discocaml> <romain.beauxis> ...
<discocaml> <romain.beauxis> write_audio_frame(av, index, _on_keyframe, Frame_val(_frame));
<discocaml> <romain.beauxis> ...
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> CAMLreturn(Val_unit);
<discocaml> <romain.beauxis> }
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> static void write_audio_frame(av_t *av, int stream_index, value _on_keyframe,
<discocaml> <romain.beauxis> AVFrame *frame) {
<discocaml> <romain.beauxis> ...
<discocaml> <romain.beauxis> write_frame(av, stream_index, enc_ctx, _on_keyframe, frame);
<discocaml> <romain.beauxis> }
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> tatic void write_frame(av_t *av, int stream_index, AVCodecContext *enc_ctx,
<discocaml> <romain.beauxis> value _on_keyframe, AVFrame *frame) {
<discocaml> <romain.beauxis> ...
<discocaml> <romain.beauxis> caml_release_runtime_system();
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> ... long while loop
<discocaml> <romain.beauxis> if (packet->flags & AV_PKT_FLAG_KEY && _on_keyframe != Val_none) {
<discocaml> <romain.beauxis> caml_acquire_runtime_system();
<discocaml> <romain.beauxis> caml_callback(Field(_on_keyframe, 0), Val_unit);
<discocaml> <romain.beauxis> caml_release_runtime_system();
<discocaml> <romain.beauxis> }
<discocaml> <romain.beauxis> ```
<discocaml> <romain.beauxis> Am I doing anything wrong here?
<discocaml> <reynir1396> Ay, please don't paste long snippets in this channel - use a pastebin. It's linked to IRC and this will spam a lot of lines
<discocaml> <romain.beauxis> ok
<qu1j0t3> reynir fights for the Users
<discocaml> <romain.beauxis> I think that I need to wrap all intermediary calls with `CAMLparams1`/`CAMLreturn`
<discocaml> <octachron> Not for functions only called from the `C` side.
<discocaml> <contificate> Can `_on_keyframe` be relocated while the lock is not held in the loop?
<discocaml> <contificate> I'm suspicious of values that appear to appear to make their way to a call, not from OCaml, but from C and aren't registered as global roots (seemingly)
<discocaml> <octachron> Worse it can be garbage collected.
<discocaml> <romain.beauxis> The first caller registers `on_key_frame` with the GC: `CAMLparam3(_on_keyframe, _stream, _frame);`
<discocaml> <romain.beauxis> I always wanted to asked the true difference between `CAMLparam*` and a global root 🙂
<discocaml> <romain.beauxis> *ask
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
Anarchos has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 245 seconds]
<discocaml> <yawaramin> @octachron i'm curious about something–was there a conscious decision to use merge commits in the OCaml git repo? was squash merge specifically considered and rejected?
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
euphores has quit [Quit: Leaving.]
LainExperiments has joined #ocaml
<discocaml> <romain.beauxis> @octachron could it be that the check for `_on_keyframe != Val_none` is being done while the master lock is released could be the problem?
<discocaml> <romain.beauxis> I should specify that this is with OCaml 4.14
euphores has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
<discocaml> <octachron> @yawaramin , squash is not an option when individual commits are valuable. Did you mean rebase?
<dh`> merge-squash is a plague
LainExperiments has quit [Ping timeout: 240 seconds]
<discocaml> <octachron> @romain.beauxis , I will have a look later, I am in fact not sure what are the rules when the runtime/domain lock is released.
<discocaml> <romain.beauxis> Thanks! I have pushed a test build with the client adding `CAMLparams1` to each intermediate function we'll see if we can repro or not.
euphores has quit [Quit: Leaving.]
<discocaml> <yawaramin> sure, either way. wondering why merge commits specifically are used
euphores has joined #ocaml
<discocaml> <yawaramin> i can argue about squashing but only in #offtopic🎲 🙂
<dh`> I'll take you up on that :-p
<discocaml> <yawaramin> see you there 🙂
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
Anarchos has quit [Quit: Client closed]
dhil has quit [Quit: Leaving]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
<rustyne> romain.beauxis: the manual (for 5.3 but still) says: After caml_release_runtime_system() was called and until caml_acquire_runtime_system() is called, the C code must not access any OCaml data, nor call any function of the run-time system, nor call back into OCaml code.
<rustyne> So the condition is problematic indeed.
<rustyne> (But I don’t see how it could trigger a crash, though)
<discocaml> <dubious245> Any recommendations for an ocaml gui/graphics library that will work on Arch linux/Manjaro?
<discocaml> <dubious245> I just need to be able to display a raster image stored as a big array with some sliders and a button.
<discocaml> <JM> [Bogue](https://github.com/sanette/bogue)?
<discocaml> <JM> It should work everywhere SDL2 is available
<discocaml> <dubious245> Thank you, I will look into it.
<discocaml> <romain.beauxis> rustyne: yeah I don't think that the condition can be wrong either. If the value is `Val_none`, it's in fact an int (`Val_int(0)`) and will never be changed by the GC. If it's not, even after being changed it's never supposed to be an int.
<discocaml> <romain.beauxis> A crash would very well be trigered by the `_on_key_frame` value changing from under the C calling code. My understanding is that this is what `CAMLparams*` prevents. I always assumed you need to call it once when the value enters the C stack and clear when it exists (via `CAMLreturn`) and then it can be passed down to subsequent C functions but perhaps I was wrong?
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
leah2 has quit [Ping timeout: 244 seconds]
bartholin has joined #ocaml
leah2 has joined #ocaml
alfiee has joined #ocaml
<discocaml> <dubious245> Oh the joys of accidentally formatting my entire computer. :mbDerp:
<discocaml> <yawaramin> a dubious joy
<discocaml> <dubious245> I see what you did there.
alfiee has quit [Ping timeout: 248 seconds]
infinity0 has quit [Ping timeout: 245 seconds]
<discocaml> <dubious245> Ocaml is reinstalled, now back to what I was doing.
infinity0 has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 245 seconds]
dhil has joined #ocaml
polykernel has quit [Ping timeout: 265 seconds]
polykernel has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
Serpent7776 has quit [Ping timeout: 248 seconds]
<discocaml> <mbacarella> anyone know a good connection pool library off the top of their head? trying to pool database handles for a web app
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
<companion_cube> Caqti comes with one I think
bartholin has quit [Quit: Leaving]
Anarchos has joined #ocaml
<discocaml> <mbacarella> I guess a naive one using an array isn't too hard
alfiee has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
alfiee has quit [Ping timeout: 265 seconds]
Tuplanolla has joined #ocaml