adrien 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.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jackweirdy has quit [Quit: Textual IRC Client: www.textualapp.com]
Kakadu has quit [Remote host closed the connection]
t4nk545 has quit [Quit: Page closed]
damason has joined #ocaml
<lokien> how can I print a list?
<aantron> whats in the list?
<aantron> if strings, l |> List.iter print_endline
<lokien> strings, wrapped in Some
<aantron> l |> List.iter (function Some s -> print_endline s | None -> ())
<aantron> (this isnt nicely-formatted source)
<lokien> I'll format it nicely, thanks :)
<lokien> I'm rewriting my clojurey tictactoe game in ocaml, the goal is to make it shorter
<lokien> but now I think it'll be.. hard :D
<aantron> well hope it goes well :)
lokien_ has joined #ocaml
<pierpa> lokien: does something like this helps? https://bpaste.net/show/9655640bfd66
aantron has quit [Remote host closed the connection]
<lokien> can I paste it here? it'd be nice if someone more competent looked at it
struk|desk|away is now known as struk|desk
<lokien> pierpa: I just wanted elements of that list! but your solution is interesting :D
<struk|desk> lokien: you should definitely encode the board in a coordinate free fashion if you haven't already !
<lokien> struk|desk: I'm using a "hashmap" for that, since that's only 3x3
<lokien> like [("1A","-");("1B","-")...]
<struk|desk> so coordinate based, basically
<lokien> why is that bad?
<lokien> and how would you do it?
picoleau has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
lokien has quit [Quit: Leaving]
<lokien_> struk|desk: hm? :(
<struk|desk> lokien: if you avoid indexing by numbers you get alot of nice structural integrity for free
<lokien_> struk|desk: I'm indexing by strings!
<struk|desk> but I am trying to give you a good example. I saw a great one in ocaml book of some sort
<struk|desk> indexing at all I mean :)
<lokien_> hm, okay, I'll wait
<lokien_> thanks for your commitment btw :D
<struk|desk> give me a minute, but obviously doing a straight forward grid has advamtages too
<fds> What should the speclist entry be for an anonymous argument (with Arg)? The manual says `Arguments not preceded by a keyword are called anonymous arguments', but then I get a type error saying it's not an Arg.spec.
madroach has joined #ocaml
<lokien_> struk|desk: I thought about making it customizable (user would specify what grid would he want), but it was too hard in clojure
<fds> (If I don't precede my ref with a keyword.)
picoleau has left #ocaml [#ocaml]
Nairwolf has quit [Quit: WeeChat 1.4]
<pierpa> fds: it's explained in the 'parse' doc, I think
<fds> I've tried reading it. :-P
<fds> I wrote this, which does what I want, but with -f: http://pastebin.com/TyPeKxkj
<fds> I appreciate any tips on deuglifying my code too, of course. :-)
<pierpa> let me try...
<fds> Maybe someone should put an example in the manual...
* fds might file a bug about that.
<lokien_> by the way, why don't we have anything like clojuredocs? we've got no examples in docs, no nothing
<lokien_> just type signatures and sometimes there's a bit of text
<fds> I don't know what Clojuredocs is, but there are some examples in the manual.
<fds> Not many though, sadly.
<lokien_> it's a site where you can find clojure functions. community-powered
<fds> I've heard that they appreciate bug reports or, even better, patches though.
<lokien_> there's explanation of every one of it, plus people add examples
<lokien_> s/of/for
<fds> http://ocamloscope.herokuapp.com/ can help you find functions, but it doesn't provide documentation.
<fds> It would be nice to have more documentation, but it's up to us if we want something `community-powered'.
<lokien_> yeah, I'm using it sometimes
<lokien_> why wouldn't we want it? duh
<fds> I mean `if we want it, it's up to us [to make it]'.
<lokien_> web development, anyone?
malc_ has quit [Quit: leaving]
<lokien_> I can try to do something, but it'll suck, since I'm only writing cli games
<pierpa> fds: here's the example: https://bpaste.net/show/70e244618809
rand__ has quit [Quit: leaving]
<pierpa> but make the string "-foo" instead of "foo"
<lokien_> struk|desk: have you found it?
<pierpa> fds: and here's a less embarassing example: https://bpaste.net/show/882c73649c52
<fds> pierpa: Does the - make any difference? They seem to work the same here.
<pierpa> fds: manual says it should begin with -
<pierpa> without the - it is not recognized
<fds> Hmm, ah, for the auto-generated output stuff.
<pierpa> I mean, if want to use the -foo option argument
<fds> Wait, no, -help still lists it without the -.
<fds> Heh.
<fds> No, it doesn't.
<pierpa> yes, but if you pass "foo" it will be handled as an anonymous
<fds> Wait, it does. I'm confusing myself with too many instances of `foo'.
<pierpa> :) well, delete the whole foo thing. I put it in for experimenting. I had never used Arg myself
<pierpa> aha! you mean the foo in the message!
<struk|desk> lokien_: I tried writing one myself but lost in a sea of recursion. but this looks 100% relevant: http://jeremy.fix.free.fr/Teaching/caml.html
<lokien_> struk|desk: oh noez, why did you link it to me
<lokien_> I can't look at it
<struk|desk> ha ok
<lokien_> but it's so tempting
<struk|desk> then don't
<lokien_> I want to look at it!
<lokien_> screw it, I will :D
<struk|desk> any how, the main approach for any game is treat the state of it as a graph
<struk|desk> and there you get folding and mapping etc whatnot for free
<struk|desk> sometimes adjancies lists, or trees to represent the state transitions, etc.
<lokien_> hmhm, is it a game with AI?
<struk|desk> in that case it is I think, but the AI modeling can be used to implement the game state
FreeBirdLjj has joined #ocaml
<lokien_> struk|desk: by the way, what do you mean by a graph?
<groovy2shoes> presumably a set of nodes with a set of edges
<lokien_> too abstract for me. for now
shinnya has quit [Ping timeout: 248 seconds]
<struk|desk> lokien_: yeah a graph theory graph. a strutural entity represented inductively rather than explicitly with nested arrays
<struk|desk> (aka sparse, typically)
<lokien_> struk|desk: oh, I have to learn graph theory
<struk|desk> well you should be it's not rocket science graph theory to do what I'm saying. anyhow you don't need to go down my road, its overkill for tictacto if anything.
<struk|desk> you probably apply graph theory all the time without even realizing it
<lokien_> struk|desk: let's go all in :D
<lokien_> it's 3am btw, so I'll dive into it tomorrow
<struk|desk> one classic example btw is maze generation.
<lokien_> procedural?
<struk|desk> you can do it with relationships of cells to each other, emitting a sparse graph, or you can do something more matrix-esque
<struk|desk> the obvious solution for many people is to simply just whip up an array of cells equal to edge / blank, but point is sometimes there are better more subtle representations
<lokien_> I'm so happy I can do all this crazy stuff now
<lokien_> types ftw
<lokien_> wouldn't it create nonsensical mazes 90% of the time?
<lokien_> unless we're doing them by hand
FreeBirdLjj has quit [Remote host closed the connection]
<struk|desk> if you create mazes by randomly picking a set of other edges to belong to, and sometimes making your own set, and you set the probability in a good way, it's not so bad
<struk|desk> like 90% join a cluster, 10% make your own (just guessing, no idea what make sense)
FreeBirdLjj has joined #ocaml
<lokien_> but going full random would suck
<lokien_> do we have any decent gui/graphics library?
<struk|desk> I haven't used any myself but there are several.. lablgtk is popular, there are various "pure" opengl ones too, somewhere here probably knows. did you read the ocaml gamer blog yet?
<struk|desk> I would personall play with the latest qt script bindings or whatever they are called these days, but that's a bias
<lokien_> I don't care about being pure, tbh
<lokien_> ocaml gamer blog?
<lokien_> cranial burnout?
<struk|desk> yea
<lokien_> I hadn't found much helpful content in here
<lokien_> maybe I searched poorly
<lokien_> it's sad that the last post is from 2014. today I'd found some ocaml tool with "latest pending" version from 2008.
dysfunc has joined #ocaml
<struk|desk> dysfunc: just get rid of the t preceding the equals sign
<struk|desk> dysfunc: you accidentally wrote let f x = function x -> ... basically, but you meantion let f = function x ->
pgiarrusso_ has joined #ocaml
pgiarrusso has quit [Ping timeout: 264 seconds]
pgiarrusso_ is now known as pgiarrusso
<struk|desk> dysfunc: you good? if not I can paste a soln in stack over flow, if it lets me anyhow
<dysfunc> ok i'll try
<dysfunc> sorry was making some food
<dysfunc> thank you
ygrek has joined #ocaml
<dysfunc> yup that worked fine
<dysfunc> now to test the less reduced solutions i had commented out
<dysfunc> cool. all working.
<struk|desk> dysfunc: nice, good luck
ygrek has quit [Ping timeout: 250 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
larhat has joined #ocaml
larhat has quit [Ping timeout: 248 seconds]
dysfunc has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Algebr has joined #ocaml
_berke_ has joined #ocaml
adarqui_ has quit [Quit: leaving]
damason has quit [Read error: Connection reset by peer]
damason has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
yegods_ has joined #ocaml
yegods has quit [Ping timeout: 272 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
<icicled> I'm trying to use react in utop but after the first signal nothing gets invoked
<icicled> is there anything special I need to load?
<icicled> it works find when I compile it as bytecode or native
<icicled> mv, figured it out - I wasn't keeping the reference around
<icicled> e.g. I was doing: S.map print_int mysig;;
<icicled> and so it would trigger immediately but not subsequently
struk|desk is now known as struk|desk|away
MercurialAlchemi has joined #ocaml
abbiya has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
tmtwd has joined #ocaml
tmtwd has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
Algebr has quit [Ping timeout: 240 seconds]
Algebr has joined #ocaml
Algebr is now known as Guest5859
Guest5859 is now known as Algebr`
abbiya has quit [Ping timeout: 264 seconds]
antkong has quit [Quit: antkong]
abbiya has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 248 seconds]
struk|desk|away has quit [*.net *.split]
patronus has quit [*.net *.split]
Reventlov has quit [*.net *.split]
smondet has quit [*.net *.split]
jave has quit [*.net *.split]
djellemah has quit [*.net *.split]
bitemyapp has quit [*.net *.split]
seliopou has quit [*.net *.split]
gbarboza has quit [*.net *.split]
sternenseemann has quit [*.net *.split]
eikke has quit [*.net *.split]
smondet has joined #ocaml
Reventlov has joined #ocaml
sternenseemann has joined #ocaml
bitemyapp has joined #ocaml
gustav___ has quit [*.net *.split]
lukky513 has quit [*.net *.split]
w1gz has quit [*.net *.split]
srcerer has quit [*.net *.split]
rks` has quit [*.net *.split]
Algebr`` has quit [*.net *.split]
Maxdamantus has quit [*.net *.split]
DanielRichman has quit [*.net *.split]
relrod has quit [*.net *.split]
tvaalen has quit [*.net *.split]
kandu has quit [*.net *.split]
zxqdms has quit [*.net *.split]
srax has quit [*.net *.split]
SHODAN has quit [*.net *.split]
jave has joined #ocaml
Maelan has joined #ocaml
relrod_ has joined #ocaml
gustav___ has joined #ocaml
rks` has joined #ocaml
kandu has joined #ocaml
tvaalen has joined #ocaml
relrod_ has quit [Changing host]
relrod_ has joined #ocaml
DanielRichman has joined #ocaml
gbarboza has joined #ocaml
patronus has joined #ocaml
djellemah has joined #ocaml
seliopou has joined #ocaml
struk|desk|away has joined #ocaml
zxqdms has joined #ocaml
Maxdamantus has joined #ocaml
SHODAN has joined #ocaml
srax has joined #ocaml
Algebr`` has joined #ocaml
kandu is now known as Guest29407
lukky513 has joined #ocaml
w1gz has joined #ocaml
Johann has joined #ocaml
srcerer has joined #ocaml
damason has quit [Ping timeout: 248 seconds]
abbiya has quit [Quit: Leaving]
silver has joined #ocaml
MercurialAlchemi has joined #ocaml
pierpa has quit [Ping timeout: 240 seconds]
Madars has quit [Ping timeout: 240 seconds]
Madars has joined #ocaml
tane has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
so has joined #ocaml
FreeBird_ has joined #ocaml
eikke has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
jen6 has joined #ocaml
malc_ has joined #ocaml
yegods_ has quit [Remote host closed the connection]
jen6 has quit [Quit: Page closed]
ggole has joined #ocaml
warp has joined #ocaml
emmanueloga_ has joined #ocaml
l1x has quit [Ping timeout: 260 seconds]
dch has quit [Ping timeout: 260 seconds]
rpip has quit [Ping timeout: 260 seconds]
emmanueloga has quit [Ping timeout: 260 seconds]
emmanueloga_ is now known as emmanueloga
dch has joined #ocaml
l1x has joined #ocaml
rpip has joined #ocaml
antkong has joined #ocaml
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
orbifx has joined #ocaml
jwatzman|work has joined #ocaml
warp has joined #ocaml
elfring has joined #ocaml
dsheets has joined #ocaml
darkf has quit [Quit: Leaving]
_andre has joined #ocaml
dsheets has quit [Remote host closed the connection]
rand__ has joined #ocaml
antkong has quit [Ping timeout: 240 seconds]
lokien has joined #ocaml
antkong has joined #ocaml
lokien has quit [Client Quit]
Simn has joined #ocaml
troydm has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
<orbifx> Any recommendations for message passing in OCaml?
<orbifx> Going to try forking and passing messages from one process to the other
<malc_> orbifx: input_value/output_value :)
mstevens has joined #ocaml
<mstevens> What's a good learn-ocaml book? Real World Ocaml looks promising
Kakadu has joined #ocaml
<mstevens> I've got Practical Ocaml but I'm finding it a bit... less than good.
<orbifx> There are only a few free ones, try starting with them mstevens. Skim read them to see if they suit your preferences.
lokien has joined #ocaml
<malc_> mstevens: Hickys book
<orbifx> malc_: something that maybe encapsulates forking and value sharing (via messages)
lokien_ has joined #ocaml
<mstevens> malc_: is that Real World Ocaml?
<malc_> orbifx: i just eneded with passing strings and parsing when i needed that
<mstevens> or maybe Introduction to Ocaml
<malc_> Intro...
<mstevens> orbifx: based on online testing, RWO looks most promising
<flux> marshalling is probably a decent solution for message passing within a single program
lokien has quit [Remote host closed the connection]
<mstevens> orbifx: but I wanted to see if there was any "no! you can't possibly read that" type sentiment
<malc_> flux: not if one of recepients is C :)
<orbifx> mstevens: if it works for you, it's what it comes down too. (http://ocaml.org/learn/books.html)
<orbifx> flux, mstevens: I would like to be able to pass messages via sockets, but not to begin with.
<Kakadu> Hey, folks
<orbifx> this is why I'm looking for some abstraction. Maybe a library that hides the details of the message passing. But I need forking to simplify some concurrency issues.
<orbifx> hey Kakadu
lokien has joined #ocaml
<Kakadu> orbifx: Sorry, I didn't found much time to build an example that involves Lwt
* mstevens invests in a copy of RWO
<orbifx> mstevens: I understand, I don't criticise your request for commentary. It could save you time. I found RWO to be a bit petandic, but still a fine book. It's just that _I prefer_ books that explain the fundamentals and princples rather then teaching you how to do something.
<mstevens> orbifx: I like a balance, but it's a tricky line to follow
<orbifx> Kakadu: no trouble, I'm juggling a lot of persuits right now, so it's ok. I will probably use fork anyway to future-proof the design.
<mstevens> orbifx: and then there's Practical Ocaml, which appears to be going for covering the fundamentals but not explaining them properly.
<orbifx> mstevens: true. Ultimately better to just get on with it. Read two books if it helps and "good enough" is a fine too :P
<edwin> there are some libraries on opam that fork workers (functory,forkwork,procord,...) but I haven't tried any of them so I wouldn't know which one to recommend
<orbifx> edwin: checking now
<mstevens> orbifx: At some point I suspect I will want a further more abstract "how to make functional things" book
<orbifx> probably
<orbifx> after a tour of many languages over the years, I came to realise that the concepts & data structures matter the most. The function camp seems to closer to those.
Algebr` has quit [Ping timeout: 250 seconds]
<orbifx> edwin: the libraries you said seem to be for offloading computation. I just want to have a unix approach to my dedicated processes.
antkong has quit [Ping timeout: 250 seconds]
<orbifx> mpi might what I'm looking for. Reading more now
<elfring> orbifx: Would you like to improve your software design around a library like "Parmap"? https://rdicosmo.github.io/parmap/
tane has quit [Quit: Verlassend]
<orbifx> Would I elfring ? :P
<orbifx> Parmap seems to be geared towards accelerating a computation rather than allowing two distrinct processes to interact bidirectionally and indefinately.
<lokien> I'm an ocaml newbie, can you tell me if this function is any good? formatting, structure etc.
<lokien> (it's tiny)
<reynir> lokien: Seems fine by me, except you will get a type error :)
<reynir> (switch the args to List.iter)
<lokien> it works
<lokien> reynir: 'a Core.Std.List.t -> f:('a -> unit) -> unit
<reynir> Oh, I wasn't aware that you were using core (and that core switched the arguments)
<lokien> sorry for not specifying that
<elfring> orbifx: Are you looking for possibilities to start additional processes by OCaml interfaces?
dsheets has joined #ocaml
<orbifx> elfring: yeah
<orbifx> a master programs starts a gui process which works independently but they exchange messages
Haudegen has quit [Ping timeout: 240 seconds]
dsheets has quit [Remote host closed the connection]
kushal has joined #ocaml
<elfring> How do you think about to discuss a topic like "Cooperation with job submission systems"? https://github.com/rdicosmo/parmap/issues/35
Sorella has joined #ocaml
<elfring> orbifx: Is another view relevant for your use case? Should background processes be started by the graphical user interface of your software application?
lokien has quit [Quit: Leaving]
<orbifx> elfring: my general theory there is that it should be data driven and therefor input driven
<orbifx> looking at the issue now
<orbifx> therefore*
Haudegen has joined #ocaml
<orbifx> If I'm understanding correctly about what you are asking, it doesn't fit parmap
foolishmonkey has joined #ocaml
dksong has joined #ocaml
dksong has quit [Ping timeout: 272 seconds]
<elfring> orbifx: How many data processing would you like to delegate to background processes at all?
dsheets has joined #ocaml
<orbifx> elfring: they are not background processes, just stages of a pileline, or a network.
<orbifx> One deals with the GUI event loop. The other deals with incoming input processing.
<elfring> How do you think about the software design consequences from a recommendation like ", *do not* open a graphic window before calling a Parmap primitive, …"?
<flux> I wish ocaml-multicore will bring us a more elegant Parmap :)
<elfring> orbifx: Do you plan to configure a pipeline of background processes?
malc_ has quit [Quit: leaving]
<orbifx> elfring: are you conducting a survey? :P
<def`> :D
dsheets has quit [Remote host closed the connection]
vincenzoml has joined #ocaml
<vincenzoml> Hi there, I'm running ocaml + opam on windows after installing from http://protz.github.io/ocaml-installer/
<vincenzoml> I need to compile a program that uses ocamlgraph, and ocamlbuild fails, as ocamlgraph is not actually registered with findlib
<vincenzoml> I tried to run it the old way but I keep getting "Unbound module Graph"; I don't understand the proper way to use "-I" in this context; ocamlgraph is in /home/vincenzoml/.opam/system/lib/ocamlgraph
<vincenzoml> any hint?
<vincenzoml> or what is the proper way to add ocamlgraph installed with opam to findlib?
BitPuffin has joined #ocaml
<Drup> it should be added to findlib automatically, so I guess the issue is on windows :/
vincenzoml has quit [Ping timeout: 252 seconds]
<elfring> orbifx: I am not really interested in a survey at the moment. I am trying to find out if I can help you more and if other developers would like to share any more experiences around the software evolution for parallel data processing with the programming language "OCaml"?
yegods has joined #ocaml
<orbifx> thanks elfring. I've come to understand what I need to do to get these processes going. Unfortunately it seems a bit "low-level" approach, but that is not a bad thing. Too much abstraction these days :)
lokien_ has quit [Quit: Connection closed for inactivity]
elfring has quit [Remote host closed the connection]
Thooms has joined #ocaml
iloveunix8955 has joined #ocaml
elfring has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
openplatypus has joined #ocaml
M-Illandan has joined #ocaml
FreeBirdLjj has joined #ocaml
copy` has joined #ocaml
openplatypus has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
FreeBird_ has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
openplatypus has joined #ocaml
M-Illandan has quit [Remote host closed the connection]
Sim_n has joined #ocaml
_berke_` has joined #ocaml
dch_ has joined #ocaml
openplatypus has quit [Remote host closed the connection]
struk|desk has joined #ocaml
Thooms_ has joined #ocaml
Thooms_ has quit [Remote host closed the connection]
gustav__1 has joined #ocaml
Thooms has quit [*.net *.split]
Simn has quit [*.net *.split]
dch has quit [*.net *.split]
struk|desk|away has quit [*.net *.split]
gustav___ has quit [*.net *.split]
_berke_ has quit [*.net *.split]
yawnt has quit [*.net *.split]
keteim has quit [*.net *.split]
dch_ is now known as dch
dhil has joined #ocaml
dsheets has joined #ocaml
yawnt has joined #ocaml
yawnt has quit [Changing host]
yawnt has joined #ocaml
keteim has joined #ocaml
M-Illandan has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
openplatypus has joined #ocaml
dsheets has quit [Remote host closed the connection]
openplatypus has left #ocaml [#ocaml]
openplatypus has joined #ocaml
openplatypus has left #ocaml [#ocaml]
Janni has joined #ocaml
Janni has quit [Client Quit]
Janni has joined #ocaml
openplatypus_ has joined #ocaml
openplatypus_ has quit [Client Quit]
openplatypus_ has joined #ocaml
<Janni> Hello. I'm a Haskell programmer who's currently starting to look into programming with OCaml. I'm currently setting up my environment and tools and so on. I was wondering... is there a convenient way to locally generate the API reference when you install a package with opam?
<Drup> The -d flag, in theory, but few package specify how to compile the documentation.
openplatypus_ has quit [Client Quit]
openplatypus_ has joined #ocaml
<Janni> Oh yes, I see. There's also a flag $OPAMBUILDDOC. Thanks.
<Drup> Most packages installs the .mli, though
openplatypus_ has quit [Client Quit]
<orbifx> Janni: I was once a Haskell programmer... coming into OCaml...
<Janni> OK. Are there tools to browse/search those files or to transform into a browsable format?
<orbifx> Now starting to think how regularly that is being said here :P
MercurialAlchemi has quit [Ping timeout: 250 seconds]
struk|desk is now known as struk|desk|away
pierpa has joined #ocaml
dksong has joined #ocaml
<Janni> Maybe I can be more to the point. When reading code that makes use of multiple libraries, how do I best get to the documentation of a specific function/module/type?
larhat has joined #ocaml
<Drup> There are various tools, depending on how you like things
<Janni> Would you mind just dropping a few names?
<Drup> Merlin works quite well, with the right setup
<Drup> (It gives you both the type and, if available, the documentation)
<Drup> ocp-index too
MercurialAlchemi has joined #ocaml
<Drup> I personally use ocp-browser a lot for that purpose
shinnya has joined #ocaml
<Drup> otherwise, just getting to the hosted documentation online :)
<Drup> (the address should always be available with "opam show <package>")
yegods has quit [Remote host closed the connection]
<Janni> Alright. Thanks for that.
<Drup> You should use merlin anyway regardless
openplatypus_ has joined #ocaml
openplatypus_ is now known as openplatypus
openplatypus has left #ocaml [#ocaml]
openplatypus has joined #ocaml
dksong has quit [Quit: Leaving.]
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
warp has joined #ocaml
<elfring> orbifx: How much are you prepared to fiddle with distributed (background) processes so far?
<orbifx> I'm fiddling with them just now
rfv has quit [Ping timeout: 248 seconds]
<elfring> orbifx: Do programming languages which deal with automatic garbage collection like OCaml provide special software development challenges for the proper handling of parallel tasks and processes?
elfring has quit [Remote host closed the connection]
elfring_ has joined #ocaml
rfv has joined #ocaml
elfring_ is now known as elfring
<flux> the problem is having memory safety and high-performing parallellism in the same package, so yes, there is a challenge
<flux> once someone else (TM) solves them for you, using them is not that challenging :) (more challenging that paralellism in general I think)
<flux> many memory safe language are single-threaded. the big counter-examples are Java and C#, which both have had significant development efforts to make it happen; and then ocaml has the "special problem" of having typically high allocation rate of short-lived objects
<orbifx> what flux said. A search online about OCaml's parallellism turns a lot of conversations and explanations.
<flux> I don't know how Java OCaml performs, though, with a typical high-allocation-rate OCaml program, though..
<Drup> orbifx: well, a non negligible time is spent explaining how concurrency ≠ parallelism (and how OCaml is doing really fine, concurrency wise)
<orbifx> yeah
mietek has quit [Ping timeout: 250 seconds]
<orbifx> what got me Drup was that Lwt doesn't provide parallelism (except for detach) which I pressumed it would.
<orbifx> So gone back to forking and sockets
<orbifx> which is fine, just a mild surprise
struk|desk|away is now known as struk|desk
<elfring> orbifx: Do you try to reinvent a "coding wheel" anyhow?
<Drup> (orbifx: also, Lwt_preemptive.detach is not parallel either)
<orbifx> elfring: no, forking and sockets are fine.
mietek has joined #ocaml
<orbifx> Drup: yeah sorry, mixed with waiting for the task to finish..
<orbifx> Drup: nice, so process spawns a new process in _parallel_?
<orbifx> Meaning the library _parallel_?
<elfring> orbifx: How do you think about to reuse any existing OCaml library for the forking of processes? Is the software "Parmap" one of the next possibilities for this purpose?
<Drup> orbifx: It's exactly what you said, forking and sockets, just with a nice Lwt-friendly API.
<orbifx> elfring: I'm using a library, the `Unix` one.
<orbifx> Drup: after I'm done toying with sockets (for fun's sake) I will give it a spin.
<haesbaert> actually if you read from stdin with lwt, you're already forking+sockets.
<Drup> tell me how it goes, I never actually used it.
<Drup> (I'm rather confident in ivg's abilities, but still :p)
<orbifx> Drup: do you know what kind of medium is used for the stream in `pipe`?
<orbifx> haesbaert: didn't know :P
<haesbaert> any operation on a blocking fd with lwt will fork
<Drup> orbifx: looking at the implementation will probably be shorter, it's not very long/complicated ;)
<orbifx> ok will do in time
<orbifx> want to get my sockets working first :P
openplatypus has quit [Quit: bye!]
malc_ has joined #ocaml
badon has quit [Ping timeout: 272 seconds]
iloveunix8955 has quit [Read error: Connection reset by peer]
erbse has joined #ocaml
badon has joined #ocaml
<erbse> hi, I'm tring to use Str module, but it doesn't exist, how can I install it? (I can't even found the homepage of this module)
<Drup> how are you compiling
<Drup> ?
<erbse> error is: Error: Reference to undefined global `Str', I can see str in `ocamlfind list` but I can't use it
mgus has joined #ocaml
<erbse> looks lilke it's in stdlib :( maybe the package packer from arch linux did something wrong
<Drup> I repeat: How are you compiling ? :)
<erbse> $ ocaml ocaml.ml
<Drup> Okay, you are using the toplevel
<erbse> oh I known, I have to pass str.cma
<Drup> So add at the top of your file:
<Drup> #use "topfind";;
<Drup> #require "str" ;;
<erbse> this work too, thanks Drup :)
<ggole> You can just load it with #load "str.cma", but it is probably better to use require
th5 has joined #ocaml
struk|desk is now known as struk|desk|away
slash^ has joined #ocaml
mgus has left #ocaml ["rcirc on GNU Emacs 24.3.1"]
orbifx has quit [Ping timeout: 252 seconds]
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Client Quit]
shinnya has quit [Ping timeout: 276 seconds]
erbse has left #ocaml [#ocaml]
<elfring> orbifx: Are you aware that other libraries can offer a higher level service already than "the `Unix` one" alone?
BitPuffin has quit [Ping timeout: 240 seconds]
BitPuffin has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
relrod_ is now known as relrod
aantron has joined #ocaml
nuuit has quit [Ping timeout: 248 seconds]
nuuit has joined #ocaml
Kakadu has quit [Quit: Page closed]
nuuit has quit [Client Quit]
nuuit has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
malc_ has quit [Quit: leaving]
BitPuffin has joined #ocaml
ygrek has joined #ocaml
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
MercurialAlchemi has joined #ocaml
gustav__1 is now known as gustav___
yegods has joined #ocaml
Algebr has joined #ocaml
Algebr is now known as Guest43151
dsheets has joined #ocaml
yegods has quit [Remote host closed the connection]
Guest43151 is now known as Algebr2
dsheets has quit [Ping timeout: 265 seconds]
jzacsh has quit [Read error: Connection reset by peer]
malc_ has joined #ocaml
iloveunix8955 has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
dysfunc has joined #ocaml
dario1 has joined #ocaml
Janni has quit [Remote host closed the connection]
Kakadu has joined #ocaml
<dysfunc> why is the expected type so complex at the "subtries" position in line 23 of this paste? https://paste.ee/p/UW3WT
<dysfunc> all information is in the paste
jwatzman|work has quit [Quit: jwatzman|work]
<dysfunc> considering my subtries list is of type ('a * ('a, 'b) trie) list, and the function passed to List.map should leave the first 'a of the list of tuples unchanged and the insert function is specifed to return a ('a,'b) trie, which should leave the second part of the tuple unchanged
<dysfunc> the two reduced examples (commented) above the erring line both work
darkf has joined #ocaml
<dysfunc> i believe i fixed it
Haudegen has joined #ocaml
<ggole> dysfunc: List.exists might be more pleasant than the fold_left/map combination there
<dysfunc> thanks for the tip
SomeDamnBody has joined #ocaml
<SomeDamnBody> how do I know from where a module is being found?
iloveunix8955 has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
<SomeDamnBody> Say I have identical modules in two places. But I don't know which one is taking precedence. I would like to eliminate the duplicate, but for now I just need to know how a module is qualified, or against what the compiler compiled against
ygrek has quit [Ping timeout: 276 seconds]
dhil has quit [Ping timeout: 240 seconds]
<ggole> A module M is in scope if there is an module M = ... at top level or if there is a file m.ml that has been compiled and made available to the compiler
<ggole> If you are searching for the origin of the second sort of module, you will probably need to have a look at how the code is being built
kushal has quit [Ping timeout: 276 seconds]
<SomeDamnBody> Well, the module was qualified with just module M = Mymodule
<ggole> In that case, your search for the origin of M will become a search for Mymodule
<SomeDamnBody> (and mymodule.ml is not in the current directory, I had known about that) but if I try and fully specify it,
<SomeDamnBody> Right, true,
<SomeDamnBody> if I try to fully specify it with where I think it's coming from, then it fails
<ggole> Specify in what way?
<SomeDamnBody> like Library.Std.Mymodule
<ggole> Ah, it doesn't work like that.
<SomeDamnBody> because I'm using Library as a dependency
mstevens has quit [Quit: leaving]
<ggole> Module names only reflect foo.ml names, not directories.
<SomeDamnBody> so, I had done open Library.Std then module M = Mymodule
<SomeDamnBody> so how can I be sure that mymodule is the module contained by library?
<SomeDamnBody> by Library, my dependency*?
<ggole> You have to look at Library.Std
<ggole> This is why open is not the best idea
<SomeDamnBody> Because right now, the whole origin of this is that the compiler says that Myprogram, which contains the file that is trying to use Mymodule, and Library have inconsistent interfaces of Mymodule
<SomeDamnBody> which I don't understand...
<ggole> Each compiled module is given a digest that basically represents the assumptions made over that module (types, inlined definitions, etc)
<ggole> The compiler will check to make sure that digests are compatible, and if they are not it will give that error.
<ggole> The fix is usually to recompile some things.
<SomeDamnBody> Well I just fully recompiled everything. I know that the interfaces are identical because the ml file from which it is generated has not changed
<SomeDamnBody> Like, Library was recompiled and re-pinned by opam
<SomeDamnBody> and Mylibrary was repinned with Library as a dependency after they were installed, which succeeded
<infinity0> is there something equivalent to python's """xxx""" string literal syntax where i can embed literal newlines?
<ggole> Hmm.
<Algebr2> {||}
_berke_` has quit [Quit: Have to work...]
<Algebr2> {| hello \n world| } I think that's right
<ggole> I don't think I quite understand the situation.
nuuit has quit [Ping timeout: 250 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
<infinity0> Algebr2: ah thanks i tried that but i'm getting "Parse error: [semi] expected after [str_item] (in [implem])"
<infinity0> from camlp4 i think
<Algebr2> I don't know anything about camlp4 besides the linking -syntax flag.
<Algebr2> =/
lokien has joined #ocaml
larhat has joined #ocaml
<ggole> camlp4 parses code differently from OCaml
<ggole> :(
ygrek_ has quit [Ping timeout: 256 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
kushal has joined #ocaml
<lokien> hey, I want to do a function which uses several print expressions. how to write it? do print "first; print "second"; print "third"?
dysfunc has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<aantron> lokien: thats the outline
<lokien> aantron: yeah. and it'll work?
openplatypus has joined #ocaml
<aantron> try it
<Algebr2> let speak () = print_endline "123"; print_endline "456"; print_endline "done"
<Algebr2> let fancy_speak () = List.iter print_endline ["First"; "Second"]
<lokien> oh, thanks
<Algebr2> let rev_speak () = ["First"; "Second"] |> List.iter print_endline
openplatypus has quit [Quit: bye!]
crass_ has joined #ocaml
<lokien> also, I realised my implementation is wrong and I have to rewrite the entire thing
dhil has joined #ocaml
<Algebr2> better realize now than later.
larhat has quit [Quit: Leaving.]
<lokien> Algebr2: right.
Haudegen has joined #ocaml
alexst has joined #ocaml
dario1 has quit [Quit: Konversation terminated!]
larhat has joined #ocaml
ygrek_ has joined #ocaml
<SomeDamnBody> I have 3 opam packages. Package A is a dependency to all others, B depends on A, C depends on A and B. When compiling C, it says that A and B make inconsistent assumptions over interface <contained in A>
<SomeDamnBody> how can B even compile with those inconsistent assumptions?
<SomeDamnBody> I just freshly compiled each of A and B
<Drup> When you get this, the usual answer is "clean and recompile", but if it's probably package in opam, that's probably not helping
<lokien> how can I take arguments to functions like these above, written by Algebr2?
ygrek_ has quit [Remote host closed the connection]
<lokien> let speak arg () = ...? I don't get this syntax :(
ygrek_ has joined #ocaml
<SomeDamnBody> Drup, they are both packages that I have pinned locally
<SomeDamnBody> so, locally, I have done a pin remove, pin add for each package, A and B, that C requires
<aantron> SomeDamnBody: opam upgrade both packages
<SomeDamnBody> I don't see how they can still have this issue
<Drup> SomeDamnBody: can we test ?
<SomeDamnBody> aantron, they are locally managed. upgrade won't do anything to them because they reflect the latest of what is locally on my box
<SomeDamnBody> Well, package A you could install, but I can't release package B
<aantron> no, upgrade will recompile and install the upgraded versions in opam
<SomeDamnBody> aantron, ok
<SomeDamnBody> opam upgrade A B?
<aantron> upgraded in this case, to OPAM, means to re-grab the source locally
<aantron> yes
<aantron> upgrade*
<SomeDamnBody> alright
<aantron> also, did you path or repo pin them? i.e. opam pin add ., or opam source --pin?
<aantron> if the latter, then you may have problems if you didnt git add something to one of the local repos
<SomeDamnBody> I path pinned them
<aantron> ok
<SomeDamnBody> The compilation is running, this will take a while
<Drup> aantron: you should use the -k option instead
<aantron> can -k be passed to opam source?
<Drup> No, it's for opam pin
<Drup> opam pin add -k [git|path|...]
<aantron> right. opam pin already does what i want though :)
<Drup> I meant instead of opam source --pin
<aantron> yes, i understood you. i just wanted to check if SomeDamnBody had done opam source --pin by any chance
Anarchos has joined #ocaml
_andre has quit [Quit: leaving]
ril has joined #ocaml
kushal has quit [Quit: Leaving]
<Algebr2> lokien: what syntax?
<SomeDamnBody> ok, I just did upgrade on A and B and I still get the inconsistent assumptions over interface issue when trying to build C
<Drup> SomeDamnBody: wait, you said you path-pined ?
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Drup> you shouldn't do that, it's going to rsync build files too
<SomeDamnBody> yes, it's path pinned
<SomeDamnBody> oh hmm
<SomeDamnBody> should I make clean in each of those directories? then upgrade again?
<Drup> Or just git pin your local repository
<Drup> (which is the automatic thing anyway ...)
<Drup> You can see the kind of pin with "opam pin list"
<lokien> Algebr2: I want to create a function which takes arguments and prints several times, dunno how to do it
<SomeDamnBody> well, A and C are actually in the same git repo, just different sub folders. So path pinning makes sense. Will make clean and upgrade of each of those help?
<Drup> If those are in the same git repo, use subpackages
<SomeDamnBody> whoa I didn't know opam had that
<Drup> foo.opam and bar.opam in the root of the repository
<Drup> with build instructions relatively to the root
<SomeDamnBody> Alright, well I have a dentist appointment that I need to hit, this rebuild will take about 30 minutes anyway
<Drup> but yes, if you clean everything, it should help
ggole has quit []
<SomeDamnBody> I did. I cleaned all, then did opam upgrade for A then B
<Drup> you need to remove and re-add the pin
<Drup> because it's using rsync, if the file was removed, it keeps the original :)
<Drup> (yeah, path pin is very rarely useful)
alexst has quit [Ping timeout: 256 seconds]
th5 has quit [Quit: Textual IRC Client: www.textualapp.com]
alexst has joined #ocaml
<Algebr2> lokien: let speak some_arg = print_endline some_arg; print_endline some_arg
<lokien> Algebr2: just like that? oh
ergo has joined #ocaml
ril has joined #ocaml
jeffmo has joined #ocaml
openplatypus has joined #ocaml
pgiarrusso has quit [Ping timeout: 240 seconds]
lokien has quit [Quit: Leaving]
alexst has quit [Quit: Lost terminal]
pgiarrusso has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
jeffmo has quit [Quit: jeffmo]
Sim_n has quit [Quit: Leaving]
openplatypus_ has joined #ocaml
openplatypus_ has quit [Quit: bye!]
openplatypus has quit [Quit: bye!]
larhat has quit [Quit: Leaving.]
rpg has joined #ocaml
ergo has quit [Quit: Lost terminal]
openplatypus has joined #ocaml
BitPuffin has quit [Ping timeout: 248 seconds]
openplatypus has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Ping timeout: 265 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
orbifx has joined #ocaml
<orbifx> I disconnected ubruptly earlier. Did I miss anything regards sequential `try`s ?
<groovy2shoes> orbifx, don't think so, just this:
<groovy2shoes> <elfring> orbifx: Are you aware that other libraries can offer a higher level service already than "the `Unix` one" alone?
shinnya has joined #ocaml
ril has joined #ocaml
<orbifx> thanks groovy2shoes
<groovy2shoes> np
Haudegen has joined #ocaml
igoroliveira has joined #ocaml
<elfring> orbifx: Did you look at any information from an article like "What the interns have wrought: RPC_parallel and Core_profiler" by Yaron Minsky on 2014-10-16?
rpg_ has joined #ocaml
<orbifx> nope first time I see this.
malc_ has quit [Quit: leaving]
<elfring> orbifx: I am curious if you would like to continue a discussion on related topics on other days. ;-)
silver has quit [Quit: rakede]
<orbifx> If I'm here, Dunno how much time I have to go over all things you have asked or suggested.
rpg has quit [Ping timeout: 250 seconds]
rpg_ has quit [Ping timeout: 260 seconds]
<yawnt> elfring: are we talking about internship at JSC?
<orbifx> yawnt: I think he was just referring me to an article
<yawnt> ah gotcha, my bouncer must've erased the logs cause i was missing the previous part of the conversation
<yawnt> :)
struk|desk|away is now known as struk|desk
Algebr2 has quit [Ping timeout: 252 seconds]
<elfring> I find that the Jane Street Tech Blog provides some interesting information about software evolution also around OCaml for parallel programming for example, doesn't it?
<elfring> Some of my own software development activities can be seen by a GitHub display: https://github.com/elfring
elfring has quit [Quit: Konversation terminated!]
demonimin has quit [Ping timeout: 264 seconds]
Algebr2 has joined #ocaml
rpg has joined #ocaml
rand__ has quit [Quit: leaving]
Sorella has quit [Quit: Connection closed for inactivity]
yegods has joined #ocaml
yegods has quit [Ping timeout: 250 seconds]
struk|desk is now known as struk|desk|away
Sorella has joined #ocaml
dksong has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
dksong has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
ygrek_ has quit [Ping timeout: 256 seconds]
struk|desk|away is now known as struk|desk
orbifx has quit [Quit: WeeChat 1.3]