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
jbrown has quit [Ping timeout: 272 seconds]
vicfred_ has joined #ocaml
vicfred has quit [Ping timeout: 246 seconds]
vicfred_ has quit [Client Quit]
cybuster has joined #ocaml
inkbottle has quit [Quit: Konversation terminated!]
inkbottle has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
mangoicedtea has quit [Remote host closed the connection]
zebrag has joined #ocaml
inkbottle has quit [Ping timeout: 240 seconds]
cybuster has quit [Quit: Leaving]
osa1 has joined #ocaml
kleisli__ has joined #ocaml
kleisli_ has quit [Ping timeout: 260 seconds]
osa1_ has joined #ocaml
osa1_ has quit [Client Quit]
osa1_ has joined #ocaml
osa1_ has quit [Client Quit]
waleee-cl has quit [Quit: Connection closed for inactivity]
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
toppler has quit [Remote host closed the connection]
mal``` has quit [Quit: Leaving]
toppler has joined #ocaml
mal`` has joined #ocaml
peddie has quit [Ping timeout: 246 seconds]
sadiq_ has quit [Ping timeout: 272 seconds]
sadiq has joined #ocaml
rwmjones_ has joined #ocaml
rwmjones has quit [Ping timeout: 260 seconds]
Manis[m] has quit [Remote host closed the connection]
flux1 has quit [Read error: Connection reset by peer]
BitPuffin has quit [Read error: Connection reset by peer]
swapnilrajOld[m] has quit [Remote host closed the connection]
defolos has quit [Remote host closed the connection]
swapnilraj[m] has quit [Remote host closed the connection]
labor[m] has quit [Remote host closed the connection]
jimt[m] has quit [Remote host closed the connection]
camlriot42 has quit [Write error: Connection reset by peer]
aspiwack[m] has quit [Remote host closed the connection]
lnxw37d4 has quit [Remote host closed the connection]
dash has quit [Remote host closed the connection]
aecepoglu[m] has quit [Remote host closed the connection]
dash has joined #ocaml
aspiwack[m] has joined #ocaml
peddie has joined #ocaml
lnxw37d4 has joined #ocaml
swapnilrajOld[m] has joined #ocaml
defolos has joined #ocaml
labor[m] has joined #ocaml
camlriot42 has joined #ocaml
BitPuffin has joined #ocaml
flux1 has joined #ocaml
jimt[m] has joined #ocaml
swapnilraj[m] has joined #ocaml
Manis[m] has joined #ocaml
aecepoglu[m] has joined #ocaml
osa1 has quit [Ping timeout: 240 seconds]
vicfred has joined #ocaml
andreas303 has quit [Write error: Connection reset by peer]
cantstanya has quit [Write error: Connection reset by peer]
Hail_Spacecake has quit [Write error: Connection reset by peer]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
Hail_Spacecake has joined #ocaml
cantstanya has joined #ocaml
andreas303 has joined #ocaml
craigfe has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
narimiran has joined #ocaml
CcxWrk has quit [Ping timeout: 256 seconds]
CcxWrk has joined #ocaml
Serpent7776 has joined #ocaml
cantstanya has quit [Write error: Broken pipe]
Hail_Spacecake has quit [Remote host closed the connection]
nicoo has quit [Remote host closed the connection]
andreas303 has quit [Write error: Broken pipe]
narimiran has quit [Ping timeout: 265 seconds]
nicoo has joined #ocaml
Hail_Spacecake has joined #ocaml
cantstanya has joined #ocaml
vicfred has quit [Quit: Leaving]
andreas303 has joined #ocaml
craigfe has joined #ocaml
osa1 has joined #ocaml
elfring has joined #ocaml
nkly_ has joined #ocaml
dckc has quit [Ping timeout: 256 seconds]
dckc has joined #ocaml
jnavila has joined #ocaml
flux1 has quit [Quit: killed]
labor[m] has quit [Quit: killed]
camlriot42 has quit [Quit: killed]
defolos has quit [Quit: killed]
jimt[m] has quit [Quit: killed]
lnxw37d4 has quit [Quit: killed]
Manis[m] has quit [Quit: killed]
dash has quit [Quit: killed]
aecepoglu[m] has quit [Quit: killed]
aspiwack[m] has quit [Quit: killed]
BitPuffin has quit [Quit: killed]
swapnilrajOld[m] has quit [Quit: killed]
peddie has quit [Quit: killed]
swapnilraj[m] has quit [Quit: killed]
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
lnxw37d4 has joined #ocaml
jimt[m] has joined #ocaml
dash has joined #ocaml
flux1 has joined #ocaml
aecepoglu[m] has joined #ocaml
peddie has joined #ocaml
aspiwack[m] has joined #ocaml
swapnilraj[m] has joined #ocaml
Manis[m] has joined #ocaml
camlriot42 has joined #ocaml
BitPuffin has joined #ocaml
defolos has joined #ocaml
labor[m] has joined #ocaml
swapnilrajOld[m] has joined #ocaml
rwmjones_ is now known as rwmjones
kleisli__ has quit [Remote host closed the connection]
kleisli__ has joined #ocaml
waleee-cl has joined #ocaml
jbrown has joined #ocaml
bartholin has quit [Quit: Leaving]
kleisli__ has quit [Ping timeout: 240 seconds]
nkly_ has quit [Ping timeout: 260 seconds]
nkly_ has joined #ocaml
mfp has joined #ocaml
mbuf has joined #ocaml
dhil has joined #ocaml
olle has joined #ocaml
<olle> sooo, in haskell there are a multitude of different ways to do effects, and in OCaml there will be one only, then, whenever that research is included in main runtime?
Tuplanolla has joined #ocaml
<olle> there is* ?
jbrown has quit [Ping timeout: 272 seconds]
<Leonidas> what to use when returning an int32_t from a function that uses CAMLparam1?
<Leonidas> I would say CAMLreturn(my_int) but my_int is not a (caml) `value`.
<hannes> Leonidas: CAMLreturn(Val_int(my_int))
<hannes> (or Val_long)
mbuf has quit [Ping timeout: 260 seconds]
<Leonidas> hannes: but I don't want to make it into a `value`, the point is I want this as a helper function to extract an int from an ADT and call it from C.
<Leonidas> I would want CAMLreturnCdatatype
<Leonidas> Or do I have to rewrite this into a Mmacro?
narimiran has joined #ocaml
jbrown has joined #ocaml
mbuf has joined #ocaml
<mbuf> How to use Stdio.In_channel.input_line in the following read_process_lines definition? https://pastebin.com/evdBrsn1
<mbuf> I tried to simply replace input_line with Stdio.In_channel.input_line, but, the process hangs
<flux1> Leonidas: why do you want to return a C datatype? I mean how is it better than returning an OCaml integer?
jbrown has quit [Ping timeout: 260 seconds]
dhil has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
dhil has joined #ocaml
jbrown has joined #ocaml
<mbuf> In_channel.input_line_exn works! It has the expected function argument types (in_channel -> string).
jnavila has quit [Quit: Konversation terminated!]
mbuf has quit [Ping timeout: 260 seconds]
<Leonidas> flux1: because I have to convert from a type Foo = Bar of int | Default into an int32_t in multiple places in the code and don't want to repeat the whole unwrap logic in every place I need it
<flux1> Leonidas: hmm, you call that function only from C?
<Leonidas> so if I returned a value I'd have to do Int_val(my_function_which_pointlessly_wraps) on every incantation
<Leonidas> flux1: yes.
<flux1> maybe it's fine then :). look what the macros do maybe.
<Leonidas> it is just a helper and I could express it as C macro (but would obviously prefer not to)
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
Haudegen has joined #ocaml
jnavila has joined #ocaml
dckc has quit [Ping timeout: 272 seconds]
<Tuplanolla> There seem to be several logging frameworks on OPAM. Which one would you recommend for a project that has a lot of foreign code (including C++ and Python)?
<Tuplanolla> Integration with other tools is not necessary, but would be nice.
<companion_cube> are the C++ and python in the same process?
<companion_cube> (in any case, you probably want `logs`)
dhil has quit [Ping timeout: 256 seconds]
dckc has joined #ocaml
<Tuplanolla> No, using separate processes is the only way to stay sane.
<companion_cube> so really the logging framework shouldn't be affected :(
<companion_cube> :)
<Tuplanolla> I'll have a look at `logs`, thanks. Other recommendations are also welcome.
nkly_ has quit [Ping timeout: 260 seconds]
elfring has quit [Quit: Konversation terminated!]
grdgz has joined #ocaml
cranix has joined #ocaml
<cranix> hello
<cranix> can someone recommend me library for principial component analysis? or should i write something on my own using owl?
<cranix> and how currently possibility of parralellization of computations in ocaml looks like? especially i'm interested in using GPU for that (more precisely AMD GPU)
<Tuplanolla> I don't understand how to use this thing.
olle has quit [Ping timeout: 246 seconds]
<Tuplanolla> How do I log into a file?
<ollehar> Tuplanolla: what did you try?
<companion_cube> Tuplanolla: you set https://erratique.ch/software/logs/doc/Logs/index.html#val-format_reporter this reporter, for example, with `dst` and `app` pointing to `Format.formatter_of_out_channel (open_out "the_file"))`
<Tuplanolla> I tried `Logs.set_reporter (Logs.format_reporter ())` followed by `Logs.info (fun f -> f "Message goes here.")`, as instructed in the documentation, but I have no clue where the message goes or when.
<companion_cube> by default it goes into stdout/stderr
<companion_cube> https://erratique.ch/software/logs/doc/Logs/index.html#val-format_reporter <-- see the sentence about "defaults to Format.std_formatter"
<Tuplanolla> So I do `let f = Format.formatter_of_out_channel (open_out "/tmp/messages.log") in Logs.set_reporter (Logs.format_reporter ~app:f ~dst:f ())`.
grdgz has quit [Remote host closed the connection]
<companion_cube> yeah something like that
<companion_cube> (there's also a syslog adapter if that's more your thing)
<Tuplanolla> Now `Logs.info (fun f -> f "Message goes here.")` still does nothing.
<companion_cube> maybe it's not in "info" level? try with error
<Tuplanolla> Right, that'll do.
<Tuplanolla> I suppose I should also specify the message source.
<companion_cube> that's optional, but yeah
<companion_cube> a cool trick: `module Log = (val Logs.src_log (Logs.Src.create "the-source"))`
<companion_cube> that makes a `Log` module that is specific to that source
<Tuplanolla> What is this sorcery?
<companion_cube> no need to pass `~src` around at each invocation
<companion_cube> it's a wee bit of first-class module
grdgz has joined #ocaml
osa1 has quit [Ping timeout: 240 seconds]
<Tuplanolla> Neat.
<Tuplanolla> That combination of syntax is new to me.
<companion_cube> (for the levels, I don't remember, but you can either set them on the command line if you use cmdliner, or maybe use `Sys.getenv`/`Sys.getenv_opt` to set it up_
<companion_cube> )
<Tuplanolla> I can `Logs.set_level (Some Logs.Debug)` first.
dhil has joined #ocaml
<companion_cube> oh right, forgot about that.
<Tuplanolla> Now the only remaining question is how to close the `open_out` file at the end.
<companion_cube> possibly `at_exit (fun x -> close_out the_file)`
<companion_cube> it's hard to do better for a logger, as it doesn't necessarily lives in a scope that will explicitely be closed
grdgz is now known as gonzachr
gonzachr is now known as grdgz
grdgz is now known as gonzachr
<Tuplanolla> Ah! I must stash the channel given by `open_out` somewhere safe.
<Tuplanolla> This was very helpful, much more so than the official documentation; thank you.
<companion_cube> if you open it in your main, you can close it there too
<companion_cube> no worries!
gonzachr is now known as grgdz
grgdz is now known as gonzachr
dhil has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
<Tuplanolla> I'm putting together a distributed computing system with one part in OCaml extracted from Coq and another part in C++ extracted from a researcher. I'm not even that far into it and it's already absolutely ridiculous how many things can go quietly wrong along the way.
<ollehar> fun fact: companion_cube is actually a documentation bot design by xavier in his secret lab
<ollehar> not entirely different than Data in Star Trek
<companion_cube> I am pretty pale, indeed
<ollehar> ^^
<companion_cube> and I have at least one library ending in `-data`
<ollehar> fun fact: many developers have evolved a special skin that can harvest vitamin D from screen light.
gonzachr is now known as grdgz
<ollehar> much like vampires
<ollehar> companion_cube: are you based in paris too?
<companion_cube> no, not anymore
<ollehar> companion_cube: why not?
<companion_cube> because I moved
<companion_cube> other questions? :D
<ollehar> haha no
gonzachr has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
nkly_ has joined #ocaml
cthuluh has quit [Quit: leaving]
chripell has joined #ocaml
FreeBirdLjj has joined #ocaml
nkly_ has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
fritjof has joined #ocaml
jca has joined #ocaml
fritjof has quit [Ping timeout: 244 seconds]
bartholin has joined #ocaml
grdgz has quit [Remote host closed the connection]
gonzachr has quit [Ping timeout: 265 seconds]
vicfred has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
gonzachr has joined #ocaml
gonzachr has quit [Ping timeout: 246 seconds]
kanishka has joined #ocaml
kanishka has quit [Client Quit]
kanishka has joined #ocaml
gonzachr has joined #ocaml
kanishka has quit [Quit: Quit]
kanishka has joined #ocaml
kanishka has quit [Client Quit]
Haudegen has joined #ocaml
<ollehar> oooh, with psalm so can type the generators in php. if you use generators to yield effect objects, you basically have side-effect types. nice.
<ollehar> you can type*
gonzachr has quit [Ping timeout: 256 seconds]
vicfred has quit [Quit: Leaving]
gonzachr has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
ggole has quit [Quit: Leaving]
banjiewen has quit [Ping timeout: 244 seconds]
cemerick has quit [Ping timeout: 256 seconds]
SrPx has quit [Read error: Connection reset by peer]
adrianbrink has quit [Ping timeout: 260 seconds]
waleee-cl has joined #ocaml
rdivyanshu_ has quit [Ping timeout: 260 seconds]
banjiewen has joined #ocaml
SrPx has joined #ocaml
SrPx has quit [Max SendQ exceeded]
adrianbrink has joined #ocaml
rdivyanshu_ has joined #ocaml
cemerick has joined #ocaml
jco has joined #ocaml
<jco> hello!
<companion_cube> world
banjiewen has quit [Ping timeout: 260 seconds]
<jco> do you know how to cast a private key stored in a string to a nocrypto private key?
<jco> companion_cube: nice one :)
banjiewen has joined #ocaml
<d_bot> <undu> Try to use mirage-crypto instead of nocrypto if you can
<jco> hum, why?
<d_bot> <undu> mirage-crypto is a maintained fork of nocrypto
SrPx has joined #ocaml
<companion_cube> wasn't nocrypto already a mirage project?
<d_bot> <undu> I think so
<d_bot> <undu> this function converts a string to a private key and validates some properties: https://github.com/xapi-project/xen-api/blob/d24270aaf90aac7086a47807941f7dc1eb7bfaca/ocaml/gencert/lib.ml#L73
<d_bot> <undu> it uses mirage-crypto, but it was the same before porting it from nocrypto
<d_bot> <undu> or very similar, you could check the history
<jco> oh yeah
<jco> indeed, i should eventually port the program to mirage-crypto
<jco> indeed, many thanks!
Hrundi_V_Bakshi has joined #ocaml
<ollehar> btw, which university is responsible for typed effects research?
osa1 has joined #ocaml
jco has quit [Ping timeout: 240 seconds]
gonzachr has quit [Ping timeout: 240 seconds]
jco has joined #ocaml
reynir has quit [Ping timeout: 265 seconds]
reynir has joined #ocaml
gonzachr has joined #ocaml
gonzachr has quit [Client Quit]
osa1 has quit [Ping timeout: 260 seconds]
<Johann> hello, i'm using alcotest for some testing in my app, and it looks like it requires a printer for every type i would test. Is there some easier pattern than having to define a formater (or at least, a to_string) for every types? Should I just use ppx_deriving.show everywhere?
troydm has quit [Ping timeout: 256 seconds]
<ollehar> Johann: why not?
<Johann> it feels very repetitive
jco has quit [Quit: WeeChat 2.7]
dhil has quit [Quit: Leaving]
narimiran has quit [Ping timeout: 264 seconds]
<ollehar> well
<flux1> the "[%derive.show: string]" -syntax is reasonably compact
mirrorbird has joined #ocaml
<Johann> flux1: yes, it is, but it doesn't seem to work for types referencing custom types (like `{myrecord: myvariant}`), or even for a simple `type test=string` as i get an `Unbound value pp_test` error when testing.
<flux1> well, it works for types and composites of types that do have pretty printers available
<flux1> so, tuples, arrays, lists, etc; can be pretty convenient
<flux1> do don't spare @@deriving :)
<flux1> s/do/so/
<Johann> alright, i'll go with that thanks
Jesin has quit [Quit: Leaving]
fritjof has joined #ocaml
vicfred has joined #ocaml
Jesin has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
Tsukimaru has joined #ocaml
jbrown has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
vicfred has quit [Quit: Leaving]
jmorris has joined #ocaml
Tsukimaru has quit [Quit: Leaving]
<haesbaert> is there a way to mark something as "used" for debugging purposes ? As in I want to tell the compiler to not warn me about that being unused on that function
<haesbaert> ohhhhh leading underscore, awesome.
robmyers has quit [Ping timeout: 244 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 264 seconds]
terrorjack has quit [Ping timeout: 244 seconds]
terrorjack has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
robmyers has joined #ocaml
jmorris has quit [Quit: Leaving]
Tuplanolla has quit [Quit: Leaving.]
vicfred has joined #ocaml
mangoicedtea has joined #ocaml
webshinra_ has joined #ocaml
webshinra has quit [Read error: Connection reset by peer]