[itchyjunk] has quit [Remote host closed the connection]
favonia has joined #ocaml
sagax has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
mbuf has quit [Ping timeout: 246 seconds]
shawnw has quit [Remote host closed the connection]
mbuf has joined #ocaml
kakadu has quit [Ping timeout: 265 seconds]
xiongxin has quit [Ping timeout: 264 seconds]
xiongxin has joined #ocaml
gravicappa has joined #ocaml
andreypopp has quit [Ping timeout: 264 seconds]
andreypopp has joined #ocaml
mro has joined #ocaml
xiongxin has quit [Ping timeout: 264 seconds]
gravicappa has quit [Ping timeout: 264 seconds]
gravicappa has joined #ocaml
gravicappa has quit [Ping timeout: 252 seconds]
gravicappa has joined #ocaml
xiongxin has joined #ocaml
olle has joined #ocaml
rond_ has joined #ocaml
<Leonidas>
thizanne: oh. Good point. That's exactly what happened and what explains why I can't find any info about it.
<Leonidas>
Does ocaml-re not support classes like \d ? Re.Str.regexp "\d" fails and it says that it supports the same syntax as GNU Emacs (which according to documentation also doesn't understand \d)
<companion_cube>
Try with another syntax maybe? Like Re.Posix or Re.Perl
<Leonidas>
Re.Perl seems to accept it, thanks
Serpent7776 has quit [Read error: Connection reset by peer]
wwilly has joined #ocaml
Serpent7776 has joined #ocaml
hendursa1 has joined #ocaml
hendursaga has quit [Ping timeout: 276 seconds]
bartholin has joined #ocaml
Janni has joined #ocaml
gravicappa has quit [Ping timeout: 252 seconds]
gravicappa has joined #ocaml
xiongxin has quit [Ping timeout: 265 seconds]
xiongxin_ has joined #ocaml
bikal has joined #ocaml
bikal has quit [Client Quit]
bikal has joined #ocaml
xiongxin_ has quit [Ping timeout: 260 seconds]
bikal has quit [Remote host closed the connection]
kakadu has joined #ocaml
andreypopp has quit [Ping timeout: 264 seconds]
andreypopp has joined #ocaml
xiongxin has joined #ocaml
mbuf has quit [Ping timeout: 246 seconds]
hackinghorn has joined #ocaml
hornhack has quit [Ping timeout: 252 seconds]
mbuf has joined #ocaml
salkin has joined #ocaml
Janni has quit [Ping timeout: 252 seconds]
glassofethanol has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
gravicappa has quit [Ping timeout: 252 seconds]
<d_bot>
<Drup> @HYPHEN The prototype of OCaml with algebraic effect does that as well. As soon as you get an effect system to tell you if a function is pure or not, you can generalize quite a bit more
Everything has joined #ocaml
haesbaert has quit [Remote host closed the connection]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
wwilly has quit [Quit: Leaving]
salkin has quit [Quit: salkin]
salkin has joined #ocaml
salkin has quit [Client Quit]
mro has quit [Read error: Connection reset by peer]
mro_ has joined #ocaml
salkin has joined #ocaml
[itchyjunk] has joined #ocaml
glassofe1hanol has joined #ocaml
glassofethanol has quit [Ping timeout: 264 seconds]
salkin has quit [Quit: salkin]
mro_ has quit [Read error: Connection reset by peer]
mro has joined #ocaml
wonko has joined #ocaml
waleee has joined #ocaml
gravicappa has joined #ocaml
Haudegen has joined #ocaml
mro has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 246 seconds]
daachi has joined #ocaml
mro has joined #ocaml
favonia has quit [Ping timeout: 264 seconds]
wwilly has joined #ocaml
mro has quit [Remote host closed the connection]
SquidDev1 has joined #ocaml
Nahra` has joined #ocaml
dh` has quit [Ping timeout: 252 seconds]
Nahra has quit [Ping timeout: 252 seconds]
Armael has quit [Ping timeout: 252 seconds]
SquidDev has quit [Ping timeout: 252 seconds]
SquidDev1 is now known as SquidDev
<d_bot>
<froyo> typed effects would be a bliss
<d_bot>
<froyo> pointfree ocaml
<d_bot>
<froyo> finally some perl in my ocaml
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #ocaml
<d_bot>
<froyo> (please don't take this as a motivation to not have typed effects in the language im just kidding haha ha .. ha)
<d_bot>
<EduardoRFS> @Drup is that so? Like, if a function is pure from a type system point of view you know that you can always move it and fuse multiple executions
<d_bot>
<EduardoRFS> like,
<d_bot>
<EduardoRFS>
<d_bot>
<EduardoRFS> let a = pure(v);
<d_bot>
<EduardoRFS> let b = pure(v);
<d_bot>
<EduardoRFS> let a = pure v
<d_bot>
<EduardoRFS> let b = a
<Corbin>
Not always. At least in Haskell (and I think in any non-eager language) it's possible to overshare. The main symptom is that objects stay alive on the heap for too long, shared to a computation which will never consume them.
<d_bot>
<EduardoRFS> but OCaml is eager
mro has joined #ocaml
<sim642>
If the reuse is conditional, then it's not due to laziness but predicting the future
<sim642>
Or rather, not being able to predict the future
favonia has joined #ocaml
<sim642>
In an eager language you might even prefer that such sharing doesn't happen automatically but your explicit calls eagerly do the computation each time and not require the stuff to stay around in memory meanwhile
<sim642>
Because if you didn't want duplicate computation, you'd just do the reuse yourself and avoid duplicate code
<d_bot>
<EduardoRFS> or the API provided to the user implicitly do two duplicated calls and the user cannot avoid them
<d_bot>
<EduardoRFS> also it's not sharing, it's literally pointless computation, the function is pure, you already have the value computed, reusing it would be better than not reusing it and allocating more memory
<d_bot>
<EduardoRFS> I fail to see any upside of computing two pure functions twice
<sim642>
Maybe in the intermediate computations you require a lot of memory and you don't want the previous huge allocated block to stay around, reducing heap space
<d_bot>
<EduardoRFS> yes but on my case both variables will stay alive the entire time
<sim642>
You'd rather do a computation twice than not being able to do it at all because you don't have enough RAM
<d_bot>
<EduardoRFS> there is no memory downside, the variable reference will stay alive anyway
<d_bot>
<EduardoRFS> ```ocaml
<d_bot>
<EduardoRFS> let a = pure v in
<d_bot>
<EduardoRFS> let b = long_computation () in
<d_bot>
<EduardoRFS> let c = pure v in
<d_bot>
<EduardoRFS> (a, b, c)
<d_bot>
<EduardoRFS> ```
<d_bot>
<EduardoRFS> of course here the best optimization would to make so that pure v is called after long_computation, but if long_computation accepted v as a parameter then the best optimization would be to make so that
<d_bot>
<EduardoRFS>
<d_bot>
<EduardoRFS> let c = a
<d_bot>
<EduardoRFS> and btw this is not a fictious scenario, I literally noticed that one of my libraries yesterday call a recursive function too many times, but there is no way to enforce it on the type system as we don't have linearity
mro has quit [Remote host closed the connection]
mro has joined #ocaml
favonia has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
cedric has joined #ocaml
<d_bot>
<Kakadu> My ocaml-platform in VsCode sometimes shows times of structure-item-level let-declarations, but sometimes don't. Do you observe the similar behaviour? Do you know what may cause it?
Stumpfenstiel has joined #ocaml
mro has quit [Ping timeout: 246 seconds]
Tuplanolla has joined #ocaml
rond_ has quit [Quit: Client closed]
mro has joined #ocaml
favonia has quit [Ping timeout: 260 seconds]
wonko has quit [Ping timeout: 252 seconds]
favonia has joined #ocaml
Everything has quit [Quit: leaving]
favonia has quit [Ping timeout: 265 seconds]
<d_bot>
<Drup> @EduardoRFS
<d_bot>
<Drup> ```
<d_bot>
<Drup> let a = create_huge_object_purely small_thingy in
<d_bot>
<Drup> let small_result1 = f1 a in
<d_bot>
<Drup> ..... lots_of_computation to produce x ....
<d_bot>
<Drup> let a = create_huge_object_purely small_thingy in
<d_bot>
<Drup> let small_result2 = f2 a x in
<d_bot>
<Drup> ....
<d_bot>
<Drup> ```
<d_bot>
<Drup> imagine that if you keep `a` allocated, you cannot run the lot's of computation.
<d_bot>
<Drup> (this scenario is not completely fictuous. There are places in the compiler where this is done because creating a huge short-lived object is really cheap, but keeping it alive would be very expansive)
cedric has quit [Quit: Konversation terminated!]
daachi has quit [Ping timeout: 265 seconds]
mro has quit [Quit: Leaving...]
Stumpfenstiel has quit [Ping timeout: 264 seconds]
Tuplanolla has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 252 seconds]
<d_bot>
<dinosaure> like a map of billion keys
[itchyjunk] has joined #ocaml
<d_bot>
<EduardoRFS> @Drup I understand, but you're not creating something in my second example, `a1` still have a reference after lots_of_computation. So you would need to keep the reference anyway as `a1` is alive