companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
richbridger has joined #ocaml
aquijoule_ has quit [Ping timeout: 264 seconds]
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
dhil has quit [Ping timeout: 264 seconds]
waleee has quit [Ping timeout: 252 seconds]
hex0punk has joined #ocaml
hex0punk has quit [Ping timeout: 272 seconds]
mbuf has joined #ocaml
vicfred has joined #ocaml
drakonis1 has joined #ocaml
drakonis1 has quit [Client Quit]
zodeishi has quit [Ping timeout: 252 seconds]
zebrag has quit [Quit: Konversation terminated!]
hex0punk has joined #ocaml
hex0punk has quit [Ping timeout: 272 seconds]
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
eight has quit [Ping timeout: 268 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
mro has joined #ocaml
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
vicfred has quit [Ping timeout: 272 seconds]
wonko has joined #ocaml
mro has quit [Quit: Leaving...]
_whitelogger has joined #ocaml
cedric has joined #ocaml
gareppa has joined #ocaml
Haudegen has joined #ocaml
gareppa has quit [Remote host closed the connection]
<d_bot> <darrenldl> companion_cube: added "time zone-less" date time support along with corresponding ISO8601 API (will push timedesc.0.4.0 shortly), this should be it in terms of substituting calendarlib
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
olle has joined #ocaml
salkin has joined #ocaml
rwmjones_ is now known as rwjones
rwjones is now known as rwmjones
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
dhil has joined #ocaml
salkin has quit [Quit: salkin]
salkin has joined #ocaml
noisy-bot has joined #ocaml
bartholin has joined #ocaml
noisy-bot has quit [Remote host closed the connection]
noisy-bot has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
<d_bot> <bikal> @dinosaure when using angstrom buffered, does it buffer the whole of input? i.e. if I am reading a 4 MB file does Angstrom.Buffered buffer all 4 MB content?
<Armael> no, it will depend on how much lookahead your parser needs
noisy-bot has quit [Ping timeout: 272 seconds]
<d_bot> <bikal> Oh. So it discards some previous input it no longer needs?
<d_bot> <dinosaure> Yeah, @Armael is true
<Armael> yep
<d_bot> <dinosaure> To allow angstrom to discard contents, you must use `commit`
<d_bot> <dinosaure> Otherwise, it is not allow to drop old contents
<Armael> well, strictly speaking that's if you're branching right? so that it could need to backtrack and try another branch
<Armael> if there's no backtracking involved I would assume that you don't have to use commit
<d_bot> <bikal> so `commit` should be called by the user developed parser, right? i.e. angstrom doesn't automatically determine where to call `commit` and such?
<Armael> correct
<d_bot> <bikal> yeah, that makes sense. I was looking at the angstrom source and was bit baffled how commit was calculated, but now it makes sense.
<d_bot> <bikal> IIUC in angstrom backtracking is only done when using `<|>` and `<?>` combinators. so does that mean I need to determine when to call `commit` if I use these combinators?
<d_bot> <bikal> and Buffered.parse
<Armael> dinosaure can confirm, but I think so, yes
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
jbrown has quit [Ping timeout: 244 seconds]
jbrown has joined #ocaml
<d_bot> <dinosaure> Yes and `choice` :)
favonia has quit [Ping timeout: 268 seconds]
<d_bot> <bikal> ok.
favonia has joined #ocaml
noisy-bot has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
dhil has quit [Ping timeout: 272 seconds]
dhil has joined #ocaml
berberman has quit [Ping timeout: 265 seconds]
berberman_ has joined #ocaml
zodeishi has joined #ocaml
noisy-bot has quit [Ping timeout: 264 seconds]
noisy-bot has joined #ocaml
osa1 has joined #ocaml
<osa1> how do I profile an OCaml app with dune build system in 2021? Most recent discussion I've seen is https://discuss.ocaml.org/t/status-of-profiling-in-ocaml/5787 but nothing concrete there (links to documentation, tutorials, examples, ...)
<zozozo> osa1: one solution (on linux) is perf: `dune build --profile=release; perf record --call-graph=dwarf dune exec --profile=release -- ./path/to/your/bin.exe; perf report`
<osa1> zozozo: why is the `dune exec --profile` part needed? can I not call my .exe directly?
<Fardale> zozozo: won't the --prolfile=release, remove the -g option and remove the symbols?
<zozozo> osa1: you can, but in the dev mode, dune builds everything in opaque mode, preventing any cross-module inlining or optimizations
<zozozo> Fardale: I don't know, I think dune should keep the -g even for the release profile, given how useful backtraces are
<osa1> zozozo: I'm not talking about the `--profile=release` part, I will build with release profile, but when calling perf record why call dune exec, instead of directly calling the generated exe
<zozozo> osa1: ah sure, you can call your executable directly
<zozozo> it's just that sometime it can be annoying to have to go and find it in the _build dir, and assuming your program runs for more than 1s, the overhead of the dune exec will be negligible (assuming the exe is already built), so it ccan sometimes be more convenient
<osa1> zozozo: OK thanks. Unfortunately `perf report` doesn't show a single symbol from my program.. I think the symbols are from OCaml RTS? Not sure..
<osa1> It has some addresses like 0xfff0123123
Haudegen has quit [Quit: Bin weg.]
<osa1> Oh, OK, some of these symbols kinda like my function names..
<zozozo> oh, that's a bit strange, on my machine I get exactly the symbols I'd expect
<osa1> no you're right, the format is a bit weird but I can see that some of these are functions in my code.
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
waleee has joined #ocaml
waleee has quit [Quit: WeeChat 3.1]
waleee has joined #ocaml
<zozozo> osa1: so, perf is nice for time mesurements, for there is also a memory profile for ocaml (that helps locate whats parts of your code allocates values), just tell me if you want me to explain how to set it up
zebrag has joined #ocaml
Haudegen has joined #ocaml
<companion_cube> pssst, then you can use a tiny script to produce flamegraphs ;_
<companion_cube> ;)
<zozozo> indeed, I still use that script from time to time, ^^
<zozozo> but in some cases, it can have some problems in correctly identifying callstack loops, and thus produce some weird replicated flames here and there
waleee has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
dy is now known as ocelot
noisy-bot has quit [Remote host closed the connection]
ocelot is now known as dy
waleee has quit [Ping timeout: 272 seconds]
cedric has quit [Quit: Konversation terminated!]
romildo_ has joined #ocaml
salkin has quit [Ping timeout: 272 seconds]
<romildo_> Hello.
<romildo_> I have a question about dune and the generation opam files.
<romildo_> In my test project I set generate_opam_files to true in the dune-project file.
<romildo_> Now I want dune to just generate the opam files. How can I get it?
<romildo_> I am not finding no dune command for that in the dune manual page.
<smondet[m]> just `dune build package.opam`?
<zozozo> romildo_: `dune build @install` should build everything need to install your project, including .opam files
<companion_cube> `dune build @install`
<romildo_> Does `dune build @install` also install the needed dependencies in opam?
<companion_cube> nope
<zozozo> romildo_: first, note that `dune build @install` does *not* install anything, it simply builds everything required for installation, so that installation can then simply be a copy of files
<zozozo> then, in any case, it does do anything regarding dependencies, that's the job of opam currently
<zozozo> it does *not* do anything regarding dependencies
<companion_cube> tbh it's a problem
<zozozo> companion_cube: that's called a feature, :p
<romildo_> So before being able to run `dune build @install` the build dependencies should already be installed, right?
<zozozo> romildo_: yes
<romildo_> That can be accomplished with `opam install . --deps-only`, I think.
<romildo_> But for it I would need already have the project.opam file.
<companion_cube> zozozo: that's a problem for people who haven't been using OCaml for 10 years :)
<companion_cube> who expect tools to work out of the box
<zozozo> companion_cube: yeah, i know
<romildo_> But I want that `project.opam` be generated by dune.
<companion_cube> it is, it is
<companion_cube> only, it doesn't then install the dependencies, you still have to use opam
<romildo_> So I come back to my initial question: how to generate it without running `dune build @install` (because I do not have yet the build dependencies)?
mro has joined #ocaml
<romildo_> Which smondet[m] already answered: `dune build package.opam` just worked for this purpose. Thanks.
drewolson has quit [Changing host]
drewolson has joined #ocaml
<companion_cube> ah I see. good point.
cedric has joined #ocaml
<romildo_> It would be nice to be able to generate the `project.opam` file without explicitly mentioning the project name in the command line. Something like `dune generate_opam`.
<companion_cube> sounds like a good idea, you could open an issue I imagine
<romildo_> Interesting that there is already an issue for that: https://github.com/ocaml/dune/issues/4487
<zozozo> there's also an issue/proposal for opam to automatically call dune to generate opam files when pinning/adding a repo, when needed
salkin has joined #ocaml
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
sunset_NOVA has joined #ocaml
mbuf has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
bartholin has quit [Quit: Leaving]
mro has quit [Quit: Leaving...]
sunset_NOVA has quit [Quit: Leaving]
sunset_NOVA has joined #ocaml
sunset_NOVA has quit [Client Quit]
mariari has quit [Ping timeout: 268 seconds]
<theblatte> `opam install opam/foo.opam --locked` ignores opam/foo.opam.locked completely, I need to do `opam install opam/foo.opam.locked`. Am I using it wrong? It used to work when we didn't have our opam files in a separate opam/ directory
<theblatte> off to GitHub issues I go
waleee has joined #ocaml
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
romildo_ has quit [Quit: Leaving]
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
Haudegen has joined #ocaml
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
waleee has quit [Quit: WeeChat 3.1]
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
Tuplanolla has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
zebrag has quit [Remote host closed the connection]
vicfred has joined #ocaml
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
jbrown has joined #ocaml
Anarchos has joined #ocaml
Serpent7776 has quit [Quit: leaving]
zebrag has joined #ocaml
eight has joined #ocaml
Anarchos has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
waleee has quit [Quit: WeeChat 3.1]
waleee has joined #ocaml
taylskid has joined #ocaml
unyu has quit [Ping timeout: 252 seconds]
dhil has quit [Ping timeout: 245 seconds]
eight has quit [Quit: Rebooting]
eight has joined #ocaml
wonko has quit [Quit: See You Space Cowboy..]
favonia has quit [Ping timeout: 264 seconds]
favonia has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
cedric has quit [Quit: Konversation terminated!]
oriba has joined #ocaml
favonia has quit [Ping timeout: 272 seconds]
favonia has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #ocaml