<discocaml>
<cemerick> has anyone done any tinkering with topiary w/ OCaml yet? Its defaults are pretty weird to my eye, but there's obviously a ton of options to take advantage of
count3rmeasure has quit [Read error: Connection reset by peer]
hsw has quit [Quit: Leaving]
chrisz has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
TakinOver has quit [Ping timeout: 250 seconds]
czy has joined #ocaml
spip has quit [Quit: Konversation terminated!]
TakinOver has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
curium has quit [Ping timeout: 276 seconds]
azimut has joined #ocaml
jlrnick has quit [Remote host closed the connection]
jlrnick has joined #ocaml
bartholin has joined #ocaml
jlrnick has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
bartholin has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
bartholin has quit [Quit: Leaving]
<discocaml>
<Bluddy> From the post "The fork does not really add any meat except introducing subtle regressions and make the community fragmented."
<discocaml>
<Bluddy> huh? AFAIK, Rescript decided to fragment the Reason community...
azimut has quit [*.net *.split]
azimut has joined #ocaml
alexherbo2 has quit [Ping timeout: 245 seconds]
alexherbo2 has joined #ocaml
spip has joined #ocaml
<discocaml>
<geoff> Stood out to me as well, weird way to think about it
wingsorc has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
<discocaml>
<beajeanm> I've often felt the reason community considered themselves a separate community that happened to use the same compiler as the ocaml community. (a lot of duplicated effort on tooling and libraries without much effort to work with the existing ocaml community, etc. but that might be an unkind interpretation from my part).
<discocaml>
<beajeanm> So from that perspective, yes, melange split the reason/rescript community.
xd1le has joined #ocaml
jlrnick has joined #ocaml
<discocaml>
<davesnx> The split now is clear, no? One side got to Melange while the other got to ReScript.
<discocaml>
<davesnx> Many people got into Reason from JS, but stayed for OCaml, that's a match on Melange
kurfen_ has quit [Ping timeout: 260 seconds]
kurfen has joined #ocaml
<adrien>
I replaced my use of BatIMap.fold_range with Array.iter in my code and performance tanked by more than 30%; this is the first time I need to care so much about what the compiler generates
alexherbo2 has quit [Ping timeout: 245 seconds]
alexherbo2 has joined #ocaml
<discocaml>
<Bluddy> adrien: How do you prevent iterating over the whole array?
alexherbo2 has quit [Ping timeout: 245 seconds]
bgs has joined #ocaml
alexherbo2 has joined #ocaml
<adrien>
sorry, it's (int * int) array: each value is a range (1424 elements iirc, it's small)
<zozozo>
adrien: an (int * int) array is quite inefficient (lots of indirections), it might be better to use a flattened int array and write custom functions to iterate over
bgs has quit [Remote host closed the connection]
<adrien>
zozozo: I've thought about doing it but I'd be a bit surprised this were directly the issue: there's only 1424 * 1423 / 2 = 1013176 iterations in total and that shouldn't make the runtime rise by ~40 seconds even on an i286 (but I'm planning on trying that nonetheless :) )
jlrnick has quit [Ping timeout: 276 seconds]
<zozozo>
adrien: well, an int array would have close to perfect cache locality (and prefetching I'd guess), whereas the (int * int) array would not, but I'm not sure how much diff that would make
alexherbo2 has quit [Remote host closed the connection]
JSharp_ has quit []
JSharp has joined #ocaml
<discocaml>
<Myrl but it/they> How weird would it be to pull the helper function in the value definition? `let go n = _ in let result = go n in` versus `let result = let go n = _ in go n in`
alexherbo2 has joined #ocaml
<discocaml>
<Myrl but it/they> Actually, scratch that. If `go` is composed of many lines, it separates `result` from `go n`, which hinders readability, right?
pie__ has quit [Ping timeout: 240 seconds]
<discocaml>
<Myrl but it/they> (My problem was that in the former, it "leaks" `go` despite only being used to calculate `result`.)
<discocaml>
<darrenldl> if both are within a small function then i tend to use the first style
pie_ has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
daftaupe has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
alexherbo2 has quit [Ping timeout: 245 seconds]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
<adrien>
heh, I probably still have stuff to improve with the ocaml code and the actual code generation that occurs but it turns out that having identical files in the input is a pathological case; avoiding them yields a x7 improvement at least and then sorting by size also helps a lot since my double-loop is not symmetrical
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Haudegen has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
zebrag[m] has quit [Quit: Bridge terminating on SIGTERM]
jmcantrell has quit [Quit: Bridge terminating on SIGTERM]
mclovin has quit [Quit: Bridge terminating on SIGTERM]
lobo[m] has quit [Quit: Bridge terminating on SIGTERM]
reynir[m] has quit [Quit: Bridge terminating on SIGTERM]
tjnhxmzhmqgytuwt has quit [Quit: Bridge terminating on SIGTERM]
mclovin has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
xd1le has quit [Quit: xd1le]
lobo[m] has joined #ocaml
zebrag[m] has joined #ocaml
reynir[m] has joined #ocaml
tjnhxmzhmqgytuwt has joined #ocaml
jmcantrell has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
pukkamustard has quit [Excess Flood]
pukkamustard has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
pukkamustard has quit [Excess Flood]
pukkamustard has joined #ocaml
alexherbo2 has joined #ocaml
pukkamustard has quit [Excess Flood]
pukkamustard has joined #ocaml
waleee has joined #ocaml
mbuf has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 245 seconds]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
bartholin has joined #ocaml
dhil has joined #ocaml
mbuf has quit [Quit: Leaving]
alexherbo2 has quit [Ping timeout: 245 seconds]
Tuplanolla has joined #ocaml
alexherbo2 has joined #ocaml
olle has joined #ocaml
<olle>
So in an IO monad, is the effect inside the monadic state?
<olle>
Not sure how to understand it yet
<olle>
Maybe I need to read those blog posts a couple of times more, hehe
<discocaml>
<Kali> IO being simultaneously a monad and abstract (in Haskell) ensures that the only way to chain side-effects is with >>=. each chaining *represents* a step in a computation, but in reality, it only builds up a data structure that is interpreted by the haskell runtime, which then is the thing that actually executes it.
<olle>
Yeah but Haskell has built-in IO monad? So it's a different case than in OCaml?
<discocaml>
<Kali> i am not familiar with an IO monad in ocaml
<discocaml>
<Kali> in ocaml, you sequence side-effects with `;`, which does not prevent you from inserting arbitrary side effects
<olle>
Oh sure
<discocaml>
<Kali> there may be a library providing an IO monad
<olle>
There are some forum threads etc
<discocaml>
<Kali> it would have to redefine every side-effecting function in the standard library
<discocaml>
<Kali> or change their signature, at least
<olle>
I mean, you can just wrap them in lambdas too no?
<olle>
Wait
alexherbo2 has quit [Remote host closed the connection]
<companion_cube>
trying to turn OCaml into Haskell is counter-productive, really
<olle>
companion_cube: Not my target, I just want to understand IO monads for a blog post I'm working on for strategies to make functions pure.
<discocaml>
<Kali> the situation in ocaml is a little different because how it handles side-effects (which are run directly, rather than built up then interpreted)
<discocaml>
<Kali> the following haskell program does not output anything:
<discocaml>
<Kali> ```hs
<discocaml>
<Kali> ignore _ = ()
<discocaml>
<Kali> main = return $ ignore $ putStrLn "hello"
<discocaml>
<Kali> ```
<discocaml>
<Kali> while the following ocaml program does:
<discocaml>
<Kali> ```ocaml
<discocaml>
<Kali> let main = ignore @@ print_string "hello"
<discocaml>
<Kali> ```
<discocaml>
<Kali> you would need to wrap things in lambdas, as you mentioned
jlrnick has joined #ocaml
waleee has joined #ocaml
<olle>
Right
waleee has quit [Ping timeout: 265 seconds]
<olle>
Meh, maybe I'll just add a foot not about IO monad and tagless-final and that's enough. It's an OOP-centric article anyway.