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/
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
neiluj has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
sroso has joined #ocaml
neiluj has quit [Ping timeout: 265 seconds]
Tuplanolla has quit [Quit: Leaving.]
m5zs7k has quit [Read error: Connection reset by peer]
m5zs7k has joined #ocaml
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
bibi_ has quit [Ping timeout: 252 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
spew has quit [Quit: spew]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
terrorjack4 has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack4 has joined #ocaml
bibi_ has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 244 seconds]
<discocaml> <.korven.> scala mentioned
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
toastal has joined #ocaml
ds-ac has quit [*.net *.split]
patrick_ has quit [*.net *.split]
infinity0 has quit [*.net *.split]
ggb has quit [*.net *.split]
arya_elfren has quit [*.net *.split]
pandeyan has quit [*.net *.split]
discocaml has quit [*.net *.split]
Exa has quit [*.net *.split]
oisota has quit [*.net *.split]
dme2 has quit [*.net *.split]
sailorCa- has quit [*.net *.split]
tomku has quit [*.net *.split]
drakonis has quit [*.net *.split]
farn__ has quit [*.net *.split]
johnel_ has quit [*.net *.split]
masterbuilder has quit [*.net *.split]
bcksl has quit [*.net *.split]
buoy49__ has quit [*.net *.split]
landonf has quit [*.net *.split]
chiselfuse has quit [*.net *.split]
pi3ce has quit [*.net *.split]
dmoerner has quit [*.net *.split]
euphores has quit [*.net *.split]
remexre has quit [*.net *.split]
gentauro has quit [*.net *.split]
kurfen has quit [*.net *.split]
gahr has quit [*.net *.split]
Ekho has quit [*.net *.split]
companion_cube has quit [*.net *.split]
ocabot has quit [*.net *.split]
trillion_exabyte has quit [*.net *.split]
end has quit [*.net *.split]
theblatte has quit [*.net *.split]
semarie has quit [*.net *.split]
lobo has quit [*.net *.split]
seeg has quit [*.net *.split]
ursa-major has quit [*.net *.split]
philipwhite has quit [*.net *.split]
ol0ck has quit [*.net *.split]
adrien has quit [*.net *.split]
SquidDev has quit [*.net *.split]
nfc has quit [*.net *.split]
deadmarshal_ has quit [*.net *.split]
sleepydog has quit [*.net *.split]
xvilka has quit [*.net *.split]
pluviaq has quit [*.net *.split]
henrytill has quit [*.net *.split]
whereiseveryone has quit [*.net *.split]
lane has quit [*.net *.split]
gebn_ has quit [*.net *.split]
ymherklotz has quit [*.net *.split]
nirvdrum has quit [*.net *.split]
rwmjones has quit [*.net *.split]
zozozo has quit [*.net *.split]
mima has quit [*.net *.split]
cross has quit [*.net *.split]
noddy has quit [*.net *.split]
jbowen has quit [*.net *.split]
ski has quit [*.net *.split]
m5zs7k has quit [*.net *.split]
troydm has quit [*.net *.split]
pippijn has quit [*.net *.split]
keyboard has quit [*.net *.split]
abbe__ has quit [*.net *.split]
dh` has quit [*.net *.split]
xgqt has quit [*.net *.split]
cedb has quit [*.net *.split]
nore has quit [*.net *.split]
Fardale1 has quit [*.net *.split]
Absalom has quit [*.net *.split]
octachron has quit [*.net *.split]
copy has quit [*.net *.split]
esum has quit [*.net *.split]
pgiarrusso has quit [*.net *.split]
sroso has quit [*.net *.split]
germ_ has quit [*.net *.split]
ansiwen has quit [*.net *.split]
cr1901_ has quit [*.net *.split]
ocra8 has quit [*.net *.split]
myrkraverk_ has quit [*.net *.split]
leah2 has quit [*.net *.split]
quernd80 has quit [*.net *.split]
szkl has quit [*.net *.split]
welterde has quit [*.net *.split]
emp has quit [*.net *.split]
malte has quit [*.net *.split]
jsoo has quit [*.net *.split]
habnabit_ has quit [*.net *.split]
cbarrett has quit [*.net *.split]
CalimeroTeknik has quit [*.net *.split]
xenu has quit [*.net *.split]
Putonlalla has quit [*.net *.split]
motherfsck has quit [*.net *.split]
mal`` has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
toastal has quit [*.net *.split]
bibi_ has quit [*.net *.split]
terrorjack4 has quit [*.net *.split]
spynxic has quit [*.net *.split]
dylanj has quit [*.net *.split]
delyan_ has quit [*.net *.split]
caasih has quit [*.net *.split]
energizer has quit [*.net *.split]
lisq has quit [*.net *.split]
Soni has quit [*.net *.split]
Johann has quit [*.net *.split]
rak has quit [*.net *.split]
bacam has quit [*.net *.split]
030AAKNTE has quit [*.net *.split]
ohperitel has quit [*.net *.split]
pmk_ has quit [*.net *.split]
grobe0ba has quit [*.net *.split]
Leonidas has quit [*.net *.split]
Boarders_____ has quit [*.net *.split]
keyle has quit [*.net *.split]
steenuil has quit [*.net *.split]
Ankhers has quit [*.net *.split]
b0o has quit [*.net *.split]
soni_ has quit [*.net *.split]
richardhuxton has quit [*.net *.split]
immutable has quit [*.net *.split]
rustyne has quit [*.net *.split]
_alix has quit [*.net *.split]
reynir has quit [*.net *.split]
Armael has quit [*.net *.split]
Duns_Scrotus has quit [*.net *.split]
JSharp has quit [*.net *.split]
sadiq has quit [*.net *.split]
jusensei2 has quit [*.net *.split]
drakonis has joined #ocaml
tomku has joined #ocaml
dme2 has joined #ocaml
sailorCa- has joined #ocaml
Exa has joined #ocaml
pandeyan has joined #ocaml
oisota has joined #ocaml
arya_elfren has joined #ocaml
ds-ac has joined #ocaml
078AAO3AY has joined #ocaml
infinity0 has joined #ocaml
ggb has joined #ocaml
trillion_exabyte has joined #ocaml
xgqt has joined #ocaml
landonf has joined #ocaml
bcksl has joined #ocaml
masterbuilder has joined #ocaml
buoy49__ has joined #ocaml
johnel_ has joined #ocaml
farn__ has joined #ocaml
keyle has joined #ocaml
Boarders_____ has joined #ocaml
jusensei2 has joined #ocaml
Soni has joined #ocaml
lisq has joined #ocaml
sadiq has joined #ocaml
Putonlalla has joined #ocaml
esum has joined #ocaml
pgiarrusso has joined #ocaml
Leonidas has joined #ocaml
energizer has joined #ocaml
copy has joined #ocaml
xenu has joined #ocaml
grobe0ba has joined #ocaml
CalimeroTeknik has joined #ocaml
cbarrett has joined #ocaml
dmbaturin has joined #ocaml
caasih has joined #ocaml
delyan_ has joined #ocaml
nore has joined #ocaml
ski has joined #ocaml
euphores has joined #ocaml
dylanj has joined #ocaml
octachron has joined #ocaml
jbowen has joined #ocaml
SquidDev has joined #ocaml
nfc has joined #ocaml
JSharp has joined #ocaml
adrien has joined #ocaml
Duns_Scrotus has joined #ocaml
Absalom has joined #ocaml
mima has joined #ocaml
companion_cube has joined #ocaml
gahr has joined #ocaml
nirvdrum has joined #ocaml
mal`` has joined #ocaml
emp has joined #ocaml
dh` has joined #ocaml
malte has joined #ocaml
cross has joined #ocaml
noddy has joined #ocaml
end has joined #ocaml
jsoo has joined #ocaml
b0o has joined #ocaml
cedb has joined #ocaml
kurfen has joined #ocaml
ursa-major has joined #ocaml
philipwhite has joined #ocaml
lane has joined #ocaml
xvilka has joined #ocaml
abbe__ has joined #ocaml
whereiseveryone has joined #ocaml
sleepydog has joined #ocaml
henrytill has joined #ocaml
Ekho has joined #ocaml
pluviaq has joined #ocaml
ymherklotz has joined #ocaml
_alix has joined #ocaml
ocabot has joined #ocaml
rustyne has joined #ocaml
rwmjones has joined #ocaml
Armael has joined #ocaml
seeg has joined #ocaml
soni_ has joined #ocaml
zozozo has joined #ocaml
richardhuxton has joined #ocaml
ol0ck has joined #ocaml
pmk_ has joined #ocaml
immutable has joined #ocaml
030AAKNTE has joined #ocaml
ohperitel has joined #ocaml
gebn_ has joined #ocaml
bacam has joined #ocaml
Fardale1 has joined #ocaml
rak has joined #ocaml
Johann has joined #ocaml
welterde has joined #ocaml
lobo has joined #ocaml
cr1901_ has joined #ocaml
semarie has joined #ocaml
szkl has joined #ocaml
ansiwen has joined #ocaml
steenuil has joined #ocaml
troydm has joined #ocaml
motherfsck has joined #ocaml
remexre has joined #ocaml
gentauro has joined #ocaml
keyboard has joined #ocaml
spynxic has joined #ocaml
deadmarshal_ has joined #ocaml
leah2 has joined #ocaml
theblatte has joined #ocaml
germ_ has joined #ocaml
quernd80 has joined #ocaml
pippijn has joined #ocaml
dmoerner has joined #ocaml
habnabit_ has joined #ocaml
myrkraverk_ has joined #ocaml
ocra8 has joined #ocaml
sroso has joined #ocaml
m5zs7k has joined #ocaml
chiselfuse has joined #ocaml
pi3ce has joined #ocaml
toastal has joined #ocaml
bibi_ has joined #ocaml
terrorjack4 has joined #ocaml
reynir has joined #ocaml
Ankhers has joined #ocaml
discocaml has joined #ocaml
Techcable has quit [Ping timeout: 252 seconds]
Techcable has joined #ocaml
xd1le has joined #ocaml
Serpent7776 has joined #ocaml
<adrien> I'm hitting an issue with pyml ( https://github.com/thierry-martinez/pyml/issues/97 ) where GIL is problematic from an ocaml program using threads; I've put all the python operations in a single thread and I'm now using OCaml 5.2 but it still seems threads that aren't the one dedicated to python can collect pyml's custom values
<adrien> and that requires holding the GIL which causes either a segfault/race-condition, or deadlock if I try to get the GIL from the finalizer
<adrien> the part I don't understand is that I thought that with OCaml 5, values allocated from a given thread would be collected by the same thread
<adrien> or is it that _one_ thread collects values allocated by _one_ thread but the mapping isn't fixed?
neiluj has joined #ocaml
bartholin has joined #ocaml
<octachron> Values allocated by a domain can be collected by any domain (in the shared major heap)
contificate has joined #ocaml
<adrien> these get freed through caml_empty_minor_heap() (4.x I guess) or caml_stw_empty_minor_heap_no_major_slice() (5.2, or at least in my case) but are custom values allocated in the minor heap?
Haudegen has joined #ocaml
contificate has quit [Quit: Client closed]
<discocaml> <otini_> if it’s not too big, yes
bartholin has quit [Quit: Leaving]
<adrien> thanks; I've been toying with Gc controls too but I was missing minor heap size probably; I also resurrected an older version of my code which seems to survive even without Gc controls (it didn't survive that well before I think...)
<adrien> I still have the option of spawning another process but I'd prefer to avoid that
dmoerner has quit [Ping timeout: 252 seconds]
<discocaml> <otini_> I thought the Python GIL was a thing of the past…?
<discocaml> <otini_> the issue OP is using Lwt. Lwt with multiple domains is not safe, except maybe when Lwt is confined to the main domain. Don’t know if you’re using Lwt too
dmoerner has joined #ocaml
<discocaml> <otini_> afraid I don’t know the python runtime well enough to help
<discocaml> <otini_> pyml looks a bit dead
neiluj has quit [Ping timeout: 260 seconds]
theblatte has quit [Quit: leaving]
<adrien> I'm using stuff on a single domain; the additional thing I have is Lwt_preemptive to communicate with a thread that I dedicate to python and which works in a blocking manner
<adrien> but that's still a single domain I think
<adrien> (maybe I could have the python stuff in a domain rather than a thread?)
<adrien> with large enough Gc controls, I don't get a crash anymore, or at least not before I get output from my program so I'll probably run with that for now and come back to this issue when I'm not in the middle of a large refactoring!
<adrien> the python gil is being removed but you need a separate build for that and it's only in 3.13 which was published very recently
<adrien> and the performance is lower so I don't think it'll be default before a while (but I hope distros provide both; that may be easier said than done however)
<adrien> and pyml is indeed not very active but I don't know if it really needs to be more active (stdcompat which it depends upon would benefit from an update in opam however because it's not compatible with 5.2)
<adrien> also, if distros start shipping gil-less python builds, but I also just tried using Domain.spawn instead of Thread.create and it seems to work well!
theblatte has joined #ocaml
mbuf has joined #ocaml
sroso has quit [Quit: Leaving :)]
<companion_cube> Be aware you shouldn't create more domains than you have cores
neiluj has joined #ocaml
ol0ck has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
ol0ck has joined #ocaml
ol0ck has quit [Changing host]
ol0ck has joined #ocaml
ol0ck has quit [Client Quit]
ol0ck has joined #ocaml
Everything has joined #ocaml
semarie has quit [Ping timeout: 252 seconds]
semarie has joined #ocaml
semarie has quit [Client Quit]
xd1le has quit [Quit: xd1le]
Everything has quit [Quit: leaving]
neiluj has quit [Ping timeout: 252 seconds]
Haudegen has quit [Quit: Bin weg.]
neiluj has joined #ocaml
Haudegen has joined #ocaml
semarie has joined #ocaml
alexherbo2 has joined #ocaml
toastal has quit [Ping timeout: 244 seconds]
neiluj has quit [Ping timeout: 276 seconds]
alexherbo2 has quit [Remote host closed the connection]
spew has joined #ocaml
pi3ce has quit [Ping timeout: 252 seconds]
pi3ce has joined #ocaml
<adrien> companion_cube: I don't create any other than the one dedicated to the python interpreter so I'm pretty safe; thinking about it, I may want to create a few for some CPU-intensive tasks but I'm confident that will be <= 4 and I can assert at startup that there are enough cores
<adrien> I'm writing something incredibly specific and that should see two concurrent deployments at most so I can do that :D
<adrien> (it takes ubuntu's migration "excuses" page, rewrites it and enhances it with up-to-date information from launchpad builders and bug tracker; and if you know enough to follow, no, I don't want to touch britney and link it more to external services!)
mbuf has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
spew has quit [Quit: spew]
spew has joined #ocaml
raskol has joined #ocaml
bartholin has joined #ocaml
tyzef has joined #ocaml
Haudegen has joined #ocaml
tyzef has quit [Quit: WeeChat 3.8]
nirvdrum has quit [Quit: Ping timeout (120 seconds)]
nirvdrum has joined #ocaml
Anarchos has joined #ocaml
euphores has quit [Ping timeout: 246 seconds]
euphores has joined #ocaml
bartholin has quit [Quit: Leaving]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 265 seconds]
neiluj has joined #ocaml
humasect has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Haudegen has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
Stumpfenstiel has joined #ocaml
YuGiOhJCJ has joined #ocaml
humasect has quit [Quit: Leaving...]
neiluj has joined #ocaml
<discocaml> <mm3315> Can it be memory efficient when writing parser combinator, writing a parser for char list, rather than for string?
neiluj has quit [Ping timeout: 272 seconds]
<discocaml> <mm3315> Can it be more memory efficient when writing parser combinator, writing a parser for char list, rather than for string?
<discocaml> <mm3315> Can it be more memory efficient when writing parser combinator, writing a parser for char list, instead of for string?
<discocaml> <sim642> A `char list` will definitely use more memory than `string` for the same length
<discocaml> <sim642> The only way I can see that `char list` may save memory is that GC could free some elements from the beginning that already have been parsed and made unreachable
<discocaml> <sim642> Whereas a `string` is monolithic
<discocaml> <mm3315> you mean returning the substring of string will not use more memory if I don't modify them right?
<discocaml> <contextfreebeer> you should probably use a buffer instead if you want efficient parsing
<discocaml> <contextfreebeer> https://ocaml.org/manual/5.1/api/Buffer.html
<discocaml> <contextfreebeer> or a library designed for it
Everything has joined #ocaml
neiluj has joined #ocaml
<discocaml> <mm3315> I'll check for it, thanks
<discocaml> <deepspacejohn> I don't think you should be needing to return substrings during parsing. You can just track your location within the string.
<discocaml> <qrpnxz> using a `char Seq.t` would save memory
<discocaml> <qrpnxz> this is for writing, how does it help for reading (parsing)?
<discocaml> <contextfreebeer> oh maybe I misunderstood what they wanted to use this for
<companion_cube> If you write, have a string Seq.t, not individual chars, at least
<companion_cube> Writing individual characters to anything but a buffer will be fairly inefficient
neiluj has quit [Ping timeout: 252 seconds]
<discocaml> <mm3315> Thanks for answer @qrpnxz and <companion_cube>, but how `char Seq.t` can be better at parsing compared to `char list`?
<discocaml> <mm3315> Does it provide sharing between thunks?
<discocaml> <mm3315> Thanks for answer @qrpnxz and <companion_cube>, but how `char Seq.t` can be better at parsing compared to `char list`?
<discocaml> <mm3315> Does it provide sharing between thunks, or something?
<companion_cube> I think char list and char seq are both terrible tbh
bibi_ has quit [Ping timeout: 244 seconds]
<companion_cube> I'd use a string or a lexbuf
<discocaml> <mm3315> I think string is bad because: https://discuss.ocaml.org/t/string-sub-memory-usage/4558
neiluj has joined #ocaml
<discocaml> <mm3315> I'm considering defining a new type for this similar to C++'s string_view.
<discocaml> <contextfreebeer> is there a reason you don't wish to use the built in lexer?
bibi_ has joined #ocaml
<discocaml> <mm3315> The traditional compiling process' does not align well with functional parsing.
<discocaml> <mm3315> The traditional compiling process 'parsing after lexing' does not align well with functional parsing.
<discocaml> <contextfreebeer> what do you mean?
<discocaml> <deepspacejohn> you can just track your position in the string without using String.sub, unless you actually need to copy a substring to the output.
neiluj has quit [Ping timeout: 276 seconds]
<discocaml> <qrpnxz> I didn't say better performance, it would use potentially less memory because you'd be streaming the characters rather than have them all in memory in a list all at once
Serpent7776 has quit [Quit: leaving]
<discocaml> <qrpnxz> I didn't say better parsing, it would use potentially less memory because you'd be streaming the characters rather than have them all in memory in a list all at once
<discocaml> <qrpnxz> damn, sorry for edit irc chat
<discocaml> <qrpnxz> terrible
<discocaml> <mm3315> 🤯
<discocaml> <qrpnxz> see channel description
<discocaml> <mm3315> I'm deeply sorry for all the crimes I committed..
<discocaml> <mm3315> anyway I got what you mean, thanks
<dh`> if you're worried about performance, you probably shouldn't be using a parser combinator library at all
<Anarchos> companion_cube char list, char seq, string, buffer.... I feel like it's too much. I remember caml light, when there was only mutable string.
<companion_cube> For substrings you can use string*int*int
<companion_cube> It sucks but there's nothing much better
<discocaml> <qrpnxz> No doubt caml light also had char list. I for one very much welcome immutable string and hope standard immutable arrays or something more sophisticated happen
halloy1870 has joined #ocaml
halloy1870 has quit [Remote host closed the connection]
maybe has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
maybe has quit [Remote host closed the connection]
maybe has joined #ocaml
maybe has quit [Remote host closed the connection]
maybe has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
maybe has quit [Remote host closed the connection]
xd1le has joined #ocaml
Stumpfenstiel has quit [Ping timeout: 252 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 276 seconds]
Everything has quit [Quit: leaving]
Tuplanolla has joined #ocaml
euphores has quit [Ping timeout: 252 seconds]
neiluj has joined #ocaml
euphores has joined #ocaml
neiluj has quit [Ping timeout: 276 seconds]