companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
wingsorc has quit [Ping timeout: 240 seconds]
sonologico has quit [Remote host closed the connection]
sonologico has joined #ocaml
sonologico has quit [Remote host closed the connection]
sonologico has joined #ocaml
rock64 has quit [Ping timeout: 265 seconds]
rock64 has joined #ocaml
laokz has joined #ocaml
zebrag has joined #ocaml
inkbottle has quit [Ping timeout: 264 seconds]
vicfred has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
angerman_ is now known as angerman
_whitelogger has joined #ocaml
robmyers has quit [Ping timeout: 256 seconds]
robmyers has joined #ocaml
narimiran has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
brown121407_ has joined #ocaml
cqc has quit [*.net *.split]
metadave has quit [*.net *.split]
alehander92 has quit [*.net *.split]
jeroud has quit [*.net *.split]
brown121407 has quit [*.net *.split]
ansiwen[m] has quit [*.net *.split]
jeroud has joined #ocaml
cqc has joined #ocaml
metadave has joined #ocaml
alehander92 has joined #ocaml
ansiwen[m] has joined #ocaml
sonologico has quit [Remote host closed the connection]
osa1 has joined #ocaml
laokz has quit [Ping timeout: 246 seconds]
laokz has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
narimiran has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
yomimono has joined #ocaml
vicfred has quit [Remote host closed the connection]
vicfred has joined #ocaml
laokz has quit [Ping timeout: 264 seconds]
theglass has quit [Quit: ZNC - http://znc.in]
theglass has joined #ocaml
theglass is now known as Guest4887
Haudegen has joined #ocaml
laokz has joined #ocaml
dckc has quit [Ping timeout: 264 seconds]
dckc has joined #ocaml
Tuplanolla has joined #ocaml
dborisog has joined #ocaml
borne has joined #ocaml
Guest4887 has quit [Ping timeout: 240 seconds]
theglass has joined #ocaml
theglass is now known as Guest81661
dborisog has quit [Ping timeout: 240 seconds]
laokz has quit [Ping timeout: 265 seconds]
laokz has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<Armael> is it possible to disable the opam sandbox just for the installation of a single package?
<Armael> (well I did it by commenting the relevant lines in ~/.opam/config)
<vsiles> that's how I usually do it when it is a one shot
bartholin has joined #ocaml
bartholin has quit [Client Quit]
laokz has quit [Ping timeout: 256 seconds]
wingsorc has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
narimiran has quit [Ping timeout: 246 seconds]
mgsk has quit [*.net *.split]
conjunctive has quit [*.net *.split]
artart78 has quit [*.net *.split]
angerman has quit [*.net *.split]
d_bot_ has quit [*.net *.split]
Manis[m]11 has quit [*.net *.split]
talyian[m] has quit [*.net *.split]
conjunctive has joined #ocaml
talyian[m] has joined #ocaml
Manis[m]11 has joined #ocaml
artart78 has joined #ocaml
angerman has joined #ocaml
mgsk has joined #ocaml
d_bot_ has joined #ocaml
d_bot_ has quit [Remote host closed the connection]
d_bot has joined #ocaml
Guest81661 has quit [Quit: ZNC - http://znc.in]
theglass has joined #ocaml
theglass is now known as Guest68336
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
motherfs1 has joined #ocaml
motherfsck has quit [Ping timeout: 240 seconds]
yomimono_ has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
laokz has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
Guest68336 has quit [Changing host]
Guest68336 has joined #ocaml
Guest68336 is now known as theglass
<companion_cube> yeah, and then you forget to re-enable it
<companion_cube> ooops
Haudegen has joined #ocaml
raver has quit [Read error: Connection reset by peer]
spew has joined #ocaml
dckc has quit [Ping timeout: 241 seconds]
laokz has quit [Quit: Leaving]
dckc has joined #ocaml
tane has joined #ocaml
hnOsmium0001 has joined #ocaml
borne has quit [Ping timeout: 240 seconds]
Haudegen has quit [Quit: Bin weg.]
yomimono_ has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
Haudegen has joined #ocaml
mbuf has joined #ocaml
motherfs1 is now known as motherfsck
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
nullcone has joined #ocaml
yomimono has quit [Ping timeout: 258 seconds]
raver has joined #ocaml
waleee-cl has joined #ocaml
yomimono has joined #ocaml
mbuf has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 272 seconds]
yomimono_ has joined #ocaml
<cemerick> (I'll post the answer in some hours if no one figures it out)
yomimono has quit [Ping timeout: 240 seconds]
<companion_cube> evaluation order?
<Armael> mmmm the nesting of try/with handlers
<Armael> looks suspiscious
<cemerick> companion_cube: correct, you're faster than I was
<companion_cube> btw I find `match with exception` to be super useful
<cemerick> it evaluates the recursive `groups` call before the maybe-throwing `matched_group` call
<companion_cube> in particular because it's easier to restrict the scope of try
<companion_cube> ahah of course :D
<cemerick> this makes _no_ sense to me!!
<Armael> ah, right
<companion_cube> it's implementation defined, cemerick
<companion_cube> in bytecode it'd be left to right, i think
<cemerick> talk about a footgun
<companion_cube> if you want linear order, use let
<companion_cube> (or, here, match I'd say)
<def> is it the runtime that is not right?
<def> runtime performance*
<def> I can easily imagine it being quadratic :P
<companion_cube> ^
<cemerick> companion_cube: yeah, the working code `let`s as needed
<d_bot> <ggole> I've run into that before, it is quite annoying
<companion_cube> truly, use match, it'll be cleaner
<d_bot> <ggole> `match`ing on exceptions was very welcome, much less error-prone than `try`
* cemerick wasn't aware of the match-with-exception option, thanks
<cemerick> I appreciate the necessity of implementation-defined semantics for all sorts of things, but varying evaluation order in an eager language seems like a truly bad spot for it...with what upside?
<companion_cube> I'm sure you can find mailing list threads on the why
<companion_cube> I think relying on evaluation order is a code smell
<companion_cube> but it's a footgun anyway
<d_bot> <ggole> There are some minor commuting optimisations (that I don't think ocamlopt even does), and right-to-left is a bit nicer for the bytecode stack
<cemerick> ah, List.t is a tuple, and tuples are explicitly right-to-left https://discuss.ocaml.org/t/tuple-and-function-execution-order/5108/5
<def> our upcoming tail-modulo-cons patch will change evaluation order
<cemerick> or, was historically right-to-left, and now unspecified
<companion_cube> def: 😍
<d_bot> <ggole> Oh, it's still happening?
<d_bot> <ggole> Good on the people involved in sticking with it.
<def> finally, thanks to gasche who did some code-archeology :)
<cemerick> yeah, just found his comment here, which helps to answer the "why?" question (historical efficiency, but also, currying): https://discuss.ocaml.org/t/why-are-ocaml-function-arguments-evaluated-right-to-left/1214/3?u=cemerick
narimiran has quit [Ping timeout: 240 seconds]
<d_bot> <craigfe> The feasibility of TRMC seems like a nice validation of the decision to keep evaluation order undefined (at least for constructor args), regardless of the historical reasons for doing so
<zozozo> well, additionally, if your program is pure, evaluation order does not matter
<d_bot> <craigfe> (pure _and_ total _and_ used-only-by-programmers-that-don't-care-about-performance)
<companion_cube> :p
<companion_cube> https://xkcd.com/1312/ ?
<d_bot> <craigfe> exactly 😛
<cemerick> zozozo: I would take that more seriously in OCaml if it didn't widely use exceptions for unexceptional cases
<zozozo> ah, well, exceptions are actually a nice enough way to have correctly scoped gotos, which in some situations is useful
<cemerick> or I should say, if its stdlib didn't
<def> yep, non-local control is sometime nice... often regrettable
<companion_cube> "nice enough" not that convenient, but well
yomimono_ has quit [Ping timeout: 272 seconds]
<companion_cube> (yes, give me return and break, godamnit)
<zozozo> ah... iirc pierre chambart proposed breaks and return as PRs some time ago, but it didn't really lead anywhere
yomimono has joined #ocaml
<zozozo> guess one could propose a RFC to start a discussion on the why and why not I suppose
<companion_cube> I proposed them and it got closed
<zozozo> oh, I forgot about tgat
<cemerick> hah, I don't think `List.hd`raising instead of returning `None` can be construed as "useful" in the modern era
<companion_cube> I disagree on that one
<companion_cube> List.hd should only ever be used if you know it's not []
<cemerick> I was trying to make a broader point :-)
<companion_cube> well if it returns None, you need to match
<companion_cube> so why not match in the first place?
<companion_cube> if you want a good example I'd volunteer `Map.find`
<cemerick> let me restate
<zozozo> for things such as Map.find, I think you can historically see it as: using exceptions internally is the faster way (allows to unwind the stakc frames used to dive into the tree), and before we had flambda, allocating an option and matching on it could be seen as a waste of time and ressources
<companion_cube> well, do people use flambda in prod, actually? :p
<cemerick> if you want to cite purity as a blanket for what ails you, exceptions are a very, very poor default choice for control flow
<companion_cube> I'd say the overhead can still be here
<zozozo> cemerick: I think people at jane street do
<cemerick> 🤷
<zozozo> arg, bad hl, sorry
<zozozo> meant to hl companion_cube earlier, :p
<cemerick> ah
<companion_cube> :p
<companion_cube> pure code + exceptions is an interesting mix I guess
<zozozo> there should only be 1 people by first nick letter in any cahnnel to help with completion, XD
yomimono has quit [Ping timeout: 240 seconds]
<cemerick> companion_cube: the point is that you can't claim purity in the presence of exceptions
<companion_cube> oh, ok
<cemerick> especially insofar as OCaml makes no distinction between precise and imprecise variants
<companion_cube> precise variants?
<d_bot> <ostera> "precise and imprecise variants" ?
<companion_cube> (I agree, exceptions make order evaluaiton matter in a way that is not the case iwht pure code)
<cemerick> I suppose that's haskell terminology
zebrag has quit [Quit: Konversation terminated!]
Hrundi_V_Bakshi has joined #ocaml
<companion_cube> as in, haskell is not actually pure? :D
<cemerick> hah
zebrag has joined #ocaml
<cemerick> within that little box they provide, sure! ⬛️
tane has quit [Read error: Connection reset by peer]
amiloradovsky has joined #ocaml
wingsorc has quit [Ping timeout: 260 seconds]
borne has joined #ocaml
raver has quit [Quit: Gateway shutdown]
raver has joined #ocaml
rak has quit [Quit: rak]
rak has joined #ocaml
sonologico has joined #ocaml
yomimono has joined #ocaml
wingsorc has joined #ocaml
worc3131 has joined #ocaml
wingsorc has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
yomimono has joined #ocaml
yomimono has quit [Client Quit]
Hrundi_V_Bakshi has quit [Ping timeout: 264 seconds]
zebrag has quit [Ping timeout: 240 seconds]
zebrag has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
amiloradovsky has quit [Ping timeout: 240 seconds]