Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<discocaml> <regularspatula> Oh yeah. base Or_error uses lazy internally …I guess serialization and comparisons will need to be locked if you do something weird like capture some mutable state when creating them
tri has joined #ocaml
tri has quit [Ping timeout: 272 seconds]
<companion_cube> Lazy and serialization already don't play too well :D. At least Marshall.
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jabuxas has joined #ocaml
jabuxas has quit [Ping timeout: 268 seconds]
tri has joined #ocaml
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
tri_ has joined #ocaml
tri__ has joined #ocaml
tri___ has joined #ocaml
tri has quit [Ping timeout: 245 seconds]
tri_ has quit [Ping timeout: 255 seconds]
tri___ has quit [Remote host closed the connection]
tri__ has quit [Ping timeout: 245 seconds]
tri has joined #ocaml
tri has quit [Ping timeout: 268 seconds]
mbuf has joined #ocaml
motherfsck has quit [Ping timeout: 252 seconds]
tri has joined #ocaml
tri_ has joined #ocaml
tri__ has joined #ocaml
tri has quit [Ping timeout: 268 seconds]
tri_ has quit [Ping timeout: 255 seconds]
tri__ has quit [Remote host closed the connection]
tri has joined #ocaml
tri has quit [Ping timeout: 260 seconds]
malte has quit [Ping timeout: 252 seconds]
malte has joined #ocaml
mima has joined #ocaml
Serpent7776 has joined #ocaml
bibi_ has quit [Remote host closed the connection]
bibi_ has joined #ocaml
dnh has joined #ocaml
torretto has quit [Ping timeout: 260 seconds]
Serpent7776 has quit [Ping timeout: 252 seconds]
torretto has joined #ocaml
cr1901_ has joined #ocaml
cr1901 has quit [Ping timeout: 260 seconds]
amk has left #ocaml [#ocaml]
bartholin has joined #ocaml
ski has joined #ocaml
Serpent7776 has joined #ocaml
mima has quit [Ping timeout: 256 seconds]
pi3ce has joined #ocaml
jabuxas has joined #ocaml
mima has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 272 seconds]
tri has joined #ocaml
torretto has quit [Ping timeout: 260 seconds]
torretto has joined #ocaml
tri has quit [Ping timeout: 255 seconds]
Serpent7776 has quit [Ping timeout: 256 seconds]
mima has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
motherfsck has joined #ocaml
<discocaml> <contextfreebeer> how do you handle creating artifacts that are to be used at *runtime* with Dune? e.g. for a compiler using Dune to compile the runtime that you will link against. You can hardcode the path of course but how do you solve this properly?
<discocaml> <contextfreebeer> by "hardcode the path" I mean specify the path to the object file in the _build directory
cr1901_ is now known as cr1901
tri has joined #ocaml
tri has quit [Ping timeout: 260 seconds]
<discocaml> <yawaramin> you can read the path from an environment variable
<discocaml> <contextfreebeer> ig
motherfsck has quit [Quit: quit]
mima has joined #ocaml
motherfsck has joined #ocaml
mima has quit [Ping timeout: 240 seconds]
tri has joined #ocaml
tri has quit [Ping timeout: 240 seconds]
<companion_cube> I'd like to group some common cmdliner options in a record, and have a parser for this record that's shared in multiple commands
<companion_cube> anyone knows if it's possible? I only see individual flags in cmdliner :/
mbuf has quit [Quit: Leaving]
<discocaml> <smondet> @companion_cube you can do that with `Cmdliner.Term.t` values but not for parses AFAIK (arg parsers are for individual options)
<discocaml> <smondet> @companion_cube you can do that with `Cmdliner.Term.t` values but not for parsers AFAIK (arg parsers are for individual options)
Tuplanolla has joined #ocaml
<companion_cube> but I didn't see a way to use a term in another term, did I miss it?
<discocaml> <andreypopp> via $
<discocaml> <andreypopp> f $ arg1 $ arg2
<companion_cube> hu, ok
<companion_cube> thought that didn't work for some reason
chiselfuse has quit [Remote host closed the connection]
<discocaml> <gabyfle> Is OCaml generally faster when manipulating mutable data structures or immutable data structures ?
chiselfuse has joined #ocaml
<discocaml> <gabyfle> I had the choice and I always prefer using immutable ones so my code is always "reconstructing" types (idk if this take makes sense). For example, all my functions will have a prototype that looks like t -> ... -> t. And I'm wondering if this is a bad habit or not, or if using mutable types instead of immutable ones would make my program overall faster
tri has joined #ocaml
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
tri has quit [Ping timeout: 260 seconds]
<discocaml> <contextfreebeer> it can be slower in some cases, but sometimes the change to the asymptotics or the removal of big constant factors makes that irrelevant
<discocaml> <contextfreebeer> mutable access isn't the same as in imperative languages due to the write barrier, as I understand it, but I have also observed that making things mutable indiscriminately can pessimize the performance
<discocaml> <gabyfle> Ok, because I'm actually working on a virtual machine for a language of my own and I for the bytecode execution, the `vm` state is actually immutable and is being reconstructed each time an operation is made, so I was wondering if that could hit the performances doing this instead of just mutating values inside the state type
infinity0 has quit [Remote host closed the connection]
<discocaml> <contextfreebeer> it's exactly that kind of thing which tends to not be faster, IME, but it probably depends on the specifics of your code, you could try measuring both ways
<discocaml> <contextfreebeer> in general I wouldn't worry about these questions unless you have proof that this is what's slowing you down
<discocaml> <gabyfle> No i'm actually pretty sure this is not what's slowing me down
infinity0 has joined #ocaml
<discocaml> <gabyfle> I was just wondering if any of those method to build code is faster than the other
torretto_ has joined #ocaml
<discocaml> <contextfreebeer> normally records like that are just a bunch of pointers, so you're copying like maybe a few bytes each time? it's nothing. whereas mutating directly might need to go through a function call so the GC is aware of what's going on
<discocaml> <contextfreebeer> so it will probably usually be slower, but you should use mutation if you want mutable semantics or the shape of your program is such that by doing mutation you can bypss a lot of work, it's a trade off
torretto has quit [Ping timeout: 260 seconds]
<discocaml> <limp.biskit> is`with` faster than mutable fields?
rgrinberg has joined #ocaml
<discocaml> <octachron> It can be faster.
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 255 seconds]
jabuxas has quit [Ping timeout: 268 seconds]
mima has joined #ocaml
dstein64- has joined #ocaml
dstein64 has quit [Ping timeout: 264 seconds]
dstein64- is now known as dstein64
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
masterbuilder has quit [Ping timeout: 260 seconds]
masterbuilder has joined #ocaml
bartholin has quit [Quit: Leaving]
jabuxas has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]