Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
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
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
<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 ?
<d_bot> <Et7f3> open a terminal directly and launch the executable
bobo_ has quit [Ping timeout: 240 seconds]
bobo_ has joined #ocaml
<d_bot> <Et7f3> it might show you more detail on failure
mro has quit [Remote host closed the connection]
perrierjouet has joined #ocaml
<d_bot> <Sliver> The terminal shown me "cannot exec"
<d_bot> <Et7f3> Windows terminal like cmd.exe ?
<d_bot> <Et7f3> not terminal opened by vscode
olle has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
<d_bot> <Sliver> oh ok
perrierjouet has quit [Quit: WeeChat 3.4]
<d_bot> <Sliver> but what is the executable in your sentence before ?
bartholin has joined #ocaml
humasect has quit [Remote host closed the connection]
perrierjouet has joined #ocaml
mro has joined #ocaml
bartholin has quit [Ping timeout: 250 seconds]
mro has quit [Ping timeout: 250 seconds]
gravicappa has quit [Ping timeout: 256 seconds]
<companion_cube> @darrendl: heuristics for resource control? omg no
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #ocaml
bartholin has joined #ocaml
salkin has joined #ocaml
humasect has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4]
bartholin has quit [Ping timeout: 256 seconds]
<d_bot> <Butanium (@me on answer)> ```ocaml
<d_bot> <Butanium (@me on answer)> let rec iter_rev f = function
<d_bot> <Butanium (@me on answer)> | [] -> ()
<d_bot> <Butanium (@me on answer)> | x :: xs -> iter_rev f xs; f x
<d_bot> <Butanium (@me on answer)> ```
<d_bot> <Butanium (@me on answer)> This fonction used on a huge list made my program throw `Stack_overflow`
<d_bot> <Butanium (@me on answer)> Do you think that if I replace it by a
<d_bot> <Butanium (@me on answer)> ```ocaml
<d_bot> <Butanium (@me on answer)> List.iter f @@ List.rev very_big_list
<d_bot> <Butanium (@me on answer)> ```
<d_bot> <Butanium (@me on answer)> I'll have the same problem ?
<d_bot> <orbitz> No
<d_bot> <Butanium (@me on answer)> Since `List.rev` is tail recursive I don't think so
<d_bot> <Butanium (@me on answer)> ok thanks
<d_bot> <orbitz> Although the docs are not explicit on this
bartholin has joined #ocaml
mro 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
kaph has quit [Ping timeout: 250 seconds]
gravicappa has joined #ocaml
ralu5 has joined #ocaml
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
zebrag has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4]
bartholin has quit [Ping timeout: 260 seconds]
mclovin has quit [Quit: Bridge terminating on SIGTERM]
Sofi has quit [Quit: Bridge terminating on SIGTERM]
JosEduardo[m] has quit [Quit: Bridge terminating on SIGTERM]
saltrocklamp[m] has quit [Quit: Bridge terminating on SIGTERM]
smondet[m] has quit [Quit: Bridge terminating on SIGTERM]
CodeBitCookie[m] has quit [Quit: Bridge terminating on SIGTERM]
OCamlPro[m] has quit [Quit: Bridge terminating on SIGTERM]
mclovin has joined #ocaml
<d_bot> <Butanium (@me on answer)> The version in opam switch create is the OCaml one not the opam one
smondet[m] has joined #ocaml
OCamlPro[m] has joined #ocaml
JosEduardo[m] has joined #ocaml
saltrocklamp[m] has joined #ocaml
CodeBitCookie[m] has joined #ocaml
<d_bot> <Butanium (@me on answer)> try with 4.14.0
Sofi has joined #ocaml
<d_bot> <goga03_> it is same
<d_bot> <goga03_> list oc available compilers is empt
<d_bot> <goga03_> idk how to create or what i should do
<d_bot> <NULL> Didn't the script create a switch ?
<d_bot> <goga03_> i tried to do it but it didnt help me
<d_bot> <NULL> What does `opam switch` return ?
bartholin has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<d_bot> <NULL> The script is supposed to create a switch with `ocaml-variants.4.13.1+mingw64c`. That's what it did when I ran it yesterday
mclovin has quit [Quit: Client limit exceeded: 20000]
saltrocklamp[m] has quit [Quit: Client limit exceeded: 20000]
OCamlPro[m] has quit [Quit: Client limit exceeded: 20000]
smondet[m] has quit [Quit: Client limit exceeded: 20000]
JosEduardo[m] has quit [Quit: Client limit exceeded: 20000]
CodeBitCookie[m] has quit [Quit: Client limit exceeded: 20000]
Sofi has quit [Quit: Client limit exceeded: 20000]
<d_bot> <goga03_> do u have stepbystep tutorial for ocaml instalation on windows? it would help me a lot
<d_bot> <Butanium (@me on answer)> You can use DKML https://diskuv.gitlab.io/diskuv-ocaml/ you just have to run one script but it's ~40Go of install
<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
waleee has joined #ocaml
<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…]
ouestbillie has joined #ocaml
<d_bot> <phated> Raising this here for some extra visibility: https://discuss.ocaml.org/t/compact-unwind-on-macos/9237 - Need to figure out why *just* updating the submodule is causing this problem
ouestbillie has quit [Ping timeout: 256 seconds]
<d_bot> <Sliver> Utop cannot exec. I think i have these error (utop and terminal) because i'm not in my personal directory
<d_bot> <Butanium (@me on answer)> I'm sorry my windows install use DKML instead of cygwyn so I can't help you more :/
ouestbillie has joined #ocaml
ouestbillie has quit [Ping timeout: 250 seconds]
ouestbillie has joined #ocaml
ouestbillie has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 256 seconds]
ouestbillie has joined #ocaml
azimut_ has joined #ocaml
bartholin has joined #ocaml
azimut has quit [Ping timeout: 276 seconds]
wyrd has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 250 seconds]
bartholin has quit [Quit: Leaving]
<d_bot> <tron> inga pa ?
rgrinberg has joined #ocaml
<d_bot> <tron> chilega ocaml chat ?
<d_bot> <tron> yello ?
<d_bot> <tron> telu ki ?
<d_bot> <tron> @everyone
<d_bot> <NULL> This is an English-speaking channel, I don't understand you. Also, pinging everyone is unnecessary and probably annoyed many people
Haudegen has quit [Ping timeout: 256 seconds]