adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<companion_cube> ugh, the standard IO types 😠
olle has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
pigeonv has quit [Ping timeout: 246 seconds]
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
Anarchos has quit [Ping timeout: 256 seconds]
Anarchos has joined #ocaml
amiloradovsky has quit [Ping timeout: 244 seconds]
<HyperMonkey> can anyone elucidate what these odig errors are about? https://paste.ee/p/mNIlk are they to be expected? is there a way to fix them?
<HyperMonkey> how advisable is it to avoid Core in one part of my code (a library) and open Core in my main app? will the types clash?
<Anarchos> where can i find examples of marshalling of first-class modules ?
Hrundi_V_Bakshi has quit [Ping timeout: 240 seconds]
vicfred has quit [Ping timeout: 265 seconds]
Haudegen has quit [Ping timeout: 256 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Anarchos has joined #ocaml
hannes has quit [Ping timeout: 260 seconds]
cheater has quit [Ping timeout: 265 seconds]
vicfred has joined #ocaml
troydm has quit [Ping timeout: 256 seconds]
vicfred has quit [Client Quit]
cheater has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<rgrinberg> companion_cube we need a PR for in_channel/out_channel from pure functions :P
<companion_cube> I don't think I can find the motivation for a PR
<companion_cube> my previous one about IO stayed opened for years
dborisog has joined #ocaml
<rgrinberg> companion_cube on unrelated news, you really need to check out of dune's fiber if you appreciate minimalism
<rgrinberg> 500 lines of code to replace lwt/async :P
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ocaml
jao- has quit [Ping timeout: 265 seconds]
mfp has quit [Ping timeout: 256 seconds]
narimiran has joined #ocaml
ferd has quit [Ping timeout: 264 seconds]
mbuf has joined #ocaml
ferd has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
FreeBirdLjj has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
_whitelogger has joined #ocaml
sleepydog has quit [Ping timeout: 260 seconds]
raver has joined #ocaml
narimiran has quit [Ping timeout: 258 seconds]
jbrown has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ferd has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Ping timeout: 272 seconds]
ferd has joined #ocaml
ferd has quit [Ping timeout: 260 seconds]
ferd has joined #ocaml
dborisog has quit [Ping timeout: 246 seconds]
sugarwren has joined #ocaml
pigeonv has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mfp has joined #ocaml
pigeonv has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
cheater has quit [Ping timeout: 265 seconds]
cheater has joined #ocaml
sagax has quit [Remote host closed the connection]
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
kaun_ has joined #ocaml
Haudegen has joined #ocaml
khady[m] has joined #ocaml
khady[m] has joined #ocaml
khady[m] has quit [Changing host]
khady[m] has quit [Changing host]
khady[m] has quit [Quit: authenticating]
khady[m] has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
kaun_ has quit [Ping timeout: 256 seconds]
kaun_ has joined #ocaml
sz0 has joined #ocaml
troydm has joined #ocaml
pigeonv has joined #ocaml
kaun_ has left #ocaml ["chalo"]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
sagax has joined #ocaml
hannes has joined #ocaml
narimiran has joined #ocaml
waleee-cl has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
sleepydog has joined #ocaml
<zozozo> what would the best way to print an integer in binary form (printf has support for hexadecimal but not binary as far as I can tell) ?
<companion_cube> rgrinberg: ah cool
<companion_cube> does that include support for IO?
<Armael> zozozo: write your own recursive function
<Armael> I think
<zozozo> yeah that's what I've just done
<zozozo> I also have the same function but operating on decimal umber sin strings (so that it can support arbitrarily long numbers)
ferd has quit [Ping timeout: 240 seconds]
ferd has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Client Quit]
Anarchos has joined #ocaml
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
amiloradovsky has joined #ocaml
gareppa has joined #ocaml
<narimiran> zozozo: heh, i had the same question couple of months ago; i thought i missed the binary support, but surprisingly (to me at least), it really isn't there
gareppa has quit [Remote host closed the connection]
<Anarchos> i experienced troubles with marshalling first class modules (as values) and read them back. Who can help me ?
FreeBirdLjj has joined #ocaml
inkbottle has quit [Ping timeout: 246 seconds]
inkbottle has joined #ocaml
<zozozo> well, if your first class modules contain functions (which is likely), that would most likely explain things I suppose
FreeBirdLjj has quit [Ping timeout: 256 seconds]
<Anarchos> zozozo i get 'input_value : unknown code module'
<zozozo> Anarchos: do your first class module contain functions/closurs ?
mbuf has quit [Quit: Leaving]
<Anarchos> let me look
<Anarchos> yes
<Anarchos> zozozo i had troubles to design my code, i just found solutions with first class module
<zozozo> ok, so I suppose you use the Marshall.Closures flag to marshall tings; in what situation is the error happening ?
<Anarchos> zozozo yes i put the flag
<HyperMonkey> I just learned out you can do `let f ((a,b):(int*int)) = (a+b);;` and save a match ... nice
<Anarchos> the code resides in a server. When i marshall out/ read in, it works. If i shut the server before reading, it crashes
<zozozo> (also, did you read all the Marshall module documentation about the potential pitfalls of closure marshalling, concerning processes, references, and so on ?)
<zozozo> HyperMonkey: yes, you can do that for function arguments, and also let-bindings (e.g. let (a, b) = some_fun_call ... in ...)
<Anarchos> zozozo yes i did, but as i said, i don't know how to organize my code without those first class modules
<zozozo> Anarchos: so basically, you have an ocaml compiled server, you use it to marshall a first class module, end the process, re-start the server, and try and read back the marshalled data, right ? what's the exact erorr/exception that occurs then ?
<Anarchos> zozozo yes this is this situtation. Error is «input_value: unknown code module 044400C5415D7FB7BB58C66D3A8EE4B7»
<zozozo> but is that an exception ? juste some message printed on stderr before the runtime exits ?
tane has joined #ocaml
<Anarchos> an exception i catched
<zozozo> and what's the exception exactly ?
<Anarchos> zozozo i think it is a Failure
<Anarchos> zozozo i wanted to store sessions, like in Coq
<Anarchos> with their vo files
<zozozo> right, but to do that you should really make sure that what you want to store/marshall is pure (i.e. no references, no exceptions, no closures, no objects, etc...)
<Anarchos> zozozo ok.
<Anarchos> i wonder why it can't work just in restarting the server ?
<zozozo> because if it uses some mutable state, then all hell breaks loose (because when un marshalling it will un marshall the marshallec opy of the mutable state used)
<Anarchos> so they use this hash code ?
<zozozo> well marhsalling functoins/closures need to marshall the code pointer (among other things), which is tricky
<Anarchos> zozozo but there is this tag Closures, and the documentaiton says that first class modules are marshallable as others values
<Anarchos> so i don't understand this error, especially that if i don't shut the server, it works
<zozozo> well, I don't know how/if marshalling closures can work if the code is relocatable (or address space is randomized)
<Anarchos> zozozo i will try to remove the functions of my Session module
cheater has quit [Ping timeout: 246 seconds]
Hrundi_V_Bakshi has joined #ocaml
sugarwren has quit [Ping timeout: 260 seconds]
Hrundi_V_Bakshi has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
sleepydog has quit [Ping timeout: 260 seconds]
remexre has joined #ocaml
<remexre> is a dependency cycle like a.ml -> b.mli -> a.mli allowed w/ dune?
<remexre> (rather, are mysterious typechecking errors I get because of the cycle or something else)
<pigeonv> interfaces are compiled first
<remexre> hm, okay; does "Foo.Bar.t is abstract because no corresponding cmi file was found in path" indicate I have dune set up to compile it wrong, then?
<Armael> you cannot have dependency cycles
<remexre> unfortunate; okay
<remexre> is there a super-hard problem I'm not thinking of in supporting cycles between modules that have .mli files, or is it "just" not implemented?
narimiran has quit [Quit: leaving]
<dash> make b take a as a parameter?
andreas303 has quit [Write error: Connection reset by peer]
andreas303 has joined #ocaml
<remexre> eh, like make b a functor? I'd rather not
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
sleepydog has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
jao has joined #ocaml
<HyperMonkey> when #use ing my file in the ocaml toplevel I get "Error: Unbound module Core". how do I launch ocaml "with libraries"?
<HyperMonkey> online I can find instructions for utop but not for plain old ocaml
<zozozo> something like #require I think ?
<HyperMonkey> unknown directive require
<HyperMonkey> looks like I should be trying to upgrade to utop
<zozozo> the I'd think it will be very annoying: you'd need to #directory the relevant directories for Core (probably by calling ocamlfind to find where those are)
<zozozo> so either use utop (or even coretop I think was shipped with core at one point ?)
<Fardale> I think it is somitheng like: ocaml -I path/to/module and #load "core.cma"
<Fardale> for unix, it work if you use: #load "unix.cma"
<pigeonv> #use "topfind";; #require "core";;
tane has quit [Quit: Leaving]
<HyperMonkey> during #require "core";; I get: `Error: Reference to undefined global `Condition'`
<HyperMonkey> it seems to "almost work" though
<HyperMonkey> ah it works now. one has to do `#threads;;` also
Hrundi_V_Bakshi has quit [Ping timeout: 256 seconds]
<HyperMonkey> well now I need to enable interpretation of `let%bind` in ocaml toplevel
<HyperMonkey> ah there is `-ppx` option .. let's see if that works
cheater has joined #ocaml
<HyperMonkey> https://paste.ee/p/mIwQz well now I ended up with some kind of type fork .. I used `#mod_use` to include my modules from a toplevel file and piped the toplevel file into ocaml
jao has quit [Remote host closed the connection]
<HyperMonkey> I tweaked the file order and it works now .. no idea why though the files I flipped were not dependent on eachother
kvda has joined #ocaml
jao has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 272 seconds]
vicfred has joined #ocaml
vicfred_ has joined #ocaml
vicfred_ has quit [Client Quit]
vicfred has quit [Ping timeout: 272 seconds]
vicfred_ has joined #ocaml
kvda has joined #ocaml