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
<seangrove> Hey all, how can I list the child process ids given a parent process id?
Algebr``` has quit [Ping timeout: 250 seconds]
Algebr``` has joined #ocaml
fooey has joined #ocaml
jeffmo has quit [Quit: jeffmo]
hx1 has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
Algebr``` has quit [Ping timeout: 250 seconds]
bensu_ has quit [Remote host closed the connection]
bensu_ has joined #ocaml
AllanDaemon has quit [Quit: Leaving]
AllanDaemon has joined #ocaml
<def`> seangrove: the way I know is by reading the procfs
<def`> this is not portable, each OS implements it in its own way
two_wheels has joined #ocaml
tmtwd has joined #ocaml
bensu_ has quit [Remote host closed the connection]
bensu_ has joined #ocaml
bensu_ has quit [Remote host closed the connection]
<gasche> Algebr, aantron: inside the OCaml compiler there is no clean representation for what the typed AST should be
bensu_ has joined #ocaml
<gasche> there is a "typed ast", but it is the format that is used for type inference; it can express a continuum for the not-typed-et to the fully-typed, is complex and full of subtle invariant and implementation details, and it would be a horrible representation to express transformations on
<gasche> (the one typed metaprogramming feature we have, {scan,printf}f formats, give up on producing a typed ast directly and produce a parsetree and re-check it afterwards)
bensu_ has quit [Remote host closed the connection]
<gasche> but there is hope, namely the ongoing work of Pierrick Couderc, writing a clean fully-typed representation and a checker for it; see the article currently trending on reddit/r/ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
bensu_ has joined #ocaml
hx1 has quit [Ping timeout: 246 seconds]
bensu_ has quit [Remote host closed the connection]
bensu_ has joined #ocaml
bensu_ has quit [Remote host closed the connection]
fooey has quit [Quit: Leaving]
bensu_ has joined #ocaml
bensu_ has quit [Remote host closed the connection]
bensu has joined #ocaml
fluter has quit [Ping timeout: 264 seconds]
SomeDamnBody has quit [Remote host closed the connection]
bensu has quit [Remote host closed the connection]
bensu has joined #ocaml
yunxing__ has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
fluter has joined #ocaml
yunxing_ has quit [Ping timeout: 250 seconds]
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
bensu has quit [Remote host closed the connection]
bensu_ has joined #ocaml
bensu_ has quit [Remote host closed the connection]
bensu has joined #ocaml
bensu has quit [Remote host closed the connection]
bensu has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
|2321 has quit [Quit: Connection closed for inactivity]
<aantron> gasche: thanks for the info
yunxing_ has joined #ocaml
yunxing_ has quit [Client Quit]
bensu has quit [Remote host closed the connection]
bensu_ has joined #ocaml
bensu_ has quit [Remote host closed the connection]
bensu_ has joined #ocaml
bensu_ has quit [Remote host closed the connection]
bensu_ has joined #ocaml
jeffmo has joined #ocaml
bensu_ has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 244 seconds]
hx1 has joined #ocaml
Fernandos has joined #ocaml
<Fernandos> Hi
<Fernandos> I just tried installing spoc, because I want to use opencl in OCaml/Reason, however the build fails and I'm clueless.. Would you mind helping?
tmtwd has joined #ocaml
hx1 has quit [Ping timeout: 276 seconds]
<Fernandos> I followed it 1:1
seangrove has quit [Ping timeout: 276 seconds]
jeffmo has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
bensu_ has joined #ocaml
<Drup> Fernandos: It looks like there was a change in ocp-build's format, and spoc has not been updated
<Fernandos> unfortunately, yes it looked dormant. But that the ONLY OpenCL library I could find for OCaml
<Drup> Fernandos: I think it could wake up a bit with an active user ;)
<Fernandos> and it's 92% on par with hand-tuned Fortran, according to their slides
<Fernandos> Sure, but I guess I'm the wrong one. Just wrote my first OCaml program.. :)
johnelse has quit [Ping timeout: 252 seconds]
<Fernandos> And I was going to even use Facebook's Reason abstraction layer, instead of pure OCaml for the next program (DeepLearning)
<Drup> hum
<Drup> spoc relies quite heavily on a camlp4 syntax extension, you won't be able to use it with reason
<Fernandos> damn.. hmm maybe there is a way to skip the whole elegance of OCaml and use a C-FFI directly?
<Drup> (or rather, not in the same file)
<Drup> I wouldn't advise starting OCaml by looking at it's FFI
<Fernandos> ?
<Drup> (not that it's unclean or anything, ctypes is very nice, but it's not a beginner's task)
FreeBirdLjj has quit [Remote host closed the connection]
<Drup> report the bug you found to spoc's bug tracker first: https://github.com/mathiasbourgoin/SPOC/issues
<Fernandos> OpenCL is definitely not something I want to mess with other than spewing vectors and data to it and wait for the result
FreeBirdLjj has joined #ocaml
atbagautdinov has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
<Fernandos> Point 17. is the single reason, I really really like Reason https://github.com/facebook/reason/wiki/Reason-Launch-Roadmap
jonasen has joined #ocaml
walter|r has quit [Remote host closed the connection]
<Drup> pretty sure that's not all automatic just yet, you can get that anyway (with Reason or OCaml). The intro chapter of RWO explains how
johnelse has joined #ocaml
walter|r has joined #ocaml
atbagautdinov has quit [Quit: atbagautdinov]
walter|r has quit [Remote host closed the connection]
<Fernandos> Drup: I didn't find any infos about FFIs on the Reason wiki/docs, so do you know if there is something like a system() call?
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Drup> chenglou: is there a Reason version of RWO yet ?
<chenglou> Nope. We should run refmt across the book
<Drup> It's a bit hard to recommend Reason for newcomers is none of the introductory material is available.
<Drup> if*
<Drup> Fernandos: http://realworldocaml.org/ is a good OCaml book
<Fernandos> I trust you on that, but I would've started with OCaml instead of Haskell if I found OCaml's language&synthax more attractive and easier to use
<Fernandos> Other than that I think that OCaml is already doing what Haskell claims, but ultimately can't, to get out of academia and into the "real world".. where most people won't get Monads, or write clean code all of the time.
tmtwd has quit [Ping timeout: 250 seconds]
<Fernandos> chenglou: is there any IPC or FFI, or a hack like system() to pass data in/out of a Reason program to one in another language?
<chenglou> Fernandos: it's the same system ocaml would use since reason is just a syntax transform
<chenglou> Whatever code works now, pipe it through refmt to get the reason version
<chenglou> (Or did you try that and encountered something else?)
<Fernandos> Not yet, I'm still at the very beginning with Ocaml, just wrote a simple perceptron impl. but would rather use Reason solely, if possible
<Drup> Fernandos: FFI, with ctypes, there is a chapter about it in RWO.
MercurialAlchemi has joined #ocaml
<Fernandos> I think an ecosystem like Scala's java library compatibliity, but without the java-esque boilerplate would be nice. The problem would be that each new OCaml library would require a new Reason interface or wrapper unless there isn't a generic way of doing accessing OCaml using an architecture-pattern
<Fernandos> will look into that
yunxing_ has joined #ocaml
jonasen has joined #ocaml
<chenglou> Fernandos: brt, on mobile
<Fernandos> np, gotta go the the AI class soon anyway :)
<Drup> Fernandos: you don't need a compatibility layer, it's already compatible
yunxing__ has joined #ocaml
<Fernandos> Oh I mean let's for example take an OCaml array library, it has functions, types etc and accessing these in Reason is I guess easily possible too, but I thought that you would have to write idiomatic OCaml code in Reason if you use that Ocaml library (the price of being compatible). I hope I'm wrong though :)
pierpa has quit [Ping timeout: 240 seconds]
<yunxing> Fernandos: oh I think reason and ocaml has the same idioms
manud has quit [Quit: manud]
<yunxing> Idioms are for semantics layer, Reason currently has only changed syntax layer
yunxing_ has quit [Ping timeout: 250 seconds]
<Fernandos> yep I know, if that's right it's really clever solution
<chenglou> The syntax is mostly 1-1 mapping
sdothum has quit [Ping timeout: 258 seconds]
<Fernandos> that sounds almost like an API isomorphism
<Fernandos> cool
<chenglou> Using reason is basically using ocaml but passing a few new flags so that it uses our parser instead of the build in default one
<chenglou> We don't even have any theoretical compile time overhead because of this (you'd need to parse anyway)
<yunxing> chenglou: parsing maybe a tiny bit slower because of the algorithm Menhir used.
<chenglou> Aaah
<Fernandos> hmm, then I really hope that you guys take over OCaml in the next version :P
sdothum has joined #ocaml
sdothum has quit [Client Quit]
<Fernandos> Personally my most anticipated language feature in any language is Non-linear pattern-matching. Here's a language doing that https://www.egison.org/
<chenglou> Aaaaah that. Is it the e.g. | Foo n n => ...
<Fernandos> That's actually what makes writing highly complex code streightforward (as long as symbols aren't overused, imho)
<chenglou> Fernandos: do you have a tldr of non linear matching? I might have understood it wrong
<Fernandos> In my words: probabilistic, other algorithm, or even neural-net driven pattern-matching
<Fernandos> Against Non-Free Data Types
<Drup> chenglou: it's just the fact that you can have a variable multiple time in a pattern, like you said
<Fernandos> it's not hard to do, but hard to do right
fluter has quit [Ping timeout: 260 seconds]
bensu_ has quit [Remote host closed the connection]
fluter has joined #ocaml
<Fernandos> Pattern Matchers are the sweetest form of cheating, but combined recursively like we do daily in natural language, it becomes an incredibly powerful composable and reusable abstraction that actually results in less code weight (and optimally also in less machine instructions due to the concise nature=
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
manud has joined #ocaml
<Fernandos> wow that hello world example is really a small binary
madroach_ has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
<chenglou> Fernandos: ocaml also has great interop with js through js_of_ocaml and more recently, bucklescript
<chenglou> check the output! So clean
manud has quit [Quit: manud]
<chenglou> Drup: how is that variable value comparison done?
<Fernandos> I found out about js here http://mathiasbourgoin.github.io/SPOC/tutos/array2015.html unfortunately spoc doesn't build anymore and I'm too novice to fix it
<Drup> chenglou: ?
<chenglou> like how exactly would you be using that variable in the matcher? I think I'm not being imaginative enough
manud has joined #ocaml
<Drup> let rec dedup = function [] -> [] | h :: h :: t -> h :: dedup t
<Drup> (that's a crapy example, but you get the diea)
<Drup> and no, that doesn't work, the real ocaml version is like that:
<Drup> let rec dedup = function [] -> [] | h :: h' :: t when h = h' -> h :: dedup t
<chenglou> right, and now you'd have to compare the `h`s
<chenglou> ok yeah here it's `=`
<chenglou> but can I define how the comparison is done? Like, 1 = 1. or something
<chenglou> `1 = 1.0` to be clear
<Drup> In which version ?
<chenglou> the non-linear pattern matching version
<Drup> that's one problem with that feature.
<chenglou> because you'd essentially have to allow some random comparison function to achieve the same thing as you did with `when` right
<chenglou> going through the paper right now. I remember Egison from some HN threads
manud has quit [Quit: manud]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
jonasen has joined #ocaml
AlexDenisov has joined #ocaml
ygrek_ has joined #ocaml
<chenglou> Drup: "We can define the equality for each data type in the matcher"
<chenglou> "Note that we can write an any expression in a value-pattern"
<chenglou> aaaah neat
Mercuria1Alchemi has joined #ocaml
bensu_ has joined #ocaml
atbagautdinov has joined #ocaml
bensu_ has quit [Ping timeout: 252 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A1977494 has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 240 seconds]
nicholasf has joined #ocaml
gasche has quit [Ping timeout: 252 seconds]
Simn has joined #ocaml
meiji11 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Fernandos has quit [Quit: WeeChat 1.5]
FreeBirdLjj has joined #ocaml
adi___ has quit [Ping timeout: 272 seconds]
AltGr has joined #ocaml
AlexDenisov has joined #ocaml
nicholasf has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
kushal has quit [Quit: Leaving]
Reventlo1 is now known as Reventlov
Reventlov has quit [Changing host]
Reventlov has joined #ocaml
yunxing__ has quit [Ping timeout: 250 seconds]
manud has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jonasen has quit [Ping timeout: 252 seconds]
manud has quit [Quit: manud]
manud has joined #ocaml
hallow_me has joined #ocaml
hallow_me has quit [Client Quit]
hx1 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
travula has joined #ocaml
hx1 has quit [Ping timeout: 244 seconds]
larhat has joined #ocaml
<travula> join #sqlalchemy
dexterph has joined #ocaml
travula has quit [Quit: Leaving]
travula has joined #ocaml
jonasen has joined #ocaml
adi___ has joined #ocaml
jwatzman|work has joined #ocaml
meiji11 has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dave24 has joined #ocaml
tane has joined #ocaml
tane has quit [Client Quit]
tane has joined #ocaml
silver has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dhil has joined #ocaml
bensu has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
nicholasf has joined #ocaml
bensu has quit [Ping timeout: 252 seconds]
manud has quit [Quit: manud]
<Leonidas> why would I?
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
AllanDaemon has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
sfri has quit [Remote host closed the connection]
sfri has joined #ocaml
fluter has joined #ocaml
AllanDaemon has joined #ocaml
nicholasf has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
sdothum has joined #ocaml
FreeBirdLjj has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkf has quit [Ping timeout: 250 seconds]
kandu_ has quit [Ping timeout: 258 seconds]
kandu has joined #ocaml
kandu is now known as Guest80697
fluter has quit [Quit: WeeChat 1.2]
fluter has joined #ocaml
Ravana has quit [Excess Flood]
Ravana has joined #ocaml
clog has quit [Ping timeout: 276 seconds]
Kakadu has joined #ocaml
octachron has joined #ocaml
d0nn1e has quit [Ping timeout: 264 seconds]
hx1 has joined #ocaml
d0nn1e has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ravana has quit [Ping timeout: 260 seconds]
hx1 has quit [Ping timeout: 260 seconds]
Ravana has joined #ocaml
ygrek_ has joined #ocaml
<tormen_> Hi. I suppose using (1.) out_file_descr = Unix.openfile ... ;; (2.) out_channel = Unix.out_channel_of_descr out_file_descr ;; (3.) close_out_noerr out_channel ;; I will NOT need to call Unix.close out_file_descr afterwards, because it is already taken care of by close_out_noerr ?
<apache2> kind of annoying that "output" is reserved
<Drup> hum, it's not.
silver_ has joined #ocaml
<tormen_> I am a bit confused because in the Pervasives doc it just says "Close the given channel," ... but here I have an out_channel AND a UNIX.file_descriptor ...
<apache2> I must have been doing something wrong, then. I first tried to call my variable "output", then "output_value". turns out both of them are pervasives functions
<tormen_> ... as Pervasives does not know anything about Unix... how can it close the Unix file-descriptor (obtained by Unix.openfile) ?
<apache2> because the out_channel may internally be bound to that unix fileno ?
silver has quit [Ping timeout: 260 seconds]
rossberg_ has joined #ocaml
rossberg has quit [Ping timeout: 264 seconds]
jonasen has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
silver_ is now known as silver
A1977494 has quit [Remote host closed the connection]
ewanas has joined #ocaml
kushal has joined #ocaml
<tormen_> apache2: and then Pervasives takes care of closing the unix file descriptor ?
<apache2> tormen_: how do you create the out_channel?
<apache2> tormen_: I just verified that, yes.
AlexDenisov has joined #ocaml
<apache2> (you can see the open file descriptors for a process in Linux with `ls -l /proc/{the pid of the process}/fd/` if you have /proc mounted
<tormen_> apache2: Looking in /proc: Ah yes of course! Nice idea :)) ... about how I open them see my post just a view lines up: (1.) out_file_descr = Unix.openfile ... ;; (2.) out_channel = Unix.out_channel_of_descr out_file_descr ;; (3.) close_out_noerr out_channel ;;
sepp2k has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonasen has joined #ocaml
mettekou has joined #ocaml
cheater has joined #ocaml
<cheater> hi
<cheater> in ocaml, what are functors? are they related to ocaml modules?
<companion_cube> yes, a functor is (roughly) a function from modules to modules
<companion_cube> takes a module in, outputs a module (that depends on the input)
zaquest has quit [Ping timeout: 260 seconds]
<cheater> oh
<cheater> i remember now
<cheater> so basically it's like a parametric module?
<companion_cube> yes
<cheater> like this stuff in mirage where you can have a networking module and that can take different arguments depending if you run on xen or linux
<companion_cube> yes
<cheater> makes sense, thanks
<companion_cube> or a data structure parametrized on some type
<cheater> what's the best way to get ocaml on ubuntu btw?
<companion_cube> e.g. Set.Make(X) is a set of X.t
<cheater> a recent version
<cheater> i've got ubuntu 14.04 which probably won't have the latest package
<companion_cube> you can use opam
<cheater> i've got 0 ocaml on my pc right now
<companion_cube> install the default ocaml, and use it to install opam (it sholud be all explained on opam.ocaml.org)
two_wheels has joined #ocaml
<cheater> oh nice there's a ppa
<cheater> i'll just use that
shinnya has joined #ocaml
hx1 has joined #ocaml
<cheater> when doing "opam config env" should i do it under sudo or not?
<Leonidas> no, it's user-local
<cheater> # aptitude install opam
<cheater> ...
<cheater> Remove the following packages:
<cheater> 1) irssi
<cheater> i'm sure this is your work Leonidas
<cheater> :-D
hx1 has quit [Ping timeout: 244 seconds]
<cheater> ok, opam installed
<cheater> nice, now i have ocaml
<Leonidas> no, first you need to build ocaml :p
<cheater> $ ocaml <(echo 'print_endline "Sadly not" ;;')
<cheater> Sadly not
<cheater> no need to be caught building the compiler like i'm some sort of animal
dexterph has quit [Ping timeout: 252 seconds]
<Leonidas> I think it is far preferable to have the opam built-compiler than the distribution's compiler
<cheater> this is from a ppa though, it's the latest version of ocaml
<cheater> why would it be bad?
<cheater> it's not ancient
<cheater> when starting a haskell project i'll normally create a cabal sandbox, how does one do this in ocaml?
<companion_cube> I don't think there is any equivalent (I don't know cabal)
<cheater> the idea is to get a sandbox
<companion_cube> opam 2 should/will have this feature
<cheater> i.e. you get your project + all of its deps inside one directory structure and that doesn't pollute the system wide packages
<cheater> how does one start a project in ocaml?
<cheater> obviously this requires some external dependencies
<theblatte> opam doesn't have that yet, you can use local switches in opam to have something a bit like this, but for now the best way to have a sandboxed install is to use docker
<companion_cube> in any case, opam doesn't write in system dirs, only in ~/.opam
<cheater> ah ok so worst case scenario i just launch missiles on ~/.opam
<companion_cube> yep
<theblatte> except when you need system dependencies to install some opam package
<Khady> but the separation between switches works well, so you shouldn't have to launch missiles on .opam
<cheater> ok, so
<cheater> i cloned that repo and tried doing: $ ocaml hello_lwt.ml
<cheater> it complained about: Error: Unbound module Lwt
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cheater> so obviously some build system is in order, i just don't know how this works really
<cheater> or some package system or something like that
<cheater> actually i'm limiting myself to hello_lwt.ml right now
<Khady> ocamlbuild is a wrapper around the ocaml{c,opt} compiler
<cheater> Khady: well that's helpful
<cheater> thanks
clog has joined #ocaml
<Khady> it's probably ocamlbuild -use-ocamlfind -pkgs lwt,cohttp.lwt,webmachine hello_lwt.native
<Khady> not sure, I have not compiled those examples
agarwal1975 has joined #ocaml
<cheater> opam sure has prettier / blingier output than cabal
hbar_ has quit [Ping timeout: 272 seconds]
<cheater> $ ocamlbuild -use-ocamlfind -pkgs lwt,cohttp.lwt,webmachine hello_lwt.native
<cheater> + ocamlfind ocamldep -package webmachine -package cohttp.lwt -package lwt -modules hello_lwt.ml > hello_lwt.ml.depends
<cheater> ocamlfind: Package `webmachine' not found
<cheater> i just go ahead and do opam install webmachine, right?
<Khady> yep
<cheater> nice. it's all coming back now
jonasen has joined #ocaml
<cheater> hmm that failed http://sprunge.us/gSAa
<cheater> Khady companion_cube is this a kind of error i should be able to resolve or is this something that's broken in the source?
<companion_cube> you probably need to install the dependencies (e.g. cohttp, re)
<cheater> well they got installed
<cheater> let me post the whole log
<cheater> companion_cube: http://sprunge.us/bYdU
FreeBirdLjj has quit [Remote host closed the connection]
<Khady> looks like there is an incompatibility between the version of cohttp and webmachine
FreeBirdLjj has joined #ocaml
<Khady> can you have a try with ocaml 4.03 cheater ?
<cheater> Khady: oh. where do you see that it's an incompatibility between them?
<cheater> $ ocaml -version
<cheater> The OCaml toplevel, version 4.02.3
<cheater> i only have 4.02.3 right now :S
<cheater> really don't want to build 4.03 from src
<Khady> well I'm not sure, but I know that Request is a type from cohttp
<Khady> cheater: opam switch 4.03.0
rgrinberg has joined #ocaml
<Khady> eval `opam config env`
<cheater> how long will opam switch take do you think?
<Khady> and then again opam install webmachine
rgrinberg has quit [Client Quit]
<Khady> the same duration that it took to do the first opam init probably
<Khady> less than 2 minutes
<Khady> actually I can try on my side too
<cheater> it's sitting on: Processing: [4.03.0: make world]
<Khady> that's the main part
<cheater> i do not believe that it will take 2 minutes only to build the ocaml compiler
<cheater> but i'll be pleasantly surprised if it's quick :-)
<cheater> nice it's on make world.opt now
<Khady> I tend to be optimistic regarding compilation durations :)
<cheater> done :)
FreeBird_ has joined #ocaml
<cheater> ok so it was more like 8 minutes but still impressive
<cheater> compiling goddamn lens takes several times more cpu time
<cheater> now let's see about webmachine again :)
dhil has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<cheater> mp
<cheater> sorry
<cheater> nope
<Khady> :(
<Khady> it should be reported upstream
kushal has quit [Quit: Leaving]
<chelfi> cheater: ocaml tends to boast much faster compilation times than, say, ghc
rgrinberg has joined #ocaml
iwan_ has joined #ocaml
<companion_cube> o/ rgrinberg
<iwan_> echo print_endline \"test\" > test.ml && ocamlc test.ml gives me a.out
<cheater> chelfi: i've noticed ... i also think not having lens is a great idea personally
<iwan_> a.out contains #!/Users/myusername/.opam/4.02.3/bin/ocamlrun on the first line
<iwan_> is there a way to make this computer agnostic?
<cheater> ok guys, there must be some way to compile webmachine, otherwise it wouldn't have reached version 0.3.1
<cheater> what are we doing wrong here?
<cheater> Iwan_: did you know you could also do ocamlc <(echo bla bla bla) ?
<cheater> no test.ml necessary :)
<rgrinberg> companion_cube: \o
<iwan_> haha no I didn't know :D
<cheater> it's a bash feature
<iwan_> but still if I give the compiled output to someone else my /myusername/ is hard coded to the username of my pc
<iwan_> Is there a way around it?
fluter has quit [Ping timeout: 272 seconds]
<cheater> this might be a solution to my issue https://github.com/andrewray/iocaml/issues/42
<cheater> how do i pin the version of cohttp to 0.20.2?
<Drup> Iwan_: sort of, just run "ocamlrun a.out" instead of "./a.out"
<Drup> seliopou: your package seems to be broken (cc cheater).
<iwan_> @Drup. Thanks!
<Drup> Iwan_: alternatively, just use native compilation
<cheater> ok so ocaml pin add cohttp 0.20.2
<iwan_> by using ocamlopt instead of ocamlc?
<iwan_> (beginner here)
<Drup> Iwan_: yes
<iwan_> Thanks :)
voglerr has joined #ocaml
<cheater> hmm no, that didn't work
<travula> I am a beginner in ocaml, how do I import a module in ocaml?
<cheater> try reading this travula http://blog.ezyang.com/2010/10/ocaml-for-haskellers/
<travula> let ratio x y = Float.of_int x /. Float.of_int y
<Drup> cheater: you'll have to wait a bit, a new version of cohttp was just released and webmachine is not compatible with it (and it was not flaged in the opam repo ... ಠ_ಠ)
<Drup> I'm sure it will be fixed shortly
<travula> when execute this, I get this error - "Error: Unbound module Float"
<Drup> travula: you are reading RWO ?
<travula> cheater, thanks
<travula> Drup, yes
<chelfi> travula: did you follow the installation instructions for the Core library ?
<cheater> aha, it's "opam pin add"
<cheater> Drup: aha, well, i'm trying to get it working *now* :)
<cheater> for some reason i was doing "ocaml pin add" - silly mistake
<travula> Drup, could you please give me the link for core installation?
<Khady> you can also opam install cohttp.0.20.2 cheater
<cheater> well, webmachine now installed
<cheater> but now i have another issue
<cheater> $ ocamlbuild -use-ocamlfind -pkgs lwt,cohttp.lwt,webmachine hello_lwt.native
<cheater> + ocamlfind ocamldep -package webmachine -package cohttp.lwt -package lwt -modules hello_lwt.ml > hello_lwt.ml.depends
<cheater> ocamlfind: Package `cohttp.lwt' not found
<cheater> opam install cohttp.lwt says it can't find such a package :S
dhil has joined #ocaml
<Khady> opam install lwt cheater
hcarty has joined #ocaml
<cheater> going!
<cheater> yay, it works
<cheater> ok
<cheater> that's great :) thanks
<cheater> Khady: why does it say "-package cohttp.lwt" when the right package is just "lwt"?
<Khady> lwt is a different package
<Khady> cohttp.lwt is a subpart of cohttp
<Khady> that is only compiled if lwt is installed
<Khady> that's why cohttp and webmachine have been recompiled when you have installed lwt
ewanas has quit [Ping timeout: 250 seconds]
hx1 has joined #ocaml
nicholasf has joined #ocaml
ewanas has joined #ocaml
hx1 has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBird_ has joined #ocaml
cnu- has quit [Quit: Quit.]
zaquest has joined #ocaml
cnu- has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
FreeBird_ has quit [Ping timeout: 244 seconds]
mort___ has joined #ocaml
<mort___> hi— is there a problem with wherever camlp4 source is hosted?
<mort___> ah! no worries, `opam install camlp4` has woken up :)
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mort___ has quit [Client Quit]
<cheater> Khady: ah
<cheater> :)
<cheater> makes sense! thanks!
<Khady> I realize how difficult it is to understand opam packages and the build system by answering you question
<Khady> we need a good introduction
<Khady> but it is not easy to write one
voglerr has quit []
iwan_ has quit [Ping timeout: 250 seconds]
octachron has quit [Ping timeout: 250 seconds]
t4nk238 has quit [Ping timeout: 250 seconds]
Kakadu has quit [Ping timeout: 250 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
octachron has joined #ocaml
jonasen has joined #ocaml
<dave24> hello is there something like hoogle for ocaml? I'm trying to find you what (>>=) and (>|=) do but can't find an answer.
<dave24> s/you/out
<companion_cube> there is ocamloscope, but it only covers a small fraction of the libraries
<hcarty> dave24: There is http://ocamloscope.herokuapp.com/ - but the answer will depend on context
<hcarty> companion_cube: So quick! :-)
<companion_cube> it's pretty annoying that ocamloscope is so narrow
<hcarty> dave24: merlin can be helpful with this, at least for identifying the type of an entity
<dave24> thanks
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hcarty> companion_cube: According to the README it's tied rather closely to 4.01.0 which may also make adding more libraries difficult
<hcarty> One day codoc (or whatever it's latest incarnation is) will save us all
<dave24> there are a lot of results for >>=, the example here: https://github.com/mirage/ocaml-cohttp seems to imply that the reader knows what >>= is. But I have no clue.
<companion_cube> oh, is codoc supposed to do that as well?
<companion_cube> I'd bet on merlin, personnally
bensu has joined #ocaml
regnat[m] has quit [Ping timeout: 264 seconds]
M-pesterhazy has quit [Ping timeout: 276 seconds]
M-martinklepsch has quit [Ping timeout: 260 seconds]
M-Illandan has quit [Ping timeout: 260 seconds]
M-jimt has quit [Ping timeout: 276 seconds]
bensu has quit [Ping timeout: 252 seconds]
AlexDenisov has joined #ocaml
<hcarty> dave24: In the case of cohttp it's most likely (always?) the bind operator for the concurrency library being used
Reshi has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 272 seconds]
Sorella has joined #ocaml
jonasen has joined #ocaml
<dave24> hcarty: yeah thanks, i found it
<cheater> i just assumed it was bind
<cheater> i am not sure what >|= is though
Kakadu has joined #ocaml
<Kakadu> .о прс
<Kakadu> oops
<octachron> (>|=) might be (f)map (i.e bind x (return . f) )
<cheater> which is the functor, the left or right parameter?
<cheater> i.e. is >|= exactly like haskell's <$> or is it flipped?
<Drup> cheater: flipped
<cheater> thanks
<Drup> (same direction as >>=)
<cheater> mhm
gasche has joined #ocaml
<cheater> if i'm using webmachines, is there a good way to do long polling?
regnat[m] has joined #ocaml
walter|r has joined #ocaml
<hcarty> cheater: I haven't used webmachine yet, but from a cohttp perspective I'm not sure anything special is required
<cheater> OK
<cheater> is there a search engine like haskell's hoogle?
<cheater> i would like some place where i can find out what those are: >|=, >>|, etc
<hcarty> cheater: http://ocamloscope.herokuapp.com/ has a very limited set of libraries that you can search. Otherwise merlin and maybe ocp-browser (part of ocp-index)
<dave24> cheater: :) i asked this question just a minute ago. there is http://ocamloscope.herokuapp.com/ . >|= is probably infix map from https://ocsigen.org/lwt/2.5.1/api/Lwt
<hcarty> merlin isn't a search engine but it's a very nice editor support tool
M-martinklepsch has joined #ocaml
M-jimt has joined #ocaml
M-pesterhazy has joined #ocaml
M-Illandan has joined #ocaml
<cheater> what's merlin?
<cheater> :)
<hcarty> IDE-like goodies for your editor
<hcarty> vim/emacs/sublime text/atom/vs code
<cheater> can i use it on the cli?
<hcarty> merlin + ocp-indent are highly recommended in general
<hcarty> I'd recommend utop and ocp-browser for cli use
<hcarty> merlin can be but it's really setup to be run with an editor
<cheater> i haven't heard of either
<cheater> what do utop and ocp-browser do?
<hcarty> utop is a fancy interactive OCaml session
<hcarty> ocp-browser lets you browse through all your installed libraries, including (most of) their documentation
<hcarty> cheater: opam install utop merlin ocp-indent ocp-index
<hcarty> to get the whole set
<cheater> ok :-)
<hannes> gasche: uhm, I can't see any commit to trunk (regarding #583)
nicholasf has quit [Remote host closed the connection]
Leonidas has quit [Remote host closed the connection]
Leonidas has joined #ocaml
<cheater> hmm still can't figure out what >>| means :\
<cheater> merlin etc will be compiled after core & co are done
<cheater> async is taking very long :-)
|2321 has joined #ocaml
<hcarty> cheater: Yeah... Core, Async and friends take quite a while to compile
<hcarty> cheater: >>| is Async's spelling of >|=
<cheater> they look fairly cool though
<hcarty> A few other libraries use that spelling too
<cheater> hcarty: gotcha. is it the same arg order as >|=?
<hcarty> cheater: Yes, I think so
<cheater> ty
<cheater> ok, so async apparently changed and now i get an error compiling stuff :S
<cheater> trying to compile this: https://bitbucket.org/yminsky/core-hello-world
<cheater> this is the error: http://sprunge.us/LCdM
<cheater> not sure where to get docs for the async library, and in specific Rpc.Connection.create
<gasche> hannes: I forgot to push
<gasche> thanks
<gasche> (I rebuilt the world to run the testsuite and swapped mental contexts)
ygrek_ has quit [Ping timeout: 276 seconds]
Jaxan_ is now known as Jaxan
<gasche> (pushed now)
<companion_cube> o/ gasche
<gasche> hi
<companion_cube> I'm excited by the stdlib contribution guidelines :)
<gasche> yep
<gasche> it's cool
<gasche> I thought of posting a message somewhere to point out that this is not a "long truth unearthed only now" but rather a conscious change of behavior
<gasche> the document sounds like "we've been open to changes all along"
<companion_cube> that's a good signal anyway
<gasche> yep
<companion_cube> I just need to check what stdlib tests look like
tane has quit [Quit: Leaving]
<gasche> which is also why I didn't say anything
<rks`_> confirmed by the first PR made by Alain which pleased everyone
<gasche> ah
<gasche> they are none?
<companion_cube> (obtw, I'm planning to make qtest use ounit more closely, in particular for optional junit output)
<gasche> Sébastien Hinderer is interested in all things testsuites, so please get in contact with him and Damien if you want to do something on the stdlib's
<gasche> I do think that it would be very good; in some occasions I have used Batteries' tests to gain trust in code I touched in the stdlib because the testing there is inadequate
<gasche> hm
pierpa has joined #ocaml
<gasche> (I mean it: do get in contact!)
<gasche> rks`_: yeah
<companion_cube> can you pm me his email?
<companion_cube> oh well, @ inria.fr
<gasche> so I'm also worried by how difficult it will actually be to handle those pull requests
<gasche> (eg. "split" which I think is a minefield)
<companion_cube> I'm not very optimistic about String, but I want to try and integrate iterators
<rks`_> :)
<gasche> I think I'm helping people by not getting involved in these discussions
<gasche> there is some relief in letting others get their hands dirty with this thorny problem, but also slight anxiety at suffering the consequences down the road
<gasche> (I think Batteries has shown that it's very hard to make the right call each time)
<companion_cube> it's always complicated, don't you worry
<gasche> there is also the fact that
<gasche> people resent reviewers for bikeshedding on, for example, the function name
<gasche> but the name *really matters*
<gasche> (it's a case where the bike shed is the whole point, almost)
<cheater> is async still maintained or is it some sort of thing that isn't being used any more?
<gasche> I think we should develop an explicit process for how to handle those PRs, instead of the absence of directives we have now
<gasche> cheater: it is heavily used
<cheater> ok. i'm using a slightly older tutorial and apparently some types of some things have changed.
<companion_cube> gasche: names, and signatures (e.g. labels)
<gasche> (as you could see by looking at the version history)
<gasche> yep
<cheater> i'm not sure how to access the version history gasche - would you mind showing me where it is? it's literally my first few hours with ocaml
<gasche> for 4.03 we made an agreement at the dev. meeting to accept functions with an "unquestionable" interface: if anyone had a doubt, the function was not getting in
<Drup> gasche: I think that a good first approach would not really try to add new functions to the stdlib (such as String.split) but add the various common datatypes we need (such as the recent UChar, or, hopefully, iterator datatypes)
<gasche> cheater: first, there is a list of packages at https://opam.ocaml.org/packages/
<gasche> on https://opam.ocaml.org/packages/async/async.113.33.03/ you can see that the last async version was released last April
<mrvn> Does ocaml support the x32 ABI on PCs?
<cheater> there it is! thanks
<rks`_> Drup: "iterator datatypes"?
<rks`_> I don't see that happening.
<companion_cube> why not? :/
<cheater> i am trying to update this code to the latest async. would someone mind giving me a pointer? i'll describe what refactorings i did so far, but now i'm stuck
<companion_cube> there's a good reason to have them in the stdlib: they can't be provided from outside
<rks`_> result and option are obvious, for "iterator datatypes" there are different possible implementations, aren't there?
<gasche> mrvn: the bytecode compiler/runtime does, not ocamlopt
<rks`_> or am I misunderstanding what you guys are talking about?
<companion_cube> rks`_: there should be a discussion about it, yeah
<companion_cube> but this time involving the stdlib maintainers
<rks`_> I don't see the point.
<gasche> I meant to say that this 4.03 policy was really good in helping us make decisions
<companion_cube> well, how can I iterate on a Map if the stdlib doesn't provide iterators?
<gasche> (it's of course a bit more conservative than what we should have long-term)
<companion_cube> (I will try to propose data-structure-specific cursors, though)
<gasche> maybe I'll send an email about it
<rks`_> .
<gasche> hm
<rks`_> companion_cube: when you guys sent "iterator datatypes" I thought you were talking about you sequence library and such
<rks`_> or batteries Enum
<gasche> should I ask these questions on the caml-list thread, or on the github PR against contributing.md?
<Drup> rks`_: sequence
<rks`_> I didn't think you meant "Map should provide an iter function"
<Drup> (or gen)
<rks`_> gasche: doesn't matter, yotam will comment anyway
<Drup> Certainly not Enum
<companion_cube> rks`_: I'm thinking about to_gen/of_gen, for instance
<companion_cube> right now it's purely impossible to write this
<rks`_> right
<gasche> let's go to github
<gasche> it's more a question for devs/contributors
<gasche> hm
<companion_cube> gasche: discussion on the ml sounds ok, if you reply to Damien's announce
slash^ has joined #ocaml
<cheater> here's what i've done so far: http://sprunge.us/FSgh
<cheater> i would appreciate any hints on how to get this code to type check
<cheater> not sure how to make the relevant code into a Deferred
sh0t has joined #ocaml
A1977494 has joined #ocaml
al-damiri has joined #ocaml
sh0t has quit [Ping timeout: 244 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
sh0t has joined #ocaml
<cheater> ok. i looked inside async_rpc and that showed me what the type of ~on_unknown_rpc is. I got the thing to typecheck by saying: ~on_unknown_rpc:(`Close_connection) but i'm not sure how to make it log like it did before.
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gasche has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
travula has quit [Ping timeout: 252 seconds]
<hcarty> cheater: Latest async and core docs: https://ocaml.janestreet.com/ocaml-core/latest/doc/
<hcarty> cheater: I haven't used async_rpc before, but that may help
ewanas has quit [Ping timeout: 260 seconds]
<cheater> i got that stuff to compile :)
<cheater> but now i'm facing a syntax error in another module!
<hcarty> cheater: This 'with' syntax is from older syntax extensions. The more current/modern way to do this is something along the lines of "type t = { ... } [@@deriving sexp, bin_io, compare]"
<cheater> ok, i was searching around and couldn't find any reference to this use of "with"
<cheater> that makes sense
<cheater> in haskell i'd assume those are typeclasses, what are they called in ocaml?
<hcarty> The [@...] syntax specifies attributes. If you use an appropriate pre-processor those attributes can specify things like "generate serialization and comparison functions for this type"
<cheater> hcarty: thanks. so this is generics? is that what this mechanism is called?
<chelfi> cheater: ocaml does not have a mechanism for implictly passing functions around, like haskell typeclasses
<hcarty> cheater: Not really. These derived functions are built by looking at the language AST and building appropriate code based on that
<hcarty> And what chelfi said
<chelfi> the [@...] syntax is kinda the equivalent of Template Haskell in ocaml land
nicholasf has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<cheater> ahhh ok thanks
<cheater> thank you for this explanation, i'm learning very quickly here :-)
walter|r has quit [Remote host closed the connection]
pyon has quit [Disconnected by services]
pyon has joined #ocaml
<hcarty> cheater: Welcome to the wonderful world of OCaml :-)
nicholasf has quit [Remote host closed the connection]
<cheater> hcarty: :))
bensu has joined #ocaml
larhat has quit [Quit: Leaving.]
bensu has quit [Ping timeout: 252 seconds]
dhil has quit [Ping timeout: 272 seconds]
yunxing_ has joined #ocaml
mettekou has quit [Read error: Connection reset by peer]
<cheater> lol i just typed in some code that i guessed randomly would be in the library, and it was and everything compiled.
bensu has joined #ocaml
malc_ has joined #ocaml
MercurialAlchemi has joined #ocaml
<chelfi> if you used merlin you would not need to guess :p
<flux> well where's the fun in that..
sh0t has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
<dave24> I'm getting a type mismatch (is 'string option array array' but expected 'unit') on line 7 of this code: http://codepad.org/4yJWqpq4
<dave24> why does it think it should be "unit"
<flux> column?
<hcarty> dave24: You put ';' in the middle of the line
<flux> right, Array.append returns the new array, it doesn't modify the old one
<dave24> oh right, i need to do "loop (array.append....) result"
<dave24> thanks lads
wiredsister has joined #ocaml
<flux> btw, I should advice that one should typically prefer lists instead of arrays
<dave24> flux: hmm but this mysql binding uses arrays
<flux> you can convert the list into an array at the last step if that's appropriate
<hcarty> flux: Arrays are used there to match column numbers
<flux> the Array.append ret [|row|] is going to get slower as the size of ret increases
<flux> so something like: Some row -> loop (ret::row) result | None -> Array.of_list (List.rev ret) ?
<flux> oops, (row::ret) of course
<flux> you can construct the intermediate result in an array if you don't expect to have large results, such as is the case here, though :-)
AltGr has left #ocaml [#ocaml]
<dave24> oki
<flux> dave24, this is actually a very common pattern, to construct a list in reverse and then reverse it in the final step
<flux> or, in your case, you have so little data that you could just forgo the ret argument and do it the 'natural' way: let result = Sql.execute sel [||] in let rec loop () = match Sql.fetch result with | Some row -> row::loop () | None -> [] in Array.of_list @@ loop ()) :) (but risk stack overflow you were avoiding)
<aantron> companion_cube: hcarty: im going to merge Lwt_result https://github.com/ocsigen/lwt/pull/247 (in a bit). hcarty: i agree about things like the name of fail. i suggest we make follow-on PRs for those to discuss them independently. if that sounds reasonable to you guys, i'll post something to that effect on GH and proceed
<companion_cube> \o/
ewanas has joined #ocaml
<hcarty> aantron: Lovely! I'm fine with moving the conversation on naming specifics to a different PR
octachron has quit [Quit: Page closed]
sh0t has quit [Ping timeout: 246 seconds]
<hcarty> As far as names go, I'm biased toward Rresult as I've been happily using that for a while. I'm glad this is making it in to Lwt
AlexRussia has joined #ocaml
<companion_cube> I'm glad I won't have to reimplement it yet another time
<companion_cube> maybe we could have specific infix values, btw? so that we can have both lwt and lwt_result binders in scope
Reshi has quit [Ping timeout: 250 seconds]
atbagautdinov has left #ocaml [#ocaml]
<hcarty> companion_cube: And Lwt_option and Lwt_option_result and Lwt_result_option and Result_lwt and Option_lwt... I don't think I've needed Result_option_lwt yet though
<companion_cube> :D
<companion_cube> we need implicits
<hcarty> Indeed
wiredsis` has joined #ocaml
<aantron> impliciiiiiiiiiiits pleeaaaaaase
<aantron> had a project with many monads
<aantron> need implicits
rgrinberg has quit [Ping timeout: 244 seconds]
wiredsister has quit [Ping timeout: 260 seconds]
<zozozo> what's the lateste news about implicits ?
<aantron> gah, the travis builds havent even started. im going to wait for at least 1 row in each of {4.01, 4.02, 4.03} to complete, just in case, then its merged :) thanks companion_cube, hcarty! :)
yunxing_ has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
wiredsis` has quit [Remote host closed the connection]
hbar_ has joined #ocaml
mettekou has joined #ocaml
<chelfi> zozozo: looks nice, not ready yet ? :)
<zozozo> any idea as to when it will be stable enough to be considered for inclusion ?
<hcarty> zozozo: The last answer I saw to that question was, effectively, "Don't ask"
rgrinberg has joined #ocaml
<zozozo> :/
<zozozo> well, at least I can dream while waiting, ^^
Kakadu has quit [Quit: Page closed]
wiredsister has joined #ocaml
malc_ has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
walter|r has joined #ocaml
Algebr` has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
TheLemonMan has joined #ocaml
bensu___ has joined #ocaml
<companion_cube> aantron: travis on mac OS is the joke, still not finished
<aantron> yeah, merging now though
<aantron> havent seen a day like this in travis yet.
rand__ has joined #ocaml
bensu____ has joined #ocaml
pyon has quit [Ping timeout: 264 seconds]
wolfcore has quit [Ping timeout: 264 seconds]
nzyuzin_ has quit [Ping timeout: 264 seconds]
osheeta has quit [Ping timeout: 264 seconds]
metaglog has quit [Ping timeout: 264 seconds]
bensu has quit [Ping timeout: 252 seconds]
osheeta has joined #ocaml
bensu___ has quit [Ping timeout: 264 seconds]
M-pesterhazy has quit [Ping timeout: 264 seconds]
cdidd has quit [Ping timeout: 264 seconds]
jerith has quit [Ping timeout: 264 seconds]
luzie has quit [Ping timeout: 264 seconds]
asm89 has quit [Ping timeout: 264 seconds]
nopf has quit [Ping timeout: 264 seconds]
nzyuzin has joined #ocaml
jerith has joined #ocaml
nopf has joined #ocaml
wolfcore has joined #ocaml
Algebr` has quit [Read error: Connection reset by peer]
Algebr` has joined #ocaml
M-pesterhazy has joined #ocaml
luzie has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
metaglog has joined #ocaml
metaglog has quit [Changing host]
metaglog has joined #ocaml
AllanDaemon has quit [Ping timeout: 244 seconds]
Kakadu has joined #ocaml
cdidd has joined #ocaml
asm89 has joined #ocaml
wiredsister has quit [Ping timeout: 240 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
sh0t has quit [Ping timeout: 276 seconds]
noplamodo has quit [Quit: ZNC - http://znc.in]
yunxing_ has quit [Remote host closed the connection]
noplamodo has joined #ocaml
manud has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 244 seconds]
manud has quit [Client Quit]
walter|r has quit [Remote host closed the connection]
manud has joined #ocaml
walter|r has joined #ocaml
adrien has quit [Ping timeout: 246 seconds]
adrien has joined #ocaml
def` has quit [Ping timeout: 258 seconds]
def` has joined #ocaml
copy` has joined #ocaml
octachron has quit [Ping timeout: 244 seconds]
walter|r has quit [Ping timeout: 244 seconds]
noplamodo has quit [Read error: Connection timed out]
manud has quit [Ping timeout: 260 seconds]
manud has joined #ocaml
<hcarty> Is it ok to call Lwt.async before any calls to Lwt_main.run? With the async'd thread run once Lwt_main.run is called?
<aantron> hcarty: without confirming, yes
<hcarty> aantron: Thanks. I'll try it and see what happens :-)
<aantron> notionally, i understood that lwt_main just allows you to escape the monad and actually force something to run somewhere
<aantron> but i would have to read the lwt_main code to be able to say operationally
<aantron> and if it works now, i intend to preserve that :) unless i find some crazy reason not to, but i doubt that
rgrinberg has quit [Ping timeout: 244 seconds]
<aantron> i suppose i'll look into it, and add the appropriate tests to lwt itself, if warranted
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<hcarty> aantron: It works
sdothum has joined #ocaml
<aantron> hcarty: ok, thanks
<hcarty> A simple test for my use-case, prints out multiple Hello lines as expected
<aantron> ok nice :)
<hcarty> aantron: Not really regression test material! :-) But it illustrates what I was hoping for functionality-wise
<aantron> hehe yeah :)
<cheater> i'm trying to #use a file in the interpreter, but it complains about not finding the module Core (which I'm using in that file). what am i supposed to do?
<cheater> this is in the repl
yunxing_ has joined #ocaml
<aantron> cheater: are you following some particular set of instructions? how did you install core?
<zozozo> I just stumbled on a problem concerning the ocaml mailing list and dkim signatures, is it already known, or should I report it somewhere ?
<cheater> i installed core via opam. i've now struck upon the right set of google keywords (core toplevel ocaml) so i'll try following what i've found there
ewanas has quit [Ping timeout: 260 seconds]
sepp2k has quit [Quit: Leaving.]
<hcarty> cheater: Can you gist/pastebin/... the code you're #use-ing?
<aantron> cheater: have you had success using #require instead of #use?
<aantron> hcarty: yeah, to a first approximation, lwt.async and lwt_main are orthogonal. if the thread you ran async on does some kind of real I/O, lwt_engine will become involved... but thats orthogonal to whether you wrapped it in async or not.
<aantron> (lwt_engine being called by lwt_main)
noplamodo has joined #ocaml
<aantron> the thread just goes into the sea of lwt threads along with all others, and can be run during lwt_main
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<aantron> so it's not inherently different from defining a big thread first, some of which may be run immediately, and some later, and then passing that to lwt_main
<cheater> aantron: no instead i installed utop (i had been using ocaml before) and added the stuff from this email to ~/.ocamlinit: http://lists.ocaml.org/pipermail/core/2012-November/001583.html
<hcarty> aantron: Thanks! That's what I expected, but more from a "that seems like it would make sense" perspective rather than "I know the intended semantics"
<cheater> this worked
<aantron> hcarty: right :)
<cheater> if i'm in async, and would like to read stdin, how do i best do this?
<cheater> i'm in a function which is 'a -> unit Deferred.t = <fun>
<aantron> cheater: so your problem with #use is resolved, is that correct?
<cheater> yes thank you very much :-)
Algebr` has quit [Ping timeout: 250 seconds]
<cheater> maybe doing this inside a deferred isn't the best idea, i don't know, it seems like async is only deferreds, hmm....
<aantron> i really don't know my async. but google suggests this module: https://ocaml.janestreet.com/ocaml-core/113.24/doc/async/Async/Std.mod/Reader.mod/
darkf has joined #ocaml
<aantron> cheater: yeah, i think you will have to use deferred. thats the point of async :)
Simn has quit [Quit: Leaving]
<aantron> people who know async better maybe can correct me, but
<aantron> it looks like you would have to first call Lazy.force on Reader.stdin
<aantron> then pass that to Reader.read_line (for example)
<aantron> yeah, the docs i linked are a more recent version though
<aantron> oh wait
<cheater> that's what comes up in google
<aantron> ah yeah, i think thats the same module
<cheater> thanks for pointing out they're old
<aantron> ah
<cheater> can you tell me this though aantron? why is this so pretty:
<cheater> while this is so ugly:
<aantron> there is also in_channel, looks higher-level
<aantron> i don't know. i think the second one is prettier :p
<cheater> it is not
<cheater> :)
<aantron> hehe
<aantron> well its good at least they are experimenting with different styles
<cheater> fyi :)
<cheater> mm yeah
<cheater> but i don't think it's experimenting more like breaking
<aantron> have you tried using in_channel?
<aantron> hehe
<aantron> wait i need to stop
<aantron> that module is not monadic, ie no deferred
<aantron> so i guess it really depends on what you want to do
<aantron> thats stock ocamldoc :)
<cheater> aantron: i don't think in_channel will fit inside a Defered
<aantron> have to step away for a bit
<aantron> yeah, it wont
Algebr` has joined #ocaml
<cheater> so i'll use Reader
<aantron> at least not politely
<cheater> thank you
bensu has joined #ocaml
seangrove has joined #ocaml
bensu____ has quit [Ping timeout: 272 seconds]
walter|r has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
manud has quit [Ping timeout: 246 seconds]
hcarty has quit [Ping timeout: 240 seconds]
walter|r has quit [Ping timeout: 276 seconds]
pyon has joined #ocaml
dave24 has quit [Quit: leaving]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
manud has joined #ocaml
<cheater> ok, i'm trying to use this Reader and Writer stuff and I figured out the Reader part but i'm not sure how to get a Deferred out of Writer. This is the code I'm trying to use: (Reader.really_read_line ~wait_time:(sec 5.) (Lazy.force Reader.stdin)) >>= (Writer.write_line (Lazy.force Writer.stdout));
<aantron> hmm there should be some kind of flushing function. maybe you can wait using flushed, but i am not sure thats the right way
<cheater> well there's this: val flushed : t -> unit Import.Deferred.t
<cheater> flushed t returns a deferred that will become determined when all prior writes complete (i.e. the write() system call returns). If a prior write fails, then the deferred will never become determined.
<cheater> but that doesn't look right
<aantron> yeah thats what i meant. it almost looks right, except for dealing with failure
<aantron> ok
<cheater> i dunno about failure
<aantron> the module comment answers this
<cheater> go on?
<aantron> see the 2nd parapgraph. actually, maybe you should link me to the version you are reading
<aantron> in case they are different :)
<cheater> this is what i'm reading
<aantron> ok yeah, same one. see the second paragraph
<cheater> i don't really care about errors right now though, i'm just trying to get a Deferred out of Writer
<aantron> then wait on flushed
<cheater> ok
<cheater> i've got another issue too.. apparently ocaml runs out of memory while building?
<aantron> also i am not sure if Writer is the right module for basic work, but i don't know
<cheater> so i changed that line to what's only on the left of bind. the line now reads: (Reader.really_read_line ~wait_time:(sec 5.) (Lazy.force Reader.stdin))
<aantron> while building? can you be more specific as to what the problem is?
<cheater> yeah.
<cheater> was just copying
<cheater> i get this error: $ corebuild -j 4 -pkg async,textutils chat_app.native; ./chat_app.native -client
<cheater> + ocamlfind ocamlc -c -w A-4-33-40-41-42-43-34-44 -strict-sequence -g -bin-annot -short-paths -thread -package async,textutils -package core -ppx 'ppx-jane -as-ppx' -o chat_app.cmo chat_app.ml
<cheater> Fatal error: out of memory.
<cheater> Command exited with code 2.
<aantron> fascinating
<aantron> i can only guess about that, since i dont know what corebuild really does. but core is a pretty large library, perhaps that has something to do with this. but i wouldnt expect running out of memory
<aantron> i dont really use core, so i hope someone can help
<aantron> (going to have to at least play with it some day though :p )
<cheater> this is fairly crazy
<cheater> want to try the code on your computer?
<aantron> sure, can you make a gist/pastebin/whatever?
manud has quit [Quit: manud]
<aantron> is this the version that causes out of memory error during build?
<cheater> no, you'll have to remove what's after bind on that line
<cheater> and bind too
agarwal1975 has quit [Quit: agarwal1975]
<aantron> can you paste the one that fails, so i dont get it wrong? :)
<cheater> actually, wait, i can't get it to run out of memory any more
<aantron> hm ok
<cheater> 1 sec
<cheater> i'll try again
<cheater> nope it magically stopped doing that
<cheater> :+1:
Algebr` has joined #ocaml
ewanas has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
nicoo has quit [Ping timeout: 244 seconds]
nicoo has joined #ocaml
yunxing_ has quit [Remote host closed the connection]
|2321 has quit [Quit: Connection closed for inactivity]
<cheater> do all ocaml modules always define just one type they keep on refering to as "t"?
<Drup> No, but it's a very common idiom
manud has joined #ocaml
<cheater> thanks
<cheater> aantron: wow i actually got it to work now
hx1 has joined #ocaml
<cheater> (Reader.really_read_line ~wait_time:(sec 3.) (Lazy.force Reader.stdin))
<cheater> >>= (fun s -> (Core.Std.Option.iter s print_endline; return ()))
<cheater> just had to let the types sink in
<cheater> and the fact that ocaml doesn't care about purity
<aantron> i guess that works. but if you were writing large strings or doing other IO where you want Core to actually intervene, i think you'd have to avoid print_endline
<cheater> mhm
<cheater> not the case here
<cheater> thank you
fluter has joined #ocaml
StrykerKKD has joined #ocaml
Kakadu has quit [Remote host closed the connection]
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
Sorella has quit [Quit: Connection closed for inactivity]
nicholasf has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
StrykerKKD has quit [Quit: Leaving]
madroach_ has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
silver has quit [Quit: rakede]
hx1 has quit [Ping timeout: 240 seconds]
ewanas has quit [Ping timeout: 244 seconds]
rand__ has quit [Quit: leaving]
nicholasf has quit [Ping timeout: 246 seconds]