adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
spew has joined #ocaml
spew has quit [Read error: Connection reset by peer]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 has quit [Killed (livingstone.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
kakadu has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 240 seconds]
gtrak_1 has quit [Remote host closed the connection]
gtrak has joined #ocaml
pierpal has joined #ocaml
silver has quit [Read error: Connection reset by peer]
letoh has quit [Ping timeout: 240 seconds]
flodin_ has joined #ocaml
flodin has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 240 seconds]
sh0t has quit [Remote host closed the connection]
cbot has joined #ocaml
Enjolras has quit [Quit: leaving]
pzp has quit [Quit: Connection closed for inactivity]
shinnya has joined #ocaml
Enjolras has joined #ocaml
letoh has joined #ocaml
shinnya has quit [Quit: ZNC - http://znc.in]
jao has quit [Remote host closed the connection]
shinnya has joined #ocaml
jimmyrcom has quit [Ping timeout: 260 seconds]
microt has joined #ocaml
microt has quit [Client Quit]
jimmyrcom has joined #ocaml
pierpa has quit [Quit: Page closed]
kark has joined #ocaml
flodin_ has quit [Remote host closed the connection]
flodin_ has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
flodin has joined #ocaml
flodin_ has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
mbuf has joined #ocaml
cbot has quit [Quit: Leaving]
muelleme has joined #ocaml
zolk3ri has joined #ocaml
zpe has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
zpe has joined #ocaml
<keep_learning> Hi Everyone, Whenever I am trying to install any new library using opam install I am getting this error
<keep_learning> Fatal error:
<keep_learning> Sys_error("/home/users/u5935541/.opam/repo/default/packages/vchan/vchan.1.0.0/descr: Permission denied")
cuicui has joined #ocaml
baroud has joined #ocaml
baroud has quit [Ping timeout: 256 seconds]
<steenuil> you're probably logged into a different user that doesn't have permissions to that
<keep_learning> steenuil Thank you very much.
AltGr has joined #ocaml
mfp has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
cuicui has quit [Read error: Connection reset by peer]
cuicui has joined #ocaml
argent_smith has joined #ocaml
gtrak has quit [Ping timeout: 256 seconds]
gtrak has joined #ocaml
gareppa has quit [Quit: Leaving]
freyr has joined #ocaml
gareppa has joined #ocaml
ShalokShalom has joined #ocaml
<ShalokShalom> what does that || here mean: https://ocaml.org/
<ShalokShalom> hi there :)
<Armael> it's the "or" operator
<Fardale> ShalokShalom: it's the or infix operator
TarVanimelde has joined #ocaml
dedgrant has quit [Read error: Connection reset by peer]
dedgrant has joined #ocaml
<ShalokShalom> why two times?
gareppa has quit [Quit: Leaving]
<steenuil> it's just a convention, || is for boolean or and | is for bitwise or
ziyourenxiang has joined #ocaml
<Armael> What, no, not in ocaml
<steenuil> well usually it's like that
<Armael> Bitwise or is "lor", | is used for pattern matching
baroud has joined #ocaml
baroud has quit [Client Quit]
baroud has joined #ocaml
baroud has quit [Client Quit]
ziyourenxiang has quit [Ping timeout: 245 seconds]
baroud has joined #ocaml
tarptaeya has joined #ocaml
TarVanimelde has quit [Quit: TarVanimelde]
TarVanimelde has joined #ocaml
TarVanimelde has quit [Ping timeout: 256 seconds]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
baroud has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
jack5638 has quit [Ping timeout: 276 seconds]
jack5638 has joined #ocaml
jimmyrcom has quit [Read error: Connection reset by peer]
jimmyrcom has joined #ocaml
jimmyrcom has quit [Max SendQ exceeded]
jimmyrcom has joined #ocaml
Haudegen has quit [Remote host closed the connection]
gareppa has joined #ocaml
pierpal has joined #ocaml
tarptaeya has quit [Ping timeout: 260 seconds]
<ShalokShalom> Armael: So can I simply use one for all?
BitPuffin has joined #ocaml
<ShalokShalom> Is | the same as || for the compiler?
<Armael> no
<Armael> | is part of the "match .. with" syntax (and also "function ..")
<Armael> || is the infix "or" operator
<ShalokShalom> aha
<ShalokShalom> ok, fine
pierpal has quit [Read error: Connection reset by peer]
ShalokShalom2 has joined #ocaml
ShalokShalom has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
jbrown has joined #ocaml
kakadu has joined #ocaml
sh0t has joined #ocaml
al-damiri has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
baroud has joined #ocaml
jack5638 has joined #ocaml
gareppa has quit [Quit: Leaving]
pierpal has joined #ocaml
mbuf has quit [Quit: Leaving]
baroud` has joined #ocaml
baroud has quit [Ping timeout: 268 seconds]
<ShalokShalom2> how to escape from the ocaml repl?
moolc has joined #ocaml
<M-ErkkiSeppl> send eof by entering ctrl-d
<ShalokShalom2> ah, d
<ShalokShalom2> i send c
<ShalokShalom2> thy
opios has joined #ocaml
opios has quit [Changing host]
opios has joined #ocaml
opios has joined #ocaml
opios has quit [Changing host]
opios has joined #ocaml
opios has joined #ocaml
opios has quit [Excess Flood]
opi0s has joined #ocaml
opi0s is now known as opios
opios has quit [Changing host]
opios has joined #ocaml
pierpal has quit [Ping timeout: 260 seconds]
sh0t has quit [Ping timeout: 260 seconds]
zpe has quit [Read error: Connection reset by peer]
gpietro has joined #ocaml
zpe has joined #ocaml
pierpal has joined #ocaml
gpietro has quit [Remote host closed the connection]
moolc has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
ShalokShalom2 has quit [Quit: Konversation terminated!]
_andre has joined #ocaml
raphinou has joined #ocaml
raphinou has quit [Client Quit]
raphinou has joined #ocaml
gtrak has quit [Ping timeout: 255 seconds]
Haudegen has quit [Remote host closed the connection]
gtrak has joined #ocaml
Haudegen has joined #ocaml
sh0t has joined #ocaml
ygrek has joined #ocaml
pierpal has quit [Ping timeout: 255 seconds]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
jmiven has quit [Quit: co'o]
jmiven has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
dario9 has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
<dario9> I have a couple of questions for the Dune gurus in the audience: 1) Module src/main.ml uses the ppx_blob extension to include a file res/alpha.txt. How do I tell Dune that alpha.txt should be copied to the build directory before attempting to compile main.ml? 2) Where does the oxygen in the atmosphere of Arrakis come from, since there's no plant life?
baroud` has quit [Remote host closed the connection]
baroud has joined #ocaml
cross has quit [Remote host closed the connection]
silver has joined #ocaml
spew has joined #ocaml
jao has joined #ocaml
moolc has joined #ocaml
zpe has quit [Remote host closed the connection]
<steenuil> dario9, for 1) you need the preprocessor_deps stanza
<steenuil> as for the second, unfortunately I haven't read Dune yet
<dario9> steenuil: Thanks for the reply. So, I placed the alpha.txt file in the src directory and added the line "(preprocessor_deps (file alpha.txt))" to src/jbuild, but I get the following errors: "No rule found for src/alpha.txt", and "No rule found for src/file".
<steenuil> the path of the file is relative to the location of the jbuild file
<steenuil> so if the jbuild file is in src/ and the file in res/ it should be (file ../res/alpha.txt)
baroud has quit [Remote host closed the connection]
<companion_cube> dario9: I think oxygen can be produced by bacteria, too? :)
<companion_cube> or the desert could have been a forest a long time ago
baroud has joined #ocaml
<octachron> If I remember correctly, sandworms are supposed to produce oxygen somehow
* Drup notes to name the interface between dune and ocsigen as a miss-spell of "sandworm"
<dario9> companion_cube: Yeah, on Earth cyanobacteria are photosynthetic. But who knows about Arrakis...
<theblatt1> "no plant life" << that's what the fremen want you to believe!
<dario9> steenuil: I have copied alpha.txt into the src directory to avoid the path problem. The error is "No rule found for src/file".
moolc has left #ocaml ["ERC (IRC client for Emacs 27.0.50)"]
<steenuil> uhhh, are you sure you didn't write the filename wrong
<steenuil> oh wait, I think you need another set of parenthesis around that
shinnya has quit [Ping timeout: 268 seconds]
<steenuil> like (preprocessor_deps ((file alpha.txt)))
<dario9> steenuil: That was it! There's an extra set of parentheses needed...
<dario9> Dune is pretty good and all, but I'm still not particularly convinced by the S-expression syntax for the jbuild files.
<dario9> Anyway, thanks for your help steenuil! ;-)
<steenuil> you're welcome!
<steenuil> I don't mind the s-expressions but yeah, those extra parenthesis around lists of pairs are kind of jarring
<steenuil> I forget them all the time
FreeBirdLjj has joined #ocaml
<steenuil> ...though I ended up doing the same for a tool I wrote that used sexplib. can't be helped
baroud has quit [Remote host closed the connection]
spew has quit []
zolk3ri has quit [Ping timeout: 256 seconds]
shakalaka has quit [Quit: bye.]
zolk3ri has joined #ocaml
shakalaka has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
jimmyrcom has quit [Ping timeout: 240 seconds]
cuicui has quit [Quit: leaving]
jimmyrcom_ has quit [Ping timeout: 255 seconds]
barcabuona has quit [Ping timeout: 276 seconds]
jimmyrcom_ has joined #ocaml
muelleme has joined #ocaml
freyr has quit [Remote host closed the connection]
barcabuona has joined #ocaml
dtornabene has joined #ocaml
jimmyrcom has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
jimmyrcom_ has quit [Ping timeout: 240 seconds]
jimmyrcom has quit [Ping timeout: 264 seconds]
jimmyrcom_ has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
tane has joined #ocaml
dtornabene has quit [Remote host closed the connection]
dtornabene has joined #ocaml
muelleme has quit [Ping timeout: 264 seconds]
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
jnavila has joined #ocaml
<kakadu> Folks, Why Foo has tuple argument and not a list of size two? https://paste.in.ua/3289/raw/ https://github.com/ocaml/ocaml/blob/4.06.1/parsing/parsetree.mli#L145
<kakadu> Ah, It's probably about &
<mrvn> lists have no size in the type system
<octachron> kakadu, did you see my copy-editing PR?
<kakadu> no
<kakadu> mrvn: I understood my issue. I just haven't meet a code with ampersands in the types
<kakadu> It's very bad that github doesn't email me about new PRs.
<kakadu> octachron: Are you sure that `dual heaps` is the right word? I haven't seen this word the writing about GCs
pf has joined #ocaml
<octachron> There may be a better (aka more specific) word
dario9 has quit [Quit: Konversation terminated!]
zolk3ri has quit [Quit: Lost terminal]
jnavila has quit [Ping timeout: 240 seconds]
pierpal has quit [Ping timeout: 240 seconds]
dtornabene has quit [Quit: Leaving]
Anarchos has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
cross has joined #ocaml
govg has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
gareppa has joined #ocaml
muelleme has joined #ocaml
muelleme has quit [Ping timeout: 265 seconds]
kakadu has quit [Quit: Konversation terminated!]
shakalaka has quit [Quit: bye.]
shakalaka has joined #ocaml
pf has quit [Quit: Page closed]
tarptaeya has joined #ocaml
zpe has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
<mrvn> kark: generational?
raphinou has quit [Quit: WeeChat 1.9.1]
gareppa has quit [Quit: Leaving]
jack5638 has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
isd has joined #ocaml
muelleme has joined #ocaml
jack5638 has joined #ocaml
pierpal has quit [Ping timeout: 265 seconds]
tane has quit [Quit: Leaving]
mathsm has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.2]: i've been blurred!]
muelleme has quit [Ping timeout: 240 seconds]
<mathsm> Hi! I'm trying to interface C and OCaml to call some caml from C. I can get it to work with https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec458 and ocamlopt -output-complete-obj, now I'm trying to automatize library finding and dependencies with jbuilder but either it build a shared .so and I need to LD_LIBRARY_PATH to use it or it outputs an .o file but without the runtime library... Any pointer?
lucasem has joined #ocaml
<mrvn> you can link the runtime .a file
<def`> mathsm: have you tried manually linking libasmrun.a?
argent_smith has quit [Quit: Leaving.]
<mrvn> Why is there no Bigarray.Array1.msync, madvice and mincore?
<mrvn> and Bigarray.Array1.barrier
<mrvn> *sigh*
<mathsm> date
<mathsm> Sorry. So, something like ar rsv libqsmrun.a [...]? But I also need to add unix.a and I can't manage to do it all at once.
<mrvn> mathsm: no, something like gcc -o exe bla.o ocaml.o libasmrun.a
<mathsm> Oh, thanks, will try.
jnavila has joined #ocaml
pierpa has joined #ocaml
gareppa has joined #ocaml
tarptaeya has quit [Remote host closed the connection]
muelleme has joined #ocaml
<wickedshell> What would the recommended way of reading/writing a binary stream in OCaml be? I'm looking at the need to parse/encode streams that use most standard c types, and I don't see what the normal way to do this in OCaml is. (I found parsifal, but I don't see how to use that to encode again)
jnavila has quit [Remote host closed the connection]
<mathsm> Still can't get it to run. Jbuild makes an (.o) object file, ocamlc another one for the wraper, then gcc takes these two .o file, libcamlrun.a and my main.c file and it fails saying both that main is defined several time, and also that caml_startup is an undefined reference.
isd has quit [Quit: Leaving.]
gareppa has quit [Quit: Leaving]
<mathsm> If I use `ocamlopt -output-complete-obj mod.ml -o libmod.o` the libmod.o file has runtime so I can gcc without the runtime .a file, but if I jbuild it and try to gcc with the .a file it fails.
<pierpa> open_in_bin, open_out_bin, read_byte, write_byte.
<steenuil> there's also the bitstring library that provides something like Erlang's binary matching
muelleme has quit [Ping timeout: 260 seconds]
<wickedshell> steenuil, yeah, unfortunately it doesn't support floats (according to its documentation)
<steenuil> that's too bad
<steenuil> couldn't you just read them as strings and parse them later?
<wickedshell> How would I parse it as a float later? It's a IEEE float over the wire?
<wickedshell> Yeah, the best I've come to thus far seems to be to learn the interaction with C and just wrap up a C encoder/decoder for the protocol I'm intrested in. But that seemed like a bit of a pain (I haven't done anything with the C bindings yet)
<steenuil> I think there might be something similar to that in one of jane street's libraries maybe
<steenuil> I think I remember seeing some functions to handle interaction with memory representations of FORTRAN structures
<steenuil> oh, you mean you want to write the encoding and decoding part with C bindings
<wickedshell> I found bin_opt from jane street's stuff. Looks to be it's own encoder/decoder for both ends, which is cool, but not terribly useful for an external format
<wickedshell> Well my orginal plan was to write an OCaml encoder/decoder. But it currently looks easier to just use a C library that does the encoding/decoding then wrap the struct up in ocaml
<steenuil> as for parsing the floats you can just look at how floats in particular are represented on the wire and then parse the string
<mathsm> I made a gist with where I'm currently stuck. `make works` works, and `makes fail` fails, and I can't get why... https://gist.github.com/Artymort/a3b880817988727c8025091f0704ae05
<mathsm> (And, because I want jbuild in the long run, of course I want to make `make fails` work)
<steenuil> wickedshell: obus just does it like this, maybe you can get away with it too https://github.com/diml/obus/blob/f63a38c8ae8550146172fc14d2f08a431fe71bbc/src/oBus_wire.ml#L989
<octachron> mathsm, there was a discussion on discuss on this subject recently: https://discuss.ocaml.org/t/dune-object-file-output-is-not-using-output-complete-obj/1828
jbrown has quit [Ping timeout: 260 seconds]
<octachron> also, afair you need at least output-obj (or custom) for the bytecode compiler to produce an object file usable from the C side.
<mathsm> If I ask it to output a .so instead of a .o then it has the -output-complete-obj, but then it's a shared library, I can't find a way to link it? In if I manually ask jbuilder to ust -output-complete-obj it's going to complain, a conflict between -c and this one...
<mathsm> I'll read the discuss.ocaml.org thing! Thanks!
al-damiri has quit [Quit: Connection closed for inactivity]
_andre has quit [Quit: leaving]
gtrak has quit [Ping timeout: 256 seconds]
pierpal has joined #ocaml
Jesin has joined #ocaml
pierpal has quit [Ping timeout: 260 seconds]
AltGr has left #ocaml [#ocaml]
muelleme has joined #ocaml
steenuil has quit [Ping timeout: 245 seconds]
isd has joined #ocaml
Jesin has quit [Quit: Leaving]
lyxia has quit [Remote host closed the connection]
lyxia has joined #ocaml
TarVanimelde has joined #ocaml
pierpal has joined #ocaml
<mathsm> OK, sorry for the late update. So actually I needed `jbuilder build mod.exe.o`, not `jbuilder build mod.o`...
<mathsm> Thanks everyone.
gtrak has joined #ocaml
gtrak has quit [Ping timeout: 255 seconds]
gtrak has joined #ocaml
TarVanimelde has quit [Quit: TarVanimelde]
sh0t has quit [Remote host closed the connection]
cbot has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
gtrak has quit [Ping timeout: 240 seconds]
pierpa has joined #ocaml
kakadu has quit [Remote host closed the connection]
etc_ has joined #ocaml
reynir has quit [Ping timeout: 265 seconds]
jimmyrcom has joined #ocaml
<etc_> Hi! I'm interested in OCaml's modules/functors. They are structurally typed, but you have to specify the signature of what you expect. Is there any way to take advantage of ocaml's structural type inference like with objects to get around this in modules?
<companion_cube> no, functors ask for a specific signature, by design