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/
Mister_Magister has quit [Quit: bye]
Mister_Magister has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
theze_ has joined #ocaml
Humean has quit [Ping timeout: 252 seconds]
tremon has quit [Quit: getting boxed in]
oriba has quit [Ping timeout: 265 seconds]
Phandal has joined #ocaml
igemnace has quit [Quit: ZNC 1.9.0+deb2build3 - https://znc.in]
wbooze has quit [Quit: Leaving]
igemnace has joined #ocaml
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 244 seconds]
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 252 seconds]
Phandal has quit [Remote host closed the connection]
m5zs7k has quit [Ping timeout: 245 seconds]
m5zs7k has joined #ocaml
aljazmc has joined #ocaml
wbooze has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
Serpent7776 has joined #ocaml
theze_ has quit [Ping timeout: 244 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
keyboard has joined #ocaml
salkin has joined #ocaml
bartholin has quit [Quit: Leaving]
Haudegen has joined #ocaml
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #ocaml
<discocaml> <poselsky> You'll need to call ocamlmklib yourself to create library. It creates archive and shared library for you. After that you can link it with foreign-library dune stanza.
<discocaml> <lukstafi> Premature optimization question: is it cheaper to match an option, or call a no-op function?
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
<discocaml> <polytypic> As always, it depends.
<discocaml> <poselsky> Personally I would match option and not complicate my life. :clueless:
dhil has joined #ocaml
aljazmc has quit [Quit: Leaving]
<companion_cube> If the no op function is not known at compilation time I'd rather match an option I think
<companion_cube> More or less what I do in Trace
nlocalhost has quit [Remote host closed the connection]
nlocalhost has joined #ocaml
tremon has joined #ocaml
nlocalhost has quit [Remote host closed the connection]
nlocalhost has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
chrisz has quit [Ping timeout: 252 seconds]
chrisz has joined #ocaml
patrick_ is now known as patrick
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
remexre has quit [Remote host closed the connection]
Haudegen has joined #ocaml
remexre has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<discocaml> <romain.beauxis> Hi all! I'm still trying to chase this error. Took a pass at the allocation/cleanup code, got more stack trace etc. Still looks like a corruption of the OCaml memory stack. I'm still looking at things to see if anything sticks out.
<discocaml> <romain.beauxis> Does this seem legit, in particular the presence of `caml_start_program` after the callback is executed:
<discocaml> <romain.beauxis> ```
<discocaml> <romain.beauxis> #14 0x0000561c35dcf7f0 in camlSrt_io__read_6298 () at src/core/io/srt_io.ml:875
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> --> This call below is legit?
<discocaml> <romain.beauxis> #15 0x0000561c36659709 in caml_start_program ()
<discocaml> <romain.beauxis> #16 0x0000561c366501e4 in caml_callback3_exn (closure=<optimized out>, arg1=<optimized out>, arg2=arg2@entry=1, arg3=arg3@entry=2049) at callback.c:124
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> --> run time is acquired again here!
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> ...
<discocaml> <romain.beauxis> #23 0x00007f450c496df5 in av_read_frame () from /lib/x86_64-linux-gnu/libavformat.so.60
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> --> run time is released here!
<discocaml> <romain.beauxis>
<discocaml> <romain.beauxis> #24 0x0000561c365f9890 in read_packet (packet=0x7f44a4095380, av=0x7f44a4042080) at av_stubs.c:1024
<discocaml> <romain.beauxis> #25 ocaml_av_read_input (_packet=<optimized out>, _frame=<optimized out>, _av=<optimized out>) at av_stubs.c:1066
<discocaml> <romain.beauxis> #26 0x0000561c3602feea in camlAv__read_input_inner_694 () at av/av.ml:245
<discocaml> <romain.beauxis> (... ocaml code ..)
<discocaml> <romain.beauxis> #45 0x0000561c36659709 in caml_start_program ()
<discocaml> <romain.beauxis> #46 0x0000561c3665017d in caml_callback_exn (closure=closure@entry=139933679209576, arg=<optimized out>, arg@entry=1) at callback.c:111
<discocaml> <romain.beauxis> #47 0x0000561c36626410 in caml_thread_start (arg=0x561c589a8730) at st_stubs.c:546
<discocaml> <romain.beauxis> #48 0x00007f4509ea81f5 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
<discocaml> <romain.beauxis> #49 0x00007f4509f2889c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
<discocaml> <romain.beauxis> ```
chrisz has quit [Ping timeout: 245 seconds]
chrisz has joined #ocaml
bartholin has joined #ocaml
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #ocaml
Haudegen has joined #ocaml
theze_ has joined #ocaml
<discocaml> <dubious245> Is the grammar for Ocaml listed anyway? Like a backus-naur style grammar.
<discocaml> <contificate> I'm sure some fragments were documented at the top of relevant sections in documentation once upon a time
<discocaml> <contificate> the Caml Light grammar is fairly well documented
Tuplanolla has joined #ocaml
<discocaml> <dubious245> Oh it is well documented, thank you.
<discocaml> <._null._> OCaml's grammar is documented in [here](https://ocaml.org/manual/5.3/language.html)
<discocaml> <._null._> OCaml's grammar is documented in [here](https://ocaml.org/manual/5.3/language.html), in each section
<discocaml> <contificate> must be noted that it's a fair amount of effort to parse FP languages, would recommend Pratt parsing
<discocaml> <contificate> application via juxtaposition is just what left denotation are begging to do under top-down operator precedence parsing
<discocaml> <dubious245> My little recursive decent parser can handle function application as of... two hours ago.
<discocaml> <dubious245> Just f x though, testing things trying to find how I want everything to click together. Currently looking at parsing combinators because I feel the code is about to start ballooning in size.
<discocaml> <contificate> I prefer cowboy coding parsers but combinators have nice benefits w.r.t stream parsing (angstrom buffered mode)
<discocaml> <dubious245> I like programming in ocaml its very easy to hack stuff together and then steadily refine it with refactoring. Rust would have a heart attack with all the refactoring I do.
<discocaml> <haasham_14654> Hey everyone! 👋 I'm new here and excited to join the community.
<discocaml> <haasham_14654>
<discocaml> <haasham_14654> I'm currently working on issue #11596, which is about making depexts in Dune lockfiles work better across different systems. Right now, the lockfile only saves the system dependencies for the OS it was created on. I’m updating it to include all possible depexts from the opam file, so users get the right install hints no matter what OS they’re on.
<discocaml> <haasham_14654>
<discocaml> <haasham_14654> Happy to be here and open to any suggestions or feedback!
<discocaml> <dubious245> Welcome! That seems like a cool thing to work on.
<discocaml> <dubious245> cowboy coding parsers?
<discocaml> <contificate> yeah I just do it without combinators
<discocaml> <contificate> hack it together
<discocaml> <contificate> I used to be really into LR parser generation and related algorithms
<discocaml> <contificate> but then I learned Pratt parsing and now I just keep it all pretty simple
<discocaml> <dubious245> I don't think LR or more advanced parsers are a good fit for what I am doing. Let me look into pratt parsing.
<discocaml> <dubious245> Oh is Pratt parsing just using loops to do something like exp = term {+|- term}.
<discocaml> <contificate> yeah, it's about iteratively performing "left denotations" w.r.t to the next token, where the loop is limited in how far it can go by the concept of binding powers
<discocaml> <contificate> anyone who ever mentions "precedence climbing
<discocaml> <contificate> is talking about pratt parsing, in effect
<discocaml> <dubious245> Oh I was just doing the loop, I had no notion of binding power.
<discocaml> <contificate> although you can structure it arbitrarily different from pratt's paper
m5zs7k has quit [Ping timeout: 252 seconds]
m5zs7k has joined #ocaml
m5zs7k has quit [Ping timeout: 265 seconds]
m5zs7k has joined #ocaml
<discocaml> <dubious245> This is what each 'stage' of my parser looks like and I am quite proud of it.
<discocaml> <dubious245> ```
<discocaml> <dubious245> and parse_let_binding () = (* plb :: let id = exp in prog*)
<discocaml> <dubious245> peek_token then_empty (*else*)
<discocaml> <dubious245> (fun dg -> match token_of dg with
<discocaml> <dubious245> | Token.Let ->
<discocaml> <dubious245> expect Token.Let; let target = parse_ident () in
<discocaml> <dubious245> expect Token.Equal; let left = parse_fun_exp () in
<discocaml> <dubious245> expect_or Token.In
<discocaml> <dubious245> (let right = parse_let_binding () in Binding (target, left, right))
<discocaml> <dubious245> (Binding (target, left, Empty))
<discocaml> <dubious245> | _ -> parse_fun_exp ())```
<discocaml> <dubious245> I think it read's pretty clearing. handles both `let id = exp in exp` as well as `let id = exp`
bartholin has quit [Quit: Leaving]
dhil has quit [Ping timeout: 246 seconds]
<discocaml> <immortalpharaoh7> Hello, i think there's a small typo here: https://ocaml.org/docs/basic-data-types#functions
<discocaml> <yawaramin> please feel free to send a PR, should be an easy fix
<discocaml> <immortalpharaoh7> where's the PR link?
<discocaml> <immortalpharaoh7> i mean for the github i suppose
Serpent7776 has quit [Ping timeout: 265 seconds]
<discocaml> <yawaramin> near the bottom. there's a 'Contribute' link
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
szkl has joined #ocaml
germ_ has joined #ocaml
germ_ has quit [Remote host closed the connection]
Tuplanolla has quit [Quit: Leaving.]
germ_ has joined #ocaml