flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.03.0 announced http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
pierpa has joined #ocaml
walter|r has joined #ocaml
amnn_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sz0 has quit [Quit: Connection closed for inactivity]
walter|r has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
darkf has joined #ocaml
cow-orker has quit [Ping timeout: 240 seconds]
kyo9142 has joined #ocaml
kyo91 has quit [Ping timeout: 244 seconds]
cow-orker has joined #ocaml
Algebr has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
sh0t has quit [Quit: Leaving]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
struktured has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
shinnya has joined #ocaml
struktured has quit [Ping timeout: 276 seconds]
johnelse has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 240 seconds]
struktured has joined #ocaml
Algebr has joined #ocaml
Sorella has quit [Ping timeout: 260 seconds]
NhanH has quit [Ping timeout: 260 seconds]
Sorella has joined #ocaml
NhanH has joined #ocaml
johnelse has joined #ocaml
copy` has quit [Ping timeout: 260 seconds]
copy` has joined #ocaml
nicholasf has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 260 seconds]
nicholasf has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
nicholasf has quit [Ping timeout: 240 seconds]
nicholasf has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
ismaelga has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
badon has quit [Quit: Leaving]
average has joined #ocaml
govg has joined #ocaml
yegods has quit [Remote host closed the connection]
silver has joined #ocaml
struktured has joined #ocaml
ygrek_ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
yegods has joined #ocaml
badon has joined #ocaml
yegods has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
struktured has quit [Ping timeout: 260 seconds]
mistermetaphor has joined #ocaml
mistermetaphor has quit [Ping timeout: 244 seconds]
jinj has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
badon has quit [Quit: Leaving]
MercurialAlchemi has joined #ocaml
govg has quit [Quit: leaving]
govg has joined #ocaml
yegods has joined #ocaml
badon has joined #ocaml
Reshi has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
Reshi has quit [Ping timeout: 250 seconds]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
Sorella has quit [Quit: Connection closed for inactivity]
leyyin has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
aluuu has joined #ocaml
<aluuu> Hello everyone.
<Algebr> Hi
<aluuu> During fixing some ocaml-redis issues I've met a problem with oasis setup.
<aluuu> Here's detailed description of the problem – https://github.com/0xffea/ocaml-redis/pull/26#issuecomment-215948255
<maker> hm, hello again. I am parsing this two files (pem stuff); I need to fetch some data from both of them, then store it in a record. So far I came up with a nested matching, but it doesn't look very elegant. Is there anything ideomatic in ocaml for this cases?
<maker> Specifically, I am doing this:
<aluuu> In a nutshell, my question is: is there any way to disable _tags file autogeneration in oasis or could I generate _tags with optional package usage with the help of oasis?
<maker> match parse_foo foo with | [`AAA aaa] -> match parse_bar bar with | [`BBB bbb] -> {a=aaa; b=bbb}
<maker> (plus matching for errors)
bba has joined #ocaml
nicholasf has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
<Algebr> aluuu: I don't understand the issue, you do opam remove lwt but then want to build something that uses lwt.unix?
Simn has joined #ocaml
<Algebr> maker: maybe match parse_foo foo, parse_bar bar with
<Algebr> | ([`AAA aaa], [`BBB bbb]) -> {a=aaa; b=bbb}
noethics has joined #ocaml
<maker> Algebr: oh lovely, I didn't think about it
<maker> thanks!
<flux> on the other hand sometimes you want to avoid executing the other part, in that case you can do match parse_foo foo, lazy (parse_bar bar) with | [`AAA a], lazy [`BBB b] -> { a; b }
<flux> of course makes no sense if you always match it and have only one match pattern :-)
<Algebr> aluuu: ah lame, its still using lwt even though --disable-lwt. Where does the --disable-lwt flag come from
<maker> flux: sweet, this could be the first time I manage to use this lazy thing
<aluuu> Algebr: it's definition is in _oasis file (https://github.com/aluuu/ocaml-redis/blob/master/_oasis#L20) and then it appears in auto-generated setup.ml (https://github.com/aluuu/ocaml-redis/blob/master/setup.ml#L7024)
<Algebr> maker: another usage of lazy I've found is for holding the original value of somethign just in case to present in case of error or whatnot
<Algebr> ah
<maker> an example of this?
<aluuu> Algebr: I've spotted strange thing in auto-generated _tags file: package(lwt) tag is defined for all files in src directory, so ocamlbuild tries to build all files in src with lwt package required.
<maker> I can't picture it myself - everytime I can think of something that's already computed
<maker> so yeah lazy makes not much sense
<flux> maker, I've used 'lazy' for loading bitmaps and then using List.iter for processing said bitmaps
<flux> maker, so the loading of the data is interleaved with the processing of said data
<maker> yep
<Algebr> aluuu: that does seem odd
<maker> also is there a decent way for unittesting stuff on Lwt?
<aluuu> maker: what do you mean by the term "decent"?
<maker> aluuu: I mean OUnit seems could do the job, but I would need to start an Lwt loop for every test_ function
<aluuu> maker: there are some test in ocaml-redis – written ones, used for both sync and lwt client testing.
<maker> aluuu: also I am using the network so testing means I need to create a mock server
<flux> heh, this was a pretty interesting use for lazy: let f = lazy (open_out .. ) in (* use f or don't use f, depending on input data *); if Lazy.is_val f then close_out (Lazy.force f)
<flux> so if the code doesn't end up using f, the file won't get generated
<maker> aluuu: ok, taking a look now
<aluuu> maker: oh, i think mocking is a hard thing in ocaml
<flux> not if the code is functor- or object-based regarding the object to be mocked ;). but I guess that's not the norm ;).
<flux> ..but in those cases mocking should be pretty nice!
<flux> also it might be quite annoying to mock out complete modules like 'Unix', if you wanted to mock network operations..
<flux> (well, I guess you can just limit the signature to the parts of Unix you make use of)
badon has quit [Read error: Connection reset by peer]
badon has joined #ocaml
<aluuu> btw, mirage-tcpip provides great mocking capabilities for netwokring libraries
mistermetaphor has joined #ocaml
<flux> hmm, did this switch 4.02.1+multicore exist a long time in opam or has it appeared just recently..
Algebr has quit [Remote host closed the connection]
mistermetaphor has quit [Ping timeout: 276 seconds]
A1977494 has joined #ocaml
<flux> oh, I have even switched it, maybe it's some old unofficial :)
mettekou has joined #ocaml
Reshi has joined #ocaml
kushal has joined #ocaml
f[x] has joined #ocaml
<maker> flux: making a functor only to allow mock object doesn't seem good anyway
<maker> hannes: mm is there a way in X509 to convert a PEM into a DER?
<companion_cube> flux: another possibility, if you implement network protocols, is to invert the control flow
<flux> maker, well, it doesn't need to be the only reason, it also does decoupling
<companion_cube> and have the protocol implementation be a kind of state machine
<companion_cube> I think `imap` does this
<flux> maker, and you get to see the dependencies very explicitly
Reshi has quit [Ping timeout: 244 seconds]
* maker fears functors
ygrek_ has quit [Ping timeout: 276 seconds]
<flux> you should try them! they're pretty neat!
pyon is now known as loli-pyon
<maker> I used them for mirage
<maker> then everything had to be inside the module
<companion_cube> they're nice, but using them a lot can be difficult
<maker> ^ yes that's my understanding
<maker> more than difficult, yeah, troublesome
<flux> I guess in practice they make it more difficult to follow where the actual code flow goes
<flux> can merlin follow modules that are reachable via a functor argument?
dsheets has joined #ocaml
<companion_cube> yes
<flux> I mean, it could at least give alternatives like rtags can find 'where is this referenced from', but in a bit another sense
<flux> oh, cool :)
<companion_cube> wait, you mean , for typing, or for 'goto def'?
<flux> hmm, no
<flux> let's say you have module MyCode = functor (U : module type of Unix) -> struct let foo = U.gettimeofday () end
<flux> and then another piece of code that does module MyImpl = MyCode(Unix)
<flux> and then you place your point over U.gettimeofday. Can you get to Unix.gettimeofday?
<companion_cube> I don't think so, since it could correspond to several implementations
<companion_cube> the same you cannot go to some list [1;2;3] within List.map
<flux> yes. but in practice, there would be a limited number of applications withing an application; possibly even just exactly one
<flux> so, much like a symbol can be references from multiple places, rtags (for c/c++) can find those places
dsheets has quit [Ping timeout: 250 seconds]
<companion_cube> hmmm
<companion_cube> "find instances" in IDEs, or something like this?
<flux> yep
<companion_cube> then I don't think so
<companion_cube> it's probably harder in OCaml though
<flux> for example in rtags I can go over struct { int a; } and the field 'a' and find all the places that make use of the particular field
<companion_cube> it's like a reachability analysis, because the functor could also be passed as argument to another functor, etc.
<flux> I think the problem of ocaml things often times is trying to get a 100% solution.. ;-)
<companion_cube> well
<companion_cube> yes, things are difficult
<companion_cube> but merlin does an awesome job at what it tries to solve
<flux> a lot of times functors are used without in the top-level without any particular dynamic control flow involved
<flux> you could just draw a graph and walk it
abruanese has quit [Max SendQ exceeded]
shinnya has joined #ocaml
<hannes> maker: there's X509.Encoding.Pem.Certificate.of_pem_cstruct https://mirleft.github.io/ocaml-x509/X509.Encoding.Pem.Certificate.html
<maker> hannes: yes, and with that I read a PEM
<maker> hannes: then how do I get a DER string representing that csr?
<hannes> maker: hmm?
oskarth has joined #ocaml
<hannes> maker: and how to read a file into a cstruct (or string) is out of scope (you can use Lwt_unix or Unix openfile and read for this)... Cstruct.of_string let's you create a cstruct.t
mistermetaphor has joined #ocaml
abruanese has joined #ocaml
A1977494 has quit [Quit: Leaving.]
mistermetaphor has quit [Ping timeout: 276 seconds]
<maker> hannes: I want to do the following
<maker> openssl req -in req.csr -outform DER
<maker> where req.csr can be a string, and stdout is another string
<maker> in ocaml
<maker> or better, Cstruct.t types.
<maker> no file operations, I am just trying to figure out how to make a der out of a pem
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<maker> So I figured out myself (and you confirmed) that I can read a Pem certificate signing request. Now I want to have a der representation of it
<hannes> maker: you don't get a DER of a CSR atm.. why would you have a DER stored somewhere?
<hannes> (for certificates there's parse and cs_of_cert in Encoding, which are the DER -> certificate and certificate -> DER conversions)... maybe adding this for CSRs makes sense..
yegods has joined #ocaml
amnn has joined #ocaml
<M-martinklepsch> gasche_ (IRC): I tried putting #use "topfind";;into .ocamlinit and evaluating it directly in the top level, in both cases I get Cannot find file topfind.
<hannes> maker: https://github.com/mirleft/ocaml-x509/blob/master/lib/x509_ca.ml#L28-L37 is the functionality, but it is not exposed via the interface..
<maker> It's still not clear to me what is cs
<hannes> where?
<hannes> maker: in the code it is a cstruct.t
<maker> hannes: I don't know why one should want it, but acme says at some point you have to take your csr and send the base64-encoded version of the der file:
<maker> «The CSR is sent in the Base64url-encoded version of the DER format»
<maker> anyways, back to cs
<maker> hannes: "certificate_request_of_cs cs" what is a cs? a certificate signing request type?
<maker> "signing_request", "request_info", or what?
<hannes> cs is a cstruct.t
<maker> much love
<hannes> currently on a branch... you can opam pin that branch (expose-der-csr)
<maker> oh, how do you pin a branch?
<maker> with the dash right?
<maker> yep
<maker> Your request can't be satisfied:
<maker> - nocrypto>=0.5.3 is not available because the package is pinned to https://github.com/mirleft/ocaml-nocrypto.git, version 0.5.2.
<maker> hah
aluuu has quit [Ping timeout: 250 seconds]
jinj has quit [Ping timeout: 250 seconds]
ismaelga has joined #ocaml
dsheets has joined #ocaml
atbagautdinov has quit [Ping timeout: 276 seconds]
profan has quit [Quit: Changing server]
dsheets has quit [Ping timeout: 260 seconds]
<M-martinklepsch> Hey all :) I'm trying to get tuaregs default toplevel to be able to open Core but it always tells me the module is unbound. Someone suggested adding an ocamlinit with #use "topfind" but that didn't help either. Any other suggestions?
<M-martinklepsch> error message after #use "topfind" is Cannot find file topfind.
Reshi has joined #ocaml
tobiasBo1 has quit [Quit: Kthxbye]
_y has quit [Read error: Connection reset by peer]
Reshi has quit [Ping timeout: 250 seconds]
atbagautdinov has joined #ocaml
<flux> m-martinklepsch, do you have ocamlfind installed?
<flux> aka findlib
<M-martinklepsch> yes. v1.6.2
<M-martinklepsch> I don't know if that's useful information but if I start utop then #require "core" and open Core.Std just works fine
nicholasf has quit []
octachron has joined #ocaml
lokien_ has joined #ocaml
<octachron> M-martinklepsch, are you using your system ocaml compiler?
<maker> so now I have merlin
<maker> I just gave it sudo and installed it
* maker throws holy water at the laptop
Reshi has joined #ocaml
iZsh has quit [Ping timeout: 276 seconds]
iZsh has joined #ocaml
shinnya_ has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
ski__ has joined #ocaml
ungz has joined #ocaml
djellemah_ has quit [Ping timeout: 276 seconds]
shinnya has quit [Ping timeout: 276 seconds]
ski has quit [Ping timeout: 276 seconds]
Ninja123_ has quit [Ping timeout: 276 seconds]
Ninja123_ has joined #ocaml
djellemah_ has joined #ocaml
pierpa` has joined #ocaml
ski__ is now known as ski
pierpa has quit [Ping timeout: 244 seconds]
<M-martinklepsch> octachron (IRC): yes: system C system System compiler (4.02.3)
shinnya_ has quit [Ping timeout: 260 seconds]
mettekou has quit [Quit: Textual IRC Client: www.textualapp.com]
<octachron> M-martinklepsch, I think that you need to add this https://github.com/OCamlPro/opam/blob/master/shell/dot_ocamlinit before #use "topfind";;
shinnya has joined #ocaml
<M-martinklepsch> octachron (IRC): I do have this in ~/.ocamlinit should that be sufficient
<M-martinklepsch> ?
<M-martinklepsch> or does one .ocamlinit override the other?
Reshi has quit [Ping timeout: 260 seconds]
Reshi has joined #ocaml
<octachron> M-martinklepsch, yes there is only one .ocamlinit active at a time
<octachron> i,e, the interpreter only read the closest .ocamlinit
<M-martinklepsch> octachron (IRC): thanks! that indeed helped! so after starting a toplevel that has #use "topfind";; I still need to do things like #require "core" where do people put these setup things usually?
<octachron> good question? The root of the project directory maybe?
yegods has quit [Remote host closed the connection]
<M-martinklepsch> octachron (IRC): but in what kind of file?
govg has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
dsheets has joined #ocaml
yegods has quit [Remote host closed the connection]
bba has joined #ocaml
govg has joined #ocaml
_y has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
<hannes> Drup: btw http://lists.ocaml.org is up, https is down... (and http used to redirect to https (maybe with HSTS), at least my firefox tries to contact https all the time)
<Drup> doh, I have https everywhere ..
<hannes> (and I recently tried to push people to move lists.ocaml.org to https, seems like I didn't succeed..)
<Drup> that would be nicer, yes ...
govg has quit [Quit: leaving]
whitequark has joined #ocaml
<whitequark> anyone knows how the `type nonrec` construct looks like in Typedtree?
<companion_cube> o/ whitequark
<whitequark> hi
<companion_cube> I'd guess it's a flag or something
_2can has joined #ocaml
<Drup> | Tstr_type of rec_flag * type_declaration list
<Drup> typedtree.mli:324
<whitequark> hang on
<whitequark> oh
<whitequark> Types.Sig_type
<whitequark> that's not Typedtree, my bad
<whitequark> and it already has a rec_flag, which can be Trec_not, Trec_first and Trec_next
<whitequark> in 4.02, that is
<Drup> Yes, it shouldn't change much
<whitequark> okay, but how is `type nonrec` in Parsetree is represented in Types?
<Drup> I'm .. not sure it is
<whitequark> does it abuse some scoping mechanism or what
<Drup> Recursivity for types only change the name resolution, name resolution is done in Types/Typedtree
<Drup> so, you don't need the information anymore
<whitequark> >_<
<whitequark> but I need it in ppx_import
<Drup> I see
<Drup> let me think about it
<Drup> isn't Trec_not enough ?
<whitequark> Trec_not is what happens for standalone types
<whitequark> e.g. type a = int is Trec_not
<whitequark> whereas type a = b and b = a is Trec_first Trec_next
<Drup> well, "type nonrec a = int" is correct ...
<whitequark> that breaks recursive data structures
<Drup> such as ?
<whitequark> lists?
<whitequark> ASTs?
<Drup> but list are rec, are they not ?
<Drup> they are Tref_first
<Drup> rec*
<whitequark> are they?
A1977494 has joined #ocaml
<Drup> well, they should, it's the first type in a recursive groupe of one type ...
copy` has joined #ocaml
<whitequark> let me try
ggole has joined #ocaml
<Drup> looking at typemod, it looks like it should have it, yes
<Drup> (We need a nice full printers for cm* files)
<whitequark> hm. what happened to Primitive.description_list ?..
<Drup> whitequark: it's not "print"
<Drup> now*
<whitequark> yeah but that doesn't help me to construct parsetree.
<whitequark> guess I can rip that off
<Drup> whitequark: isn't the information you want in Outcometree.out_val_decl ?
<Drup> it used to return a string list, and the string list seems to now be in oval_prims
<whitequark> oh
<whitequark> thanks
ryanartecona has joined #ocaml
<whitequark> hm, looks like type nonrec results in expanded path
dsheets has quit [Remote host closed the connection]
hcarty has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
seako has quit [Ping timeout: 250 seconds]
seako has joined #ocaml
<maker> will people have a bad opinion about me if I have non-alphabetically sorted imports?
<maker> In python this was the case
<maker> but now I'm too lazy to check .merlin, _oasis, and *.ml files.
<Drup> nobody is going to care :D
<maker> very well
<whitequark> I would silently judge you if their order is different in different files
<flux> maker, however, many ocaml programmers prefer to avoid 'open' most of the time
<flux> maker, instead fully qualified references, module aliases and local opens are used
<maker> flux: because it messes up with the namespace?
<flux> yep, it becomes difficult to see (without merlin) where a particular symbol comes from
<flux> in particular in presence of shadowing
<maker> whitequark: thanks for the honesty, haha
<maker> flux: I see
<maker> kewl
<companion_cube> hu, I don't care about the order of impots, as long as they are not "open"
<flux> I've also used this approach if I have a largish project having samish dependencies among modules.. put the dependencies to commonModules.ml as module aliases (or includes) and then just open CommonModules into the files using them
<Drup> Some open are fine
<flux> but I don't know what people think of that in general.. :)
<maker> oh christ X509.Encoding.Pem.Certificate_signing_request.of_pem_cstruct
<maker> now I have 10 chars left
<companion_cube> ok, I `open` some module packs
<companion_cube> for lack of a better namespacing mechanims
<flux> sadly people never found common ground on what kind of namespacing should ocaml have
__y has joined #ocaml
__y has quit [Client Quit]
jackweirdy has joined #ocaml
oskarth has quit [Quit: Connection closed for inactivity]
ryanartecona has quit [Quit: ryanartecona]
struktured has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
<companion_cube> hey, Lwt doesn't have an applicative interface ôO
struktured has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
rgrinberg has quit [Quit: WeeChat 1.4]
rgrinberg has joined #ocaml
kushal has joined #ocaml
ryanartecona has joined #ocaml
ungz has quit [Quit: Page closed]
sh0t has joined #ocaml
A19774941 has joined #ocaml
malc_ has joined #ocaml
f[x] has quit [Ping timeout: 260 seconds]
A1977494 has quit [Ping timeout: 244 seconds]
BitPuffin has joined #ocaml
snhmib has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<reynir> maker: you can write »module Pem_csr = X509.Encoding.Pem.Certificate_signing_request;; Pem_csr.of_pem_cstruct«
<reynir> That is, give a module a shorter alias instead of open'ing
<companion_cube> ^
<maker> mm, so that should be the nice way of avoiding opening I guess
<maker> cool
ryanartecona has quit [Ping timeout: 260 seconds]
<hcarty> maker: And you can do that locally if you're only using the module in a small scope: let module Pem_csr = X509.Long_module_name in (expression using Pem_csr)
Reshi has joined #ocaml
jeffmo has joined #ocaml
<maker> hcarty: you can do also local opening annyways right?
ryanartecona has joined #ocaml
<maker> yes I clearly remember engil doing this
lokien_ has quit [Quit: Connection closed for inactivity]
ryanartecona has left #ocaml [#ocaml]
<companion_cube> yes, you can
<companion_cube> let open Foo in
<companion_cube> also, I find it good style, personally, to provide a `Infix` submodule
<flux> maker, also Foo.(expr)
<companion_cube> so you can let open Foo.Infix in .... and only import infix combinators in the scope
<reynir> let open! Foo in ..., the ! makes it an error if the open shadows something, right? I saw it in this channel some time ago
<Drup> reynir: yes
<hcarty> reynir: Other way around - it silences a warning if something is shadowed
<Drup> oh, right, what hcarty said
sepp2k has joined #ocaml
<rgrinberg> Is there a good reference somewhere about module initialization side effects (or w/e they're called) and their order. I.e. let () = ...?
<reynir> Oh
<rgrinberg> I'm being asked about these and all I have is hearsay..
<companion_cube> rgrinberg: I'm not sure that's really specified, but from my experience it follows topological order
<companion_cube> both within a module, and among modules
<reynir> I think it's just hte order things are linked together
<rgrinberg> yeah, I thought it was the link order as well
<companion_cube> yeah
<companion_cube> but modules are linked in topological order
<companion_cube> :)
<rgrinberg> but would like a reference for this point..
<Drup> companion_cube: modules are linked in the order you give the cmo
<companion_cube> oh, hmm, you mean it's not mandatory to give them in the good order?
<Drup> It is, ocaml is going to complain
<companion_cube> I suppose it's what ocamlbuild does then
<companion_cube> ah
<companion_cube> then my point stands
<Drup> I mean, it's a subset of the topological order, but it's more precise than that
<companion_cube> "you can give modules in any order , as long as it's a topological order" :p
<companion_cube> yeah, but I wouldn't rely on the exact link order
<Drup> companion_cube: you wouldn't, but sometimes it's convenient
<Drup> (lablgtk.auto-init)
<rgrinberg> so nobody remembers where they got this information?
<Drup> It doesn't seem to be specified :/
<octachron> rgrinberg, wouldn't that be covered by the second to last paragraph in http://caml.inria.fr/pub/docs/manual-ocaml/moduleexamples.html#sec22 ?
<rgrinberg> octachron: thanks. Seems like that's the best we can do for now. Thanks for all your work improving the manual btw.
<companion_cube> Drup: hmm, can't Lablgtk main module have an explicit dependency on this "auto init"?
<companion_cube> so the topological ordering enforces the proper initialization order?
<Drup> companion_cube: no, it shouldn't, because you may or may not want the auto-init
<companion_cube> ah.
<companion_cube> well, that would make me slightly uneasy, but it's surely convenient
<whitequark> -package gtk.init
<whitequark> vs -package gtk
<whitequark> or even -package gtk.noinit
Simn has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
Glorf has quit [Read error: Connection reset by peer]
lokien_ has joined #ocaml
dsheets has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
dsheets has joined #ocaml
emmanueloga has quit [Ping timeout: 260 seconds]
jkni has quit [Ping timeout: 260 seconds]
abruanese has quit [Excess Flood]
Jaxan has quit [Quit: No Ping reply in 180 seconds.]
Jaxan has joined #ocaml
dch has quit [Ping timeout: 260 seconds]
l1x has quit [Ping timeout: 260 seconds]
sfri has quit [Quit: No Ping reply in 180 seconds.]
sspi has quit [Ping timeout: 260 seconds]
swistak35 has quit [Ping timeout: 260 seconds]
malc_ has quit [Ping timeout: 260 seconds]
deavid has quit [Ping timeout: 260 seconds]
tokik has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
dsheets has joined #ocaml
jkni_ is now known as jkni
MercurialAlchemi has joined #ocaml
Ravana- has quit [Excess Flood]
Ravana has joined #ocaml
yegods has joined #ocaml
amnn has joined #ocaml
sspi_ is now known as sspi
atbagautdinov has left #ocaml [#ocaml]
emmanueloga_ is now known as emmanueloga
dch_ is now known as dch
cdidd has quit [Ping timeout: 240 seconds]
lokien has joined #ocaml
shinnya has joined #ocaml
<maker> holy crap
<maker> Fatal error: exception Failure("No SSL or TLS support compiled into Conduit")
<maker> so I cannot use cohttp for stuff over https?
<Drup> just "opam install ssl"
<Drup> (or tls)
<maker> ohlol
<maker> Drup: I have to add these also to _oasis right?
slash^ has joined #ocaml
slash^ has quit [Client Quit]
<Drup> yes
<Drup> one of them, at least
slash^ has joined #ocaml
<maker> are they really different libraries?
<Drup> hum, maybe not on _oasis, but definitly in opam
<Drup> maker: I'll let hannes answer that :D
<reynir> Yes, ssl is openSSL bindings and tls are ocaml-tls
<reynir> s/are/is/
clog has joined #ocaml
l1x has joined #ocaml
<maker> so its' a no :P
<reynir> They definitely are different libraries
<whitequark> does cohttp actually use ocaml-tls if any?
<whitequark> that's pretty cool
<hannes> whitequark: cohttp doesn't know anything about tls
<whitequark> conduit*
<hannes> whitequark: but, if you have tls and use conduit (or use mirage-conduit which requires tls), that'll be used... you can also use the openssl bindings with conduit (by installing ssl)
Algebr has joined #ocaml
cdidd has joined #ocaml
<hannes> unclear to me what the default is -- if you're into developing a mirage unikernel, you won't have much fun with ssl
<hannes> whitequark: spoiler https://mirage.io , https://realworldocaml.org (amongst other such as https://nqsb.io) use OCaml-TLS since > 1 year :)
<maker> wtf now I get this error:
<maker> Warning: the tag "pkg_cohttp" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
<whitequark> ocamlbuild -use-ocamlfind perchance?
<whitequark> well, there was something for oasis, I think...
<maker> I don't even understand what's going on
<gasche> We really need to special-case this warning for package-like flags, or automagically enable ocamlfind in this case
<gasche> maker: does building works? this is a warning, not an error
christoph_debian has quit [Ping timeout: 276 seconds]
<maker> gasche: no :(
<maker> though
ggole has quit [Ping timeout: 260 seconds]
<maker> ^ that one is my _oasis file
kolko has quit [Ping timeout: 240 seconds]
<gasche> maker: did it work before when you already had some dependencies?
<maker> yes
<maker> oh wait
<maker> opam install cohttp asks for installation
<gasche> (have you installed the cohttp package?)
<maker> wtf
<maker> I did install it
darkf has quit [Quit: Leaving]
<maker> and I was runnign okay (well, without ssl, so ok-ish)
<maker> then I installed ssl and it broke; isn't opam supposed to reinstall it?
cdidd has quit [Ping timeout: 260 seconds]
<maker> yes now I just have a warning.
doecnt has joined #ocaml
<gasche> opam should reinstall it, but you may be using the poor-man solver that is not very good at solving dependencies; did you install aspcud?
<Algebr> maker are you on os x?
<maker> thank god no
<maker> gasche: like with apt?
<maker> apt says I did
noethics_ has joined #ocaml
noethics has quit [Disconnected by services]
noethics_ is now known as noethics
<maker> weird
<maker> I can reproduce probably if you want to dig down the problem
<maker> but so far it works \o/
<gasche> I don't know enough about ocamlbuild to productively suggest how to quiet the warning
<gasche> so I'll pass
<whitequark> BuildTools: ocamlbuild should be enough.. hm
<Algebr> I guess after 5 arguments that a function spills over its arguments to the stack, but what is the max number of args that a function can take anyway, is it like 255?
<Drup> whitequark: I think there is an issue with dev ppx_import
<Drup> Error: Unbound value Pervasives.pp_ref
<whitequark> how does that happen?
<Drup> By mean of extreme uglyness ?
<whitequark> ...
<whitequark> I mean, ppx_import does not do anything with pp_
<Drup> yes, but deriving already special case "ref", doesn't it ?
<whitequark> yes
<whitequark> oh
<whitequark> Pervasives.
<Drup> yes
<whitequark> are you running this on 4.03.?
<Drup> yes
<whitequark> that's not ppx_import
<whitequark> that's the nonrec changes, I think
<Drup> ok
<whitequark> well, something in that area
cojy has left #ocaml [#ocaml]
<whitequark> because I noticed that now I get fully resolved names in ppx_import, and looks like `ref` started turning into `Pervasives.ref`
<whitequark> it also needs to be special-cased in ppx_deriving
rossberg has joined #ocaml
cdidd has joined #ocaml
Reshi has quit [Ping timeout: 240 seconds]
mistermetaphor has joined #ocaml
<Drup> hum, it should probably be done generically for all plugins, I don't know how to do that
<whitequark> add a normalize function
<whitequark> that turns Pervasives.ref into just `ref` unless it's marked with [@nobuiltin]
<whitequark> that will also solve some unrelated issues and simplify code overall
bba_ has joined #ocaml
<whitequark> oh dear, John Harrop and a rich stdlib thread
<whitequark> *snort*\
bba has quit [Ping timeout: 252 seconds]
<companion_cube> hmm, where?
<whitequark> old
<whitequark> but I was under a rock
<companion_cube> ah
<companion_cube> well, I'm still naive or optimistic enough to believe this stdlib problem will improve
<Drup> whitequark: should I put it in Attr ?
<Drup> Arg*
<whitequark> mhm, no
<whitequark> Arg is for dissecting attributes
cdidd has quit [Ping timeout: 244 seconds]
<companion_cube> grrr, unix programming, so annoying when the thing just blocks
ggole has joined #ocaml
<hcarty> https://opam.ocaml.org/archives/ppx_import.1.0+opam.tar.gz - does not exist. Does opam.ocaml.org only mirror the latest version of a package?
<hcarty> Oh... never mind, 1.0 doesn't exist any longer?
<whitequark> hcarty: I killed it, yes
<whitequark> that seems to cause more problems than I ever anticipated...
<hcarty> whitequark: I see the opam-repository PR. Yeah, it broke some CI stuff here, unfortunate timing on the build I think
<Drup> whitequark: should I normalize deep inside the type expression ?
<whitequark> Drup: yes
<whitequark> wait
<whitequark> hm
<whitequark> hmmmm
<whitequark> yes, in case someone's going to match [%type: int list]
<whitequark> which appears to us as Pervasives.int Pervasives.list
<whitequark> I thnk I have such code in protobuf
cdidd has joined #ocaml
<Drup> there is not longident field in mapper, that would have make things simpler :/
solrize has quit [Ping timeout: 250 seconds]
pierpa` has quit [Read error: Connection reset by peer]
pierpa` has joined #ocaml
<hcarty> whitequark: Thank you for opam-cross-windows by the way - it's worked very well for me so far, in combination with MXE
<hcarty> I have a few packages that I need to submit PRs for
solrize has joined #ocaml
solrize has quit [Changing host]
solrize has joined #ocaml
octachron has quit [Quit: Page closed]
<companion_cube> so, I open a process with Unix.create_process "/bin/sh" [| "/bin/sh"; "-c"; some_str |] pipe1 pipe2 Unix.stderr
<companion_cube> where pipe1 and pipe2 come from calls to Unix.pipe()
<companion_cube> then I try to read from the process' stdout, which works well until I read everthing
<companion_cube> but then, instead of returning 0, `read` blocks
<companion_cube> :(
<companion_cube> I tried using `set_close_on_exec` without success
<whitequark> hcarty: thank the person who paid me to do it, I guess
pierpa` has quit [Ping timeout: 276 seconds]
<companion_cube> okkkkkk
<companion_cube> I have to close manually -_-
christoph_debian has joined #ocaml
<companion_cube> hop, victory dance
ismaelga has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 276 seconds]
AlexRussia has quit [Quit: WeeChat 1.4-dev]
kolko has joined #ocaml
pierpa` has joined #ocaml
cdidd has quit [Ping timeout: 252 seconds]
thibm has joined #ocaml
thibm has left #ocaml [#ocaml]
dsheets has quit [Remote host closed the connection]
tobiasBora has joined #ocaml
dsheets has joined #ocaml
pierpa` has quit [Read error: Connection reset by peer]
pierpa` has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
AlexRussia has joined #ocaml
TheLemonMan has joined #ocaml
pierpa` is now known as pierpa
rgrinberg has joined #ocaml
cdidd has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
mistermetaphor has quit [Remote host closed the connection]
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
cdidd has quit [Ping timeout: 244 seconds]
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 260 seconds]
cdidd has joined #ocaml
octachron has joined #ocaml
rgrinberg has quit [Quit: WeeChat 1.4]
natimic has quit [Ping timeout: 276 seconds]
natimic has joined #ocaml
rgrinberg has joined #ocaml
<Drup> whitequark: do you want tests for all plugins ?
<whitequark> nah just one sanity check
<whitequark> otoh... hm
<whitequark> no, better for all
<whitequark> someone's going to copy-paste the one without the check
<Drup> arg
<Drup> only ref is in Pervasives, and it's mostly not tested in the various deriver
<whitequark> good, so that will also get covered :p
<Drup> grmbl
<gasche> (hi whitequark)
<whitequark> hi gasche
<Drup> whitequark: heh, that was definitly not useless
<Drup> I think fold is buggy with ref
<whitequark> nice
regnat has quit [Ping timeout: 276 seconds]
<Drup> octachron: "extension en place" :D
jackweirdy has joined #ocaml
<Drup> octachron: this article is cool, but mostly for the comical aspect of literal french translation of technical terms :p
<whitequark> which one
jackweirdy has quit [Client Quit]
<whitequark> "(fonctions pourtant utilisées à tour de bras dans un langage fonctionnel comme OCaml)"
<whitequark> google translate translates this as "functions used with a vengeance"
BitPuffin has quit [Read error: Connection reset by peer]
<companion_cube> :D
<companion_cube> not exactly
BitPuffin has joined #ocaml
<companion_cube> basically, "used a lot"
<whitequark> Google is not wrong
<whitequark> lol system z
<whitequark> there's also a big push to use swift on system z
<octachron> Drup, are you implying that parsing "deverminer un glaneur de cellules" takes some time? :p
<whitequark> "Debugging a cell gleaner" ok
<whitequark> I don't even have theories
<Drup> whitequark: garbage collector
<octachron> whitequark, look at the initials: gc
<whitequark> ...
<companion_cube> cell gleaner :D
<companion_cube> oh my
<companion_cube> is this code in the compiler?
<Drup> Frankly, "Glaneur de Cellules" is worthy of quebecois translations.
myst|fon has joined #ocaml
leyyin has quit [Ping timeout: 250 seconds]
<adrien> companion_cube: playing with pipes and sub-process outputs and inputs is always a bit tricky
<adrien> you're tied to the unix roots
<maker> So I am using nocrypto now
<adrien> it's way too easy to forget to close half of the pipe
<maker> and I want to print a Numeric.Z.t in hex format
<maker> apparently there's only pp_print and to_cstruct_be, and both are a mess and don't really do what I want
<maker> is there a way to have a hex-representation of a bignum? If not, adding it would be appreciated?
<gasche> for stdlib's bigints, I'm pretty sure it's possible
<gasche> for Numeric.Z.t, it looks like it was not planned for
<gasche> (the to_string function is too inflexible, it seems)
<maker> mm but I'm reading a rsa private key, and print out some values
<companion_cube> adrien: exactly
<companion_cube> but now I'll remember
<gasche> another solution would be to have a function from Z.t to (int32 array) or (int64 array), with a specified endianness
<gasche> so that you could iterate on these digits and print their hexa values (%lx or %Lx)
<maker> gasche: yep, but that one doesn't seem to be there as well
mistermetaphor has joined #ocaml
<maker> maybe I can do something with the pp_print function?
<maker> even if that one is more for debugging
<Algebr> I am making a class like so: class foo ?arg1 ?arg2 needed = object end and then have a function that goes: let bar (f: foo), but when doing: bar (new foo "Hello") I get a type error because it is complaining about the structucal type not matching, that expected foo but got <arg1: 'a option> and so on
<gasche> maker: do you have a link to the up-to-date documentation of Numeric.Z? the one I found online doesn't seem to have pp_print, I don't know what the type is
<companion_cube> I'm writing a build system!
<gasche> welcome to the club :-)
<zozozo> companion_cube: your oasis refactoring ?
<companion_cube> no, it's only a toy actually :)
bba_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<companion_cube> more on this soon, but I'm not going to compete with the real ones
<gasche> Algebr: do you have a self-contained piece of code to test and reproduce?
<companion_cube> it's pretty fun though
bba has joined #ocaml
<maker> gasche: no I actually found it using utop and in here https://github.com/mirleft/ocaml-nocrypto/blob/master/.ocamlinit
<gasche> Nicolas Pouillard wrote a few others build systems for OCaml that he did not release
bba has quit [Client Quit]
<Algebr> gasche: one moment I will
<whitequark> accidentally releasing an OCaml build system ~ accidentally releasing anthrax spores from a bioresearch facility
<adrien> companion_cube: lwt might be the thing you're really looking for
<companion_cube> whitequark: :)
al-damiri has joined #ocaml
<companion_cube> adrien: about the unix stuff, you mean?
<adrien> yeah
<companion_cube> well, sure, but I really don't want Lwt in this program
<companion_cube> I fixed it anyway
<gasche> maker: so actually this Z type seems to come from Zarith
<gasche> so you should be able to use something like
<gasche> Z.format "%x" foo
<maker> holy crap you are right
<maker> what is zarith?
<maker> gasche: thanks thanks thanks!
slash^ has quit [Read error: Connection reset by peer]
<maker> gasche: so there's this module Z in package zarith, and there's this other module Z in Nocrypto.Numeric
<maker> and they are the same?
<maker> no, I guess no
<gasche> so Nocrypto.Numeric.Z re-exports Zarith.Z, plus adds some sexplib conversion functions
<gasche> the way I guessed this is by looking for the source of Z in nocrypto, not finding out, and then looking at the library dependencies of the project
<maker> fantastic
jken has joined #ocaml
<flux> algebr, works on my computer(TM)
octachron has quit [Ping timeout: 244 seconds]
octachron has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
<Algebr> what the hell, the simple example works but the hard one doesn't will post up real one then
kakadu has joined #ocaml
<flux> I guess if you fully apply the function using labels only, and you have optional arguments, you need to have the additional (ie.) unit argument.. ?
<Algebr> but I gave the two required labeled args
<flux> yes, but you put them using labels
<flux> ie. this fails: bar (new foo ~needed:"hello") but this works: bar (new foo "hello")
<Algebr> bah, adding a trailing unit works, this still doesn't make sense to me
<flux> what unit?
<Algebr> Oh wait, I remember this labels thing, nvm coming back to me
<Algebr> the compiler type error was useless
BitPuffin has quit [Read error: Connection reset by peer]
<Algebr> rather it could have been more helpful
<flux> file a bug.. :)
<Algebr> yes i should, mantis right, not github
<flux> "A function taking some optional arguments must also take at least one non-optional argument." says the manual, so I think that's maybe a bit insufficient
rgrinberg has joined #ocaml
<Algebr> but the labels are non optional
<flux> indeed.
rgrinberg has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
dsheets has joined #ocaml
ggole has quit []
<hcarty> Algebr: Yes to mantis. And there is (was?) a "better errors" project which helped with errors like this. I don't know what happened to it though
jken has quit [Quit: Leaving]
dsheets has quit [Remote host closed the connection]
yegods has quit [Remote host closed the connection]
__y is now known as _y
<Algebr> chenlou (sp?) still working on it
AllanDaemon has joined #ocaml
<AllanDaemon> hi. I'm struggling with basic stuffs. How do I use a library installed by opam (extlib) in the ocaml repl shell?
<gasche> you should probably use "utop" instead of "ocaml" as your repl
rgrinberg has quit [Ping timeout: 250 seconds]
<zaquest> does ocaml/opam has something akin to hackage? i mean single source of documentation. ocaml.org has this link `access package docs` which leads to opam package index, but it's not the docs i expected to see :D
<gasche> not yet
Sim_n has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 276 seconds]
<AllanDaemon> gasche: Oh, I wish i could use utop. But every time I tried to install it (ubuntu, debian, etc), it fails in some part. THe last one was a bug that I don't know if stills unfixed. Now I`m running into different bug at least. So, again, I can't use utop. And I still don't know how to just use a library in the REPL.
<whitequark> #require "library";;
mistermetaphor has quit [Remote host closed the connection]
mistermetaphor has joined #ocaml
sz0 has joined #ocaml
<AllanDaemon> Unknown directive `require'.
<AllanDaemon> the command was `# #require "extlib";;`
<whitequark> #use "topfind";; before that
<whitequark> you may want to put #use "topfind";; into ~/.ocamlinit
Anarchos has joined #ocaml
yegods has joined #ocaml
nicholasf has joined #ocaml
<AllanDaemon> whitequark, thanks. It worked now. For someone who comes from python, where `sudo pip install library; python; import library` the ocaml way is too hard and complicated. Perhaps This is something that can be simplified. Or at least improve the docs, as I trying all day find a doc that answers that and have frustratedly failed
<AllanDaemon> ops, text cuted
<AllanDaemon> but thanks whitequark
chenglou_ has joined #ocaml
mattg_ has joined #ocaml
<Algebr> AllanDaemon: #require "foo" is sort of like import foo
hyperbor1ean has joined #ocaml
<Algebr> AllanDaemon: I also have a blog post that might help with jargon and getting up to speed: http://hyegar.com/2015/10/20/so-youre-learning-ocaml/
Guest33283_ has joined #ocaml
<AllanDaemon> But for #require "foo", i need the `#use "topfind";;` first. And i am googling this all day and hadn't found these commands.
jrslepak_ has joined #ocaml
<AllanDaemon> Algebr, I' read it. Thanks
<companion_cube> :/
<companion_cube> build systems make me sad
boegel|quassel has joined #ocaml
ggherdov has quit [Ping timeout: 268 seconds]
averell has quit [Ping timeout: 268 seconds]
chenglou has quit [Ping timeout: 268 seconds]
Guest33283 has quit [Ping timeout: 268 seconds]
mattg has quit [Ping timeout: 268 seconds]
whitequark has quit [Ping timeout: 268 seconds]
darius93 has quit [Ping timeout: 268 seconds]
rpip has quit [Ping timeout: 268 seconds]
cantstanya has quit [Ping timeout: 268 seconds]
atsampso1 has quit [Ping timeout: 268 seconds]
hyperboreean has quit [Ping timeout: 268 seconds]
bitbckt has quit [Ping timeout: 268 seconds]
jrslepak has quit [Ping timeout: 268 seconds]
boegel has quit [Ping timeout: 268 seconds]
dariusc93 has joined #ocaml
mattg_ is now known as mattg
chenglou_ is now known as chenglou
cantstanya has joined #ocaml
bitbckt has joined #ocaml
ggherdov has joined #ocaml
rpip has joined #ocaml
whitequark has joined #ocaml
<octachron> merlin bug with index operators is ... confusing to say the least
atsampson has joined #ocaml
rgrinberg has joined #ocaml
<adrien> gasche: I don't even remember about saffire actually
<adrien> oh
<adrien> well, I remember the troubles to find the sources I think
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
doecnt has quit [Ping timeout: 276 seconds]
yegods has quit [Remote host closed the connection]
octachron has quit [Quit: Leaving]
<whitequark> companion_cube: y u no CCString.find : needle:string -> haystack:string -> int
<companion_cube> you mean rename the arguments?
<whitequark> no
<whitequark> stdlib doesn't have a function to find a string
<whitequark> oh, CCKMP
<whitequark> ... hm
regnat has joined #ocaml
<adrien> sounds like CCCP
<companion_cube> whitequark: do you have 0.17?
<companion_cube> there definitely is CCString.find
<companion_cube> ah, you might have missed the "inclode module type S"
<adrien> :P
<companion_cube> CCString.find ~sub:"na" "banana" ----> 2
<companion_cube> behold! I am ready to unleash my build system onto the world!
<companion_cube> if only it could infer when -thread is needed!
<companion_cube> :D
ocaml_n00b has joined #ocaml
<whitequark> oh
<companion_cube> the module type is used for sharing a few signatures with CCString.Sub (slices)
<whitequark> right
<companion_cube> ok, now let's blog
* whitequark is fucking up^W^Wfixing ctypes to not try running code it just compiled
<whitequark> it involves the C preprocessor and assumptions about how exactly object files are laid out ^_^
<companion_cube> adrien: you'd be proud of how many wheels I'm using
<companion_cube> whitequark: I don't want to know :DD
<adrien> companion_cube: 5 at least I hope
<whitequark> it used to involve recursive C++ templates
<companion_cube> BuildDepends: maki, containers, containers.data, oasis-parser, lwt.ppx
<whitequark> but I simplified that
<companion_cube> it's a bit sad that one dep is not mine though
<companion_cube> whitequark: ah, I saw that on twitter
<adrien> :D
hcarty1 has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]
<companion_cube> although, those wheels make my build system under 300 lines
<whitequark> it's horrifying. i love it
hcarty has quit [Ping timeout: 246 seconds]
<hcarty1> companion_cube: oasis-parser?
zaquest has quit [Ping timeout: 246 seconds]
<companion_cube> ah, I didn't show you
cow-orker has quit [Ping timeout: 246 seconds]
struk|desk2 has joined #ocaml
struk|desk has quit [Remote host closed the connection]
<companion_cube> still needs some polishing, but it parses the _oasis files I tried it on
zaquest has joined #ocaml
cow-orker has joined #ocaml
<Drup> (23:09:01) companion_cube: it's a bit sad that one dep is not mine though
<companion_cube> shall I add "sarcasm" to that line?
<Drup> If you reimplement lwt, I'm going to hit you x)
<companion_cube> :D
<companion_cube> I won't
* whitequark preemptively hits companion_cube
<companion_cube> ouch
<hcarty1> companion_cube: Nice - maybe I can use this in oasis2merlin
yegods has joined #ocaml
<Drup> whitequark :D
<companion_cube> I think it's better if you can integrate it directly into oasis, as a plugin
<whitequark> who's going to write the killer app, oasis2devnull
<Drup> hcarty1: yes, it's a decent way to do it
rwmjones has quit [Ping timeout: 246 seconds]
<hcarty1> Drup, companion_cube: That's the eventual plan. I need to dig into oasis enough to do that first.
sepp2k has quit [Quit: Leaving.]
rwmjones has joined #ocaml
A1977494 has joined #ocaml
ocaml_n00b has quit [Ping timeout: 250 seconds]
A19774941 has quit [Ping timeout: 260 seconds]
<companion_cube> hcarty1: I think you can take a look at existing plugins, such as META
<companion_cube> yours should be pretty close
pierpa` has joined #ocaml
tane has joined #ocaml
A1977494 has quit [Quit: Leaving.]
pierpa has quit [Ping timeout: 252 seconds]
<rgrinberg> does ocamlgraph come with formatters? what does everyone do to pp graphs?
pierpa` is now known as pierpa
boegel|quassel is now known as boegel
<companion_cube> erf
<companion_cube> I think it comes with graphiz printers, at least
nicholasf has quit [Remote host closed the connection]
<hcarty1> rgrinberg: It does, what companion_cube said
<hcarty1> companion_cube, Drup: If an all-powerful .project format happens that may be more useful as an oasis plugin. That could take a while though
<companion_cube> what would this .project file look like?
<rgrinberg> I know about the graphviz output, I meant something usable from the toplevel though
<hcarty1> companion_cube: Something shared between merlin and other editor-focused tools. There was noise about it on the ... ocp-index issues like maybe?
<rgrinberg> it would be nice if this hypothetical formt was json based
<rgrinberg> so you can exrtact stuff out of it for free with command line tools
<Drup> rgrinberg: I would still use graphviz ...
<Drup> Just do a shell call to xdot
<zaquest> what is the current state of parallel programming in ocaml? from google it seems that it's poorly supported in ocaml, but all discussions are several years old.
tane has quit [Ping timeout: 244 seconds]
<gasche> zaquest: with the current runtime, you get parallelism by spawning separate processes
<malc_`> gasche: IOW nothing much has changed
<gasche> there are libaries to abstract over this, such as Parmap ( https://github.com/rdicosmo/parmap ) or Functory ( http://functory.lri.fr/About.html )
<gasche> malc_`: yep
<AllanDaemon> Hi. I'm trying to print out result of a function, which is a Tokens list generated by a lexer. I gave up do print it compiled. I;m using the ocaml REPL for trying to do that. I invoke with `rlwrap ocaml -I _build/ {sintatico,lexico,carregador}.cmo -stdin < auto.carregador.m;`
<Drup> rgrinberg: is the graph you are trying to print of a specific form ?
<zaquest> gasche, i see, thank you
<AllanDaemon> the auto,carregador,ml just calls the function which returns a tokens list. in the REPL they print the result, but then I invoke this way, with the -stdin param, it prints nothing.
<gasche> AllanDaemon: maybe try with -noprompt instead of -stdin?
<gasche> not sure why you don't want to go the compiled route; you don't want to write a printing function for your tokens?
<gasche> (maybe [@@deriving show] would be useful here)
<rgrinberg> Drup:nah, a simple edge list would suffice it's just for debugging. I can easily write that I guess
<AllanDaemon> gasche: yeay, the -noprompt worked.
<Drup> rgrinberg: xdot is stil better :D
tane has joined #ocaml
<gasche> AllanDaemon: -stdin's documentation specifies that it runs the file "as a script file", which means it silences toplevel output
<rgrinberg> would be awesome if you could use ocamlgraph within an iocaml notebook and see the xdot rendered inline :P
<rgrinberg> I can dream
<Drup> Huum
<gasche> rgrinberg: just a few pull requests away!
<Drup> that doesn't seem so hard
<rgrinberg> gasche: it's probably not practical because I think I'd lose utop's auto completion right?
<AllanDaemon> No, I don't want to write a printing function to do it. I really believe that this is something the language should provide, I;m from python, just a print solves it all.
cthuluh has quit [Quit: leaving]
<AllanDaemon> And I don't have idea of how to write it, but i guess it would be a big piece of code, and i am constantly changing my code.
<malc_`>
<malc_`> In summary: there is no SMP support in OCaml, and it is very very
<malc_`> unlikely that there will ever be. If you're into parallelism,
<malc_`> better investigate message-passing interfaces.
<malc_`>
cthuluh has joined #ocaml
<whitequark> >2002
<whitequark> there's a multicore OCaml already
<whitequark> (not merged)
<gasche> malc_`: this is not true anymore, given the good progress of the multicore-ocaml project
<malc_`> gasche, whitequark: i know
<gasche> so what's the quote for?
kakadu has quit [Remote host closed the connection]
<malc_`> I found it peculiar back then and in a hindsight Xavier was very much wrong
<gasche> his point about the absence of a good programming language model for concurrency still stands, though
<whitequark> I think he wasn't unreasonable, given how the entire core team is part-time maintainers and has been for all this time
<malc_`> all that said, the situation we have now is precisely the one from 14 years ago, not merged stuff notwithstanding
<malc_`> gasche: sure
<whitequark> it is "very unlikely" that a team of part-time maintainers can produce an SMP language implementation
<malc_`> whitequark: i didn't say he was unreasonable
<Drup> rgrinberg: https://github.com/anvaka/VivaGraphJS + ocamlgraph's dot output
<malc_`> just that his hunch where things are heading was way off
loli-pyon has quit [Remote host closed the connection]
<Drup> gasche: for *concurrency* ? No it doesn't
<companion_cube> well, lwt is ok, but it's not perfect
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<rgrinberg> Drup: oh I thought you would just write out some svg and then import it in html
<companion_cube> I'd rather have effects
<Drup> companion_cube: sure, and in both cases, it's a decent programming language model for concurrency :D
<Drup> rgrinberg: you need a dot -> svt converter in the browser
<whitequark> shared memory is not a decent model for concurrency
<Drup> which is equivalent to what I listed
<Drup> linked*
<companion_cube> decent, yeah, but "good", hmm
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<companion_cube> it's a good implementation of a decent model :p
<gasche> what are the concurrent communication primitives provided by Lwt?
<gasche> (besides bind for direct value dependency)
<companion_cube> join,pick?
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has joined #ocaml
pyon has joined #ocaml
amnn has quit [Client Quit]
Anarchos has joined #ocaml
<gasche> I'm skeptical about this solving concurrency in the general case
<gasche> although it may very well be enough when there is no parallelism involved
AllanDaemon has quit [Ping timeout: 252 seconds]
<companion_cube> noes, I have a EMFILE error :((
nicholasf has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
hcarty1 has quit [Ping timeout: 260 seconds]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
amnn has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
badon has quit [Ping timeout: 252 seconds]
tane has quit [Quit: Verlassend]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<companion_cube> what's the state of backtraces in lwt, already?
<companion_cube> I use lwt.ppx, but don't get much
ismaelga has joined #ocaml
leyyin has joined #ocaml
<aantron> the state of backtraces in lwt is i will look at it eventually, but if someone else wants to contribute information or PRs sooner, i will look as they come in
leyyin has quit [Client Quit]
<Drup> it's clearly better with the ppx, though.
snhmib has quit [Ping timeout: 260 seconds]
silver has quit [Ping timeout: 246 seconds]
badon has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
madroach has quit [Ping timeout: 244 seconds]
Algebr has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
Reshi has joined #ocaml
mistermetaphor has joined #ocaml
mistermetaphor has quit [Ping timeout: 276 seconds]
walter|r has joined #ocaml
pyon has quit [Remote host closed the connection]
al-damiri has quit [Quit: Connection closed for inactivity]