rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tuplanolla has quit [Quit: Leaving.]
<d_bot>
<Et7f3> So we drop manual management of fd ? This has issues since it can be unpredictable when fd will be gc-ed. Or we end up with a mix but it might crash if os reuse fd. I don't think fd are specified to be unique.
rgrinberg has joined #ocaml
epony has quit [Ping timeout: 240 seconds]
<dh`>
et7f3, that's why it doesn't work -- the collector doesn't know which things are file handles or know that it should clean them up promptly
<dh`>
it could be made to know some of these things but it becomes a shitshow
<dh`>
(the os won't reuse file handles until you close them, that's not an issue)
<companion_cube>
@butanium use better functions than open_in
zebrag has joined #ocaml
epony has joined #ocaml
<qwr>
its quite easy to have some unused reference somewhere, with memory its (temporary) leak, but with file handles it could get quite bad, some sort of linear typing might be more useful
<qwr>
(that is even if the "handle" gc were immeadiate, like refcounting)
pieguy128 has quit [Ping timeout: 240 seconds]
pieguy128 has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
<d_bot>
<Et7f3> The best I can see is in memory representation of fd and internally it is bool+real handle. The gc could prioritize this special type (eg use some kind of liveness analysis) to insert on exit or middle of function.
<d_bot>
<Et7f3> So linux fd just goes up ? Open =4, close(4), open =5 ? Same for mac os ? And windows it is pointer to raw memory so I don't think such guarantees hold.
<companion_cube>
just forget it, use functions that take care of that
<d_bot>
<Et7f3> It can be a fun project to do.
<d_bot>
<Et7f3> And it could be generalised to memory also.
<companion_cube>
it's not easy, and probably not worth doing :p
<companion_cube>
I mean, if you want to replace the GC with a refcounting scheme, you're free to try, but it'll never be merged
<d_bot>
<Et7f3> No i thought of try to get value that are never used after outside gc
<d_bot>
<Et7f3> 🤦🏻i recall the name: escape analysis
<companion_cube>
that's at best a heuristic though
<companion_cube>
especially in a language so full of closures as OCaml
terrorjack has joined #ocaml
OCamlPro[m] has quit [K-Lined]
JosEduardo[m] has quit [K-Lined]
mclovin has quit [K-Lined]
smondet[m] has quit [K-Lined]
Sofi has quit [K-Lined]
CodeBitCookie[m] has quit [K-Lined]
saltrocklamp[m] has quit [K-Lined]
waleee has quit [Ping timeout: 240 seconds]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
smondet[m] has joined #ocaml
OCamlPro[m] has joined #ocaml
JosEduardo[m] has joined #ocaml
CodeBitCookie[m] has joined #ocaml
saltrocklamp[m] has joined #ocaml
Sofi has joined #ocaml
smondet[m] has quit [Quit: Client limit exceeded: 20000]
OCamlPro[m] has quit [Quit: Client limit exceeded: 20000]
CodeBitCookie[m] has quit [Quit: Client limit exceeded: 20000]
saltrocklamp[m] has quit [Quit: Client limit exceeded: 20000]
zebrag has quit [Quit: Konversation terminated!]
mbuf has joined #ocaml
Everything has joined #ocaml
<d_bot>
<darrenldl> heuristics is good enough of a solution for slightly too many people tho : D
mclovin has joined #ocaml
smondet[m] has joined #ocaml
OCamlPro[m] has joined #ocaml
saltrocklamp[m] has joined #ocaml
CodeBitCookie[m] has joined #ocaml
ouestbillie has joined #ocaml
gravicappa has joined #ocaml
Everything has quit [Quit: leaving]
ouestbillie has quit [Ping timeout: 245 seconds]
dalek-caan has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Serpent7776 has joined #ocaml
jlrnick has joined #ocaml
wyrd has quit [Ping timeout: 276 seconds]
Tuplanolla has joined #ocaml
jlrnick has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
<d_bot>
<glennsl> You could also use `Gc.finalize`? Or are there significant caveats to that?
humasect has joined #ocaml
hackinghorn has quit [Read error: Connection reset by peer]
hackinghorn has joined #ocaml
<sadiq>
there's no guarantee when that is going to be called
bartholin has joined #ocaml
<d_bot>
<glennsl> For anything beyond the simple cases where you can use a higher level abstraction such as what @companion_cube suggests, it seems we're beyond the ability to provide guarantees anyway.
<d_bot>
<glennsl> Unless linear types are implemented.
mro has joined #ocaml
<d_bot>
<Sliver> I don't understand why the REPL terminal couldn't be open when i execute Ocaml Code. Someone can help me ?
ralu has quit [Read error: Connection reset by peer]
ralu5 is now known as ralu
mro has quit [Quit: Leaving...]
mbuf has quit [Quit: Leaving]
bartholin has quit [Ping timeout: 250 seconds]
bartholin has joined #ocaml
humasect has quit [Remote host closed the connection]
humasect has joined #ocaml
perrierjouet has joined #ocaml
rgrinberg has joined #ocaml
shawnw has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Anarchos has joined #ocaml
<d_bot>
<goga03_> Hello, i am trying to create switch with opam for ocaml in vscode here are the errors. i tried updating opam but there is nothing changed, if someone knows what is the problem or what i should do, please hep me
<d_bot>
<Alistair> Using WSL means you could use the Linux installation, in my experience it’s much better than attempting to install on windows
<d_bot>
<goga03_> oohh god i reinstalled ocaml and it works now. thank you guys for ur attention
<d_bot>
<goga03_> yeah i know linux is better for this kind of activity but i am using my laptop for university and because i have no experience with linux i cant install it right now
<d_bot>
<NULL> Enabling WSL and installing an instance is easy
gravicappa has quit [Ping timeout: 250 seconds]
bartholin has quit [Ping timeout: 250 seconds]
bartholin has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
olle has quit [Ping timeout: 240 seconds]
<d_bot>
<Sliver> Hello, i'm trying to execute OCaml code on VSC but the terminal coudn't be open , if someone knows what is the problem or what i should do, please help me
<d_bot>
<Butanium (@me on answer)> If you need an ide asap you can use this online (altough it's more comfy with vscode working) https://betterocaml.ml/?version=4.13.1
<d_bot>
<Butanium (@me on answer)> also you could use utop in a vscode terminal and simply use
<d_bot>
<Butanium (@me on answer)> ```ocaml
<d_bot>
<Butanium (@me on answer)> #use yourFile.ml
<d_bot>
<Butanium (@me on answer)> ```
<d_bot>
<Butanium (@me on answer)> in utop
<d_bot>
<Butanium (@me on answer)> you could also use dune if you want a project with different files and compilation
dalek-caan has quit [Quit: dalek-caan]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]