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
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
zebrag has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
zebrag has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 246 seconds]
White_Flame has quit [Ping timeout: 250 seconds]
White_Flame has joined #ocaml
narimiran has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
Tuplanolla has joined #ocaml
yomimono has quit [Ping timeout: 252 seconds]
Serpent7776 has joined #ocaml
narimiran has quit [Ping timeout: 246 seconds]
wonko7 has joined #ocaml
narimiran has joined #ocaml
madroach has quit [Quit: leaving]
hackinghorn has joined #ocaml
Meh has joined #ocaml
Meh is now known as Guest53521
Guest53521 has quit [Client Quit]
Nobita has joined #ocaml
Nobita has quit [Client Quit]
user290 has joined #ocaml
<user290> does anyone here knows Jacques Le Normand?
wonko7 has quit [Ping timeout: 268 seconds]
narimiran has quit [Ping timeout: 252 seconds]
mro_name has joined #ocaml
mro_name has quit [Remote host closed the connection]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 240 seconds]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 250 seconds]
bartholin has joined #ocaml
mro_name has joined #ocaml
neiluj has quit [Quit: leaving]
bparodi has joined #ocaml
user290 has quit [Ping timeout: 260 seconds]
mro_name has quit [Ping timeout: 276 seconds]
mro_name has joined #ocaml
pagnol has joined #ocaml
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
mfp has joined #ocaml
Haudegen has joined #ocaml
Anarchos has joined #ocaml
<Anarchos> hi
<bparodi> hi
narimiran has joined #ocaml
mro_name has quit [Remote host closed the connection]
mro_name has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Anarchos has joined #ocaml
mro_name has quit [Ping timeout: 240 seconds]
<Anarchos> Has «Modern compiler implementation in ML» been translated to Ocaml ?
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 250 seconds]
pagnol has quit [Ping timeout: 246 seconds]
waleee-cl has joined #ocaml
mro_name has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
mro_name has quit [Ping timeout: 245 seconds]
user290 has joined #ocaml
bparodi has quit [Ping timeout: 240 seconds]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 246 seconds]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 260 seconds]
<d_bot> <Et7f3> Don't think so but it can be converted easily concept are mostly the same just a bit of syntax differences.
olle has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
olle has joined #ocaml
mro_name has joined #ocaml
neiluj has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
mro_name has quit [Ping timeout: 276 seconds]
olle has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
TheLemonMan has joined #ocaml
mro_name has joined #ocaml
<sim642> For what possible reason could dune get stuck using 100% CPU on a single core and eating up memory without any ocaml processes actually running?
user290 has quit [Quit: Leaving]
<Armael> mmm could be scanning the filesystem if you have very large files in your dune workspace
<sim642> That's not it, normally this doesn't happen but I made some code changes and now I cannot even build the project...
mro_name has quit [Ping timeout: 250 seconds]
<d_bot> <Et7f3> Is it with watch mode ? do you try to build many target, try to build one by one ? (I would suggest to copy all this folder in new place and try to remove file until it is able to build might be useful in case of bug inside dune)
<d_bot> <Et7f3> did you try after dune clean ?
<sim642> This is weird, just by replacing a "f1.vid = f2.vid" with "CilType.Varinfo.equal f1 f2" it's somehow causing dune to not terminate
<sim642> With --verbose I see that the last thing it runs is ocamldep.opt, but when it's stuck, then no ocamldep is running anymore and that small change is causing the .ml.d file to list an extra dependency on CilType
mro_name has joined #ocaml
<sim642> I'm gonna upgrade dune from the 2.8.1 I had to 2.8.5 and see if that maybe already fixes it
mro_name has quit [Ping timeout: 240 seconds]
olle has joined #ocaml
<sim642> Wow, it actually did fix the problem, now dune immediately reports a dependency cycle
<sim642> Did not expect a dependency cycle going undetected in the old version
<Armael> ah yea I heard that there was a bug there that got fixed recently
mro_name has joined #ocaml
Anarchos has joined #ocaml
mro_name has quit [Ping timeout: 260 seconds]
kakadu has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
wonko7 has joined #ocaml
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 245 seconds]
test has joined #ocaml
test is now known as Guest23965
Anarchos has quit [Read error: Connection reset by peer]
Anarchos has joined #ocaml
Guest23965 has quit [Read error: Connection reset by peer]
mro_name has joined #ocaml
boxscape has joined #ocaml
mro_name has quit [Ping timeout: 245 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
Anarchos has quit [Read error: Connection reset by peer]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 246 seconds]
<steenuil> huh, I'd never seen this syntax before
<steenuil> `val open_in: ?compress:[<`Plain|`Gzip|`Bzip2|`Guess>`Guess] -> string -> t_in`
<Fardale> Which part of this syntax?
<steenuil> the >`Guess part specifically
nullcone has joined #ocaml
<steenuil> also I used backticks but I just realized it's still gonna look messed up for discord users
manicennui has joined #ocaml
<steenuil> I think it's for specifying the default value that is used if the ~compress label is omitted?
<companion_cube> hmm it means "at least Guess"
<companion_cube> at most Plain|Gzip|Bzip2|Guess, at least Guess
mro_name has joined #ocaml
<steenuil> the manual defines the syntax but doesn't say anything about it
<companion_cube> it's a subtyping predicate
<companion_cube> you type is a supertype of [`Guess]
User4321 has joined #ocaml
<steenuil> so if I had a value of type `A and the function required [<`A | `B | `C >`A | `B] it would be rejected?
mro_name has quit [Ping timeout: 252 seconds]
<User4321> Hello everyone. I am a complete beginner in OCaml. I have an error with parentheses when calling a function I think.
<steenuil> seems like you can only specify a single label
<User4321> I've built a small interpreter for Arithmetic expressions and Boolean expressions. Now I want to use all that to evaluate simple imperative programs.
<steenuil> ah, I get it
<User4321> The faulty line is #69
<User4321> Thank you in advance.
<steenuil> let f (v: [<`A|`B|`C>`C]) = ignore v;; let x: [`A|`B] = `A;;
<steenuil> f x;; is a type error
<kakadu> User4321: You may try to add parenthesis around `Sequence(cmd Loop(test cmd))`
<User4321> @kakadu OK, I will try that and keep you informed. Thank you for your help/
<companion_cube> steenuil: yes, it would be rejected
<User4321> @kakadu now it says that Sequence expects 2 arguments (of course) but only one is given. I give cmd (the first command of the sequence) and Loop(test cmd) as the second one...
<kakadu> User4321: You forgot a comma between cmd and Loop
<User4321> I'll check
<kakadu> constructor arguments should be separated by comma
<companion_cube> oh hi kakadu
<User4321> hi, companion_cube :)
<kakadu> User4321: In general you should try to edit in decent editor (VsCode) with autoformatter (ocamlformat) enabled, it helps to sort out issues like this
<kakadu> companion_cube: o/
<kakadu> I'll abswer your main in the evening
<kakadu> answer*
<kakadu> mail*
<kakadu> TT
<User4321> @kakadu OK, it seems fine, I'll try to run my code to evaluate a small program now
Anarchos has joined #ocaml
<companion_cube> sure, no worries
olle has quit [Ping timeout: 252 seconds]
Anarchos has quit [Client Quit]
<User4321> it just WORKS!!!! ;) (sorry :p)
<kakadu> Successful compilation implies expected behaviour? Welcome to our world!
<User4321> ;)
<User4321> I will try with some more complex program through. But it's so painful to write the commands...
<kakadu> You can try to cheat with creating smart constructors and putting them into module
<kakadu> like `module Ops = struct let (<) a b = LessThan (a,b) ... end`
<kakadu> @User4321
<User4321> I have integer division algorithm to implement like that ;) I think I am not advanced enough to cheat. I'll do it by hand
<kakadu> No, pal, I think you are :)
* kakadu remember how he jumpped to OCaml from Java to stop feeling the pain
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 246 seconds]
bartholin has quit [Quit: Leaving]
wonko7 has quit [Ping timeout: 246 seconds]
wonko7 has joined #ocaml
User4321 has quit [Quit: Connection closed]
waleee-cl has joined #ocaml
tomku has quit [Ping timeout: 245 seconds]
tomku has joined #ocaml
<d_bot> <EduardoRFS> There is any way to ensure linearity in OCaml even in presence of references with existentional types?
<d_bot> <RegularSpatula> Are there any sort of "rules" or suggestions for formatting doc comments? I'm using ocamlformat, but it doesn't really have an effect on the doc comments. I think these look nice (https://github.com/aantron/dream/blob/master/src/dream.mli) ...they look to me as though it's using the `fill-paragraph` in Emacs within each doc comment. Any suggestions?
<companion_cube> @EduardoRFS: I don't think there's any way to enforce linearity
<d_bot> <EduardoRFS> sad, would be really cool to have a type that cannot be assigned to a reference
mro_name has joined #ocaml
<companion_cube> it's not just references, it's also any form of mutable field :)
<d_bot> <Anurag> There is an ocamlformat option that'll get it to parse and format docstrings. Add `parse-docstrings = true`to your `.ocamlformat` file.
<d_bot> <antron> i'm just manually formatting comments so that they don't cross the 80-column mark
mro_name has quit [Ping timeout: 240 seconds]
<d_bot> <EduardoRFS> I know, using references because it's the straightforward, but records are also a problem. I don't have a solution for this, just wondering if any trick would allow to block this
<d_bot> <RegularSpatula> Ohh wow thank you...I was using the `customize-group` in emacs to manage the ocamlformat (and it didn't have that option) so I didn't event think to check the options of the actual command itself.
boxscape has quit [Ping timeout: 265 seconds]
<d_bot> <craigfe> There is also the `wrap-comments` option for regular, non documentation, comments
Anarchos has joined #ocaml
vicfred has joined #ocaml
mro_name has joined #ocaml
boxscape has joined #ocaml
mro_name has quit [Ping timeout: 260 seconds]
mro_name has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
White_Flame has quit [Ping timeout: 250 seconds]
White_Flame has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
manicennui has left #ocaml [#ocaml]
olle has joined #ocaml
olle has quit [Ping timeout: 268 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<d_bot> <Butanium> I want to do a monte-carlo tree search for the last codingame contest
<d_bot> <Butanium> so I'd have a tree and each node would be Nil | Gamestate
<d_bot> <Butanium> I have to store the score and sun of both player
<d_bot> <Butanium> and also the board
wonko7 has quit [Ping timeout: 246 seconds]
<d_bot> <Butanium> I have 100 ms each turn to submit an action so I want to have the most optimized search possible
<d_bot> <Butanium> do you think that I should use an only array of mutable cell which would contains the information about a tree if there is one
<d_bot> <Butanium> and editing it every time I advance / go back in my game tree
<d_bot> <Butanium> or should I store a different Hashtbl containing all the trees every on every node ?
Amaan has quit [*.net *.split]
metadave has quit [*.net *.split]
caasih has quit [*.net *.split]
haesbaert has quit [*.net *.split]
qwr has quit [*.net *.split]
steenuil has quit [*.net *.split]
greenbagels has quit [*.net *.split]
sadiq has quit [*.net *.split]
qwr has joined #ocaml
haesbaert has joined #ocaml
sadiq has joined #ocaml
metadave has joined #ocaml
steenuil has joined #ocaml
Amaan has joined #ocaml
caasih has joined #ocaml
greenbagels has joined #ocaml
<d_bot> <Chum> why are type safe languages like Java nd OCaml are not subject to buffer overflows ?
<companion_cube> because they check bounds on buffers
<d_bot> <anmonteiro> I think it's more about memory safety rather than type safety, though it helps
<d_bot> <anmonteiro> Java is not that "type safe"
<d_bot> <undu> you mean allowing all objects to be nullable?
narimiran has quit [Ping timeout: 246 seconds]
<companion_cube> no, you can also get a variable with the wrong type inside
<companion_cube> for example because arrays are covariant
Anarchos has joined #ocaml
mro_name has quit [Ping timeout: 260 seconds]
<dh`> it's important to distinguish "buffer overflow" in the security vulnerability sense from "buffer overflow" in the sense of "oops we got too much data and spilled some of it on the floor"
<dh`> the latter is what "overflow" conditions normally mean and some people use "overrun" for the vulnerability because of this (but it's a lost cause)
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<companion_cube> dh`: what's the difference, beyond silent exploit vs bound checking?
<d_bot> <Butanium> ```ocaml
<d_bot> <Butanium> exception End;;
<d_bot> <Butanium> type mtcNode = ROOT | N of {mutable win : int; mutable lose : int; action : action; game : gameState; mutable father : mtcNode;
<d_bot> <Butanium> mutable unexplored : action list; mutable sons : mtcNode list} | NIL;;
<d_bot> <Butanium> let expend = function
<d_bot> <Butanium> | N r -> (match r.unexplored with | [] -> raise End | x :: xs -> r.unexplored <- xs; r.sons <- (foo x) :: r.sons)
<d_bot> <Butanium> | _ -> raise End
<d_bot> <Butanium> ;;
<d_bot> <Butanium> ```
<d_bot> <Butanium> Is the fact that I use mutable field for list a good practice ?
<companion_cube> I mean there's a lot of mutable in there
<companion_cube> but if it suits you…
Serpent7776 has quit [Quit: leaving]
<hackinghorn> hi, is the boolean negation "not" in ocaml?
<hackinghorn> I have a hard time finding out what is the usual boolean negation is from https://ocaml.org/manual/expr.html
<companion_cube> yep
<hackinghorn> wah, I can even do "|> not". is it usual?
<hackinghorn> the manual has nothing on this
<hackinghorn> they are like, yeah, conjunction is &&, disjunction is ||, noone knows what negation is
Tuplanolla has quit [Quit: Leaving.]
outerpassage has quit [Quit: quitting]
outerpassage has joined #ocaml
<hackinghorn> companion_cube, is it normal to write "|> not" since "not ()" requires extra brackets
jbrown has quit [Ping timeout: 260 seconds]
jbrown has joined #ocaml
pouellet has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
mfp has quit [Ping timeout: 252 seconds]