gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
<NaCl> And Core_arg is kind of... "bleh"
scrappy_doo_ is now known as Drakken
<Drakken> Anyone familiar with Calendar?
dgbaley27 has left #ocaml []
arubin has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
roha has quit [Ping timeout: 248 seconds]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
ecc has quit [Read error: No route to host]
<oriba_> hello why is this not working? http://paste.pocoo.org/show/518681/
<oriba_> get err msg, that first type is not bound
<oriba_> initialization should be done on object construction...
<oriba_> ah, I need a type constraining
<oriba_> then it works
sebz has quit [Quit: Computer has gone to sleep.]
oriba_ has quit [Quit: oriba_]
sebz has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
Drakken has left #ocaml []
sebz has quit [Quit: Computer has gone to sleep.]
arubin has quit [Quit: arubin]
struktured has joined #ocaml
media-786 has joined #ocaml
struktured has quit [Remote host closed the connection]
sebz has joined #ocaml
media-786 has quit [Read error: Connection reset by peer]
sebz has quit [Quit: Computer has gone to sleep.]
struktured has joined #ocaml
sebz has joined #ocaml
yroeht has quit [Ping timeout: 240 seconds]
yroeht has joined #ocaml
andreypopp has joined #ocaml
ankit9 has joined #ocaml
smw has joined #ocaml
<smw> anyone have a suggestion for a tutorial?
<smw> I know many other languages
smw has quit [Remote host closed the connection]
edwin has joined #ocaml
ygrek has joined #ocaml
ankit9 has quit [Quit: Leaving]
Drakken has joined #ocaml
pango has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
Snark has joined #ocaml
avsm has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
Kakadu has joined #ocaml
roha has joined #ocaml
ikaros has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
Cyanure has joined #ocaml
sebz has joined #ocaml
<adrien> would anyone know a make-like utility that is not completely stupid?
sebz has quit [Quit: Computer has gone to sleep.]
<adrien> unless I'm mistaken, conditionals are pure pain in make
svenl has joined #ocaml
sebz has joined #ocaml
edwin has quit [Remote host closed the connection]
<andreypopp> adrien: I like pmake
<adrien> andreypopp: I was going to say I don't have it on my system, but I do! :-)
<adrien> because, as I thought, there is no && or || in gnu make: http://osdir.com/ml/gnu.make.windows/2004-03/msg00063.html
sebz has quit [Quit: Computer has gone to sleep.]
<adrien> having to use such abominations instead of $A == $B && $A == $C is really not something I want to do:
<adrien> ifneq (,$(filter $(A),$(B) $(C)))
<adrien> The filter will return B and/or C if they match A, and the ifneq empty
<adrien> string will be true if the filter returns any value.
<andreypopp> adrien: pmake handles that — http://www.freebsd.org/doc/en/books/pmake/condition.html
<adrien> yes, I've seen it; I'm probably going to switch to pmake in a few minutes
<andreypopp> adrien: gmake has also its own advantages but it rarely comes I have to use them...
<adrien> I'm making sure there is no huge issue with it but I really think I'm going to get rid of gnu make
scrappy_doo_ has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
Drakken has quit [Ping timeout: 252 seconds]
<sgnb`> rixed: I'm not committed to anything with the current license...
sgnb` is now known as sgnb
<adrien> andreypopp: I can't make the conditionals work properly: both branches of an if/else/endif always get evaluated, even with the documentation's examples
<adrien> andreypopp: does the following seem to work as expected for you? http://vpaste.net/qp66D (wrt my previous message: that both branches always get evaluated)
roha has quit [Read error: Operation timed out]
<andreypopp> adrien: it can sounds insane, but can you use . instead of # to prepend if-else?
<adrien> doh; I just noticed the same
<adrien> works fine... ><
<adrien> I don't know, is there something I haven't seen in http://www.freebsd.org/doc/en/books/pmake/condition.html ? it definitely uses '#'
<andreypopp> adrien: sorry for that, I should have pointed you to the man page not there
<adrien> andreypopp: well, it's my own mistake but I didn't expect such a difference
<adrien> but I had the manpages; I simply thought both were fine
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
sepp2k has joined #ocaml
raichoo has joined #ocaml
andreypopp has quit [Quit: Leaving.]
vivanov has joined #ocaml
<vivanov> let nearest_int x = let c = ceil x in let f = floor x in Int.of_float (if Float.abs (c -. x) < Float.abs(f -. x ) then c else f)
<vivanov> is it a safe way of finding closest int?
jonludlam_home has joined #ocaml
itewsh has joined #ocaml
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
<smango> vivanov: you could also just do let nearest_int x = floor (x +. 0.5)
<adrien> you always got some biais though; you could also use "ceil (x -. 0.5)" for negatives iirc
<adrien> (and a number of other variations)
<NaCl> adrien: as much as the argparse in Batteries do what I want, I don't want to install batteries. xD
<adrien> too big?
<NaCl> And too many deps
<NaCl> I was just going to write a small tool that would apply a regexp to a set of file names
<adrien> gruik
<adrien> but it doest have that many deps, does it?
<adrien> wouldn't it be possible to have a finer-grained META file for batteries?
<adrien> link what you use?
<NaCl> I still have to build it, and then figure out how to use it
<NaCl> bbiab
<vivanov> smango, adrien: thx a lot :)
<adrien> vivanov: you can go through http://en.wikipedia.org/wiki/Rounding quickly to get an idea of the things involved
<vivanov> ok i will
<NaCl> adrien: bleh. And have you ever used Batteries?
<adrien> only very lightly
<adrien> my time has been split between low-level stuff (lablgtk and bindings) and the need to work on windows and with a minimal set of deps (yypkg)
<NaCl> I'm either going to write this thing in ocaml, c, or python
oriba has joined #ocaml
yezariaely has joined #ocaml
vivanov has quit [Quit: leaving]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
eikke has joined #ocaml
edwin has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
dnolen has joined #ocaml
ski has quit [Ping timeout: 255 seconds]
<beginner> oh gosh
<beginner> #C is the most useless channel I have ever been
<beginner> rather than helping
<beginner> they troll
<adrien> I've seen quotes from the channel I think; it has been enough for me
ftrvxmtrx has quit [Quit: Leaving]
arubin has joined #ocaml
beginner has left #ocaml []
beginner has joined #ocaml
<beginner> I couldn't help myself but left the channel after writing this message: "<beginner> My apologies, but I think this channel is full of crackheads who are nothing but trolls. Thank you for the time"
lamawithonel has quit [Remote host closed the connection]
raichoo has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
struktured has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
<adrien> edwin: agreed ;-)
itewsh has quit [Quit: o/]
struktured has quit [Ping timeout: 248 seconds]
<thelema> NaCl: Batteries 2.0 has zero dependencies
<thelema> NaCl: and 1.x only one - camomile.
<thelema> adrien: as for fine-grained META - ocaml does link only what you use (plus deps). If you don't 'open Batteries' but instead use BatFoo directly, it will link less, depending on what you use
<adrien> thelema: right; that only applied in the case of having many deps
ski has joined #ocaml
<thelema> adrien: ah. well, not the case.
<adrien> yup =)
<edwin> adrien: also a place to collect language/stdlib improvements from the community might be good, but that could quickly turn into a too long list to manage
<edwin> adrien: for example lack of big-endian/little-endian serialization of integers in the stdlib is quite problematic. Try convincing a C programmer that you need to write a function to do that, or that they need to use a 3rdparty lib (bitstring) to get it, and even there with the cost of an extra function call
dnolen has quit [Quit: dnolen]
<edwin> adrien: but I left this out of the mail, because it'd just hijack the thread into a "lets rant about ocaml"
<adrien> heheh
<NaCl> thelema: far out
raichoo has joined #ocaml
<thelema> NaCl: try the latest github
sebz has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
<adrien> I'm officialy in love with pmake ;p
raichoo_ has joined #ocaml
raichoo_ has quit [Client Quit]
sepp2k has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
raichoo has quit [Ping timeout: 252 seconds]
<thelema> adrien: pmake?
* thelema is reading
<adrien> thelema: I find it clearer than gnu make and it does most of what you'd use with gnu make without forcing you to make unreadable stuff
<adrien> there might be as many versions of pmake as there are BSD flavors however
<hcarty> adrien: How widely and easily available is pmake?
<adrien> I think I've stayed on a common denominator (the linux one) while still being able to do quite a lot of stuff
<adrien> afaict, pmake is requirement to build ash (the shell) and is packaged almost everywhere
<thelema> adrien: windows?
<adrien> thelema: great question
<adrien> I don't know yet
<adrien> I might have to do something on windows at some point in the next few days; I'll try to remember trying it
sebz has joined #ocaml
ygrek has joined #ocaml
<hcarty> thelema: The README.md from Batteries should be updated to OCaml >= 3.12 in master
<hcarty> thelema: I can submit a patch/pull request once I figure out the proper way to update my fork...
<thelema> hcarty: quite true.
roha has joined #ocaml
<thelema> I look forward to the change
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
Anarchos has joined #ocaml
tlockney has quit [Excess Flood]
tlockney has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Read error: Connection reset by peer]
dnolen has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
<hcarty> thelema: Pull request submitted, along with a few other documentation updates.
<thelema> hcarty: awesome
milosn has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<hcarty> thelema: Do you think it is worth adding a BatResult.catch_opt(ion) function?
yezariaely has quit [Quit: Leaving.]
<thelema> hcarty: I have a few batresult functions in a branch
<thelema> I think the better choice is to improve batresult to make it as good as option
<hcarty> thelema: I agree
<thelema> pull request merged
<thelema> (do you get email notification of the merge automatically?)
<hcarty> thelema: Nothing yet, but that may be a lag in notification and/or something in my github account preferences
<thelema> I already got my github emails relating to the commit, so github's not lagging on that.
<hcarty> I don't see an option to receive notifications when a pull request is merged
<thelema> well, if you haven't received an email, I guess you don't get notification.
<Qrntzz> hrm, I'm a bit puzzled on whether JoCaml does utilise multiple cores in parallel or not
<Qrntzz> could anyone explain it to me please?
<hcarty> Qrntzz: It does not unless you run multiple processes
<Qrntzz> I know it's not implicitly parallel; but spawning a process allows it to be scheduled by the OS to another core, right?
<Qrntzz> just confused because I've seen some controversial statements about that
<hcarty> Both OCaml and JoCaml allow you to fork processes. In both cases, these proccesses will run on separate cores.
<hcarty> Qrntzz: Some method of communication between processes is still required. JoCaml has some support for this, but I don't think that it is implicit in the fork. If I recall correctly, you need to setup the communication manually.
<Qrntzz> hcarty: so, the JoCaml spawn construct actually yields a process that is similar to a forked one?
<hcarty> Qrntzz: I don't think JoCaml has any builtin support for creating new processes beyond fork
<hcarty> I haven't read the JoCaml documentation in almost a year, so that may have changed.
<Qrntzz> hcarty: well, processes (as in syntactic classes) spawned with the spawn keyword itself are shown as child processes (as in scheduled tasks) of the jocaml interpreter in system monitors like htop
<Qrntzz> so I tend to gravitate more towards the point they are somewhat resembling forks
<thelema> Qrntzz: doesn't htop show threads by default?
<thelema> but if so, that's good news
<hcarty> Qrntzz: Looking at the documentation, it certainly seems to say that multiple, parrallel processes are used
<hcarty> Qrntzz: With spawn
<hcarty> I wonder if the separate processes are generated by forking or some other method. If it is built on forking then it may not be much different than using the invoke function floating around.
<Qrntzz> thelema: don't know really, it might do
andreypopp has joined #ocaml
<Qrntzz> hcarty: is there any (unbiased) method for testing this?
<hcarty> Qrntzz: Testing which part? How the processes are created, or comparing JoCaml + spawn vs OCaml + invoke?
<Qrntzz> hcarty: more about how the processes are created
<thelema> IIRC, 'H' in top enables threads being shown
<hcarty> Qrntzz: Probably emailing the maintainers :-)
<Qrntzz> CPU core usage while running a few infinite loops simultaneously is a pretty subjective test imo
<Qrntzz> but it shows some kind of switches going around
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
andreypopp has quit [Quit: Leaving.]
<hcarty> thelema: If you merge master into you result-extensions branch I'll try to take a look at it today or tomorrow
<Qrntzz> indeed it seems JoCaml uses user threads at runtime and not really multiple cores
<Qrntzz> which makes me sad
<hcarty> Qrntzz: invoke/fork, zeromq, MPI, camlp3l are all reasonable options, depending on your specific needs
<hcarty> Qrntzz: preludeml has some nicely convenient fork-based parallel list and array iter and map functions.
<thelema> hcarty: I'll probably do the reverse and implement the rest of the option functions myself, if you can give it a review, that'll be great
<hcarty> thelema: Sounds good. All I request up-front is function naming and argument ordering consistency between the two
<Qrntzz> hcarty: thanks for the info, I just hoped paralellism in JoCaml would be reachable kind of out-of-the-box, using just built-in primitives
<thelema> between option and result? ok.
<hcarty> thelema: Yes
<hcarty> thelema: If/Where that's possible and reasonable
<hcarty> Qrntzz: I had hoped for the same :-) preludeml's functions are as close to "for free" parallelism as OCaml gets
<hcarty> Qrntzz: I think there is another library as well... Functory maybe?... which provides similar parallel computing support
<Qrntzz> yes, I've seen functory
iago has joined #ocaml
jonludlam_home has quit [Remote host closed the connection]
struktured has joined #ocaml
jonludlam_home has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<avsm> thelema: odb looks like a wonderful complement to Homebrew on the mac
<thelema> avsm: it's quite simple. but to does work
<avsm> question: could the package list be managed on github too, so i can just fork and add some, as with Homebrew?
<thelema> s/do/it/
<thelema> the package list is oasis-db at the moment
<avsm> i've submitted some pull requests to Homebrew/ocaml, but they are pushing back on libraries as they dont want them in homebrew
<thelema> I've thought a bit about trying to work from local dirs, but it's more complex, as the server handles parsing the _oasis files at the moment
<avsm> ideally, could install apps (like Lwt-toplevel) through Homebrew, and make it aware of Odb as the mechanism to install packages
<avsm> ah hrm, yet another layer to go through to add packages
<avsm> i love Homebrew as it minimises human interaction for adding my own packages :)
<thelema> avsm: all odb does now is download the package, extract it and make install
<thelema> + deps
<thelema> if you want to build on it, go ahead.
<thelema> odb works for apps too - it builds and installs oasis
<thelema> although the name of the package is the name of the executable, so...
<avsm> will do for a new project that will be revealed 'soon', good to know of its existence :)
<thelema> it makes lots of simplifying assumptions
Kakadu has quit [Read error: Connection reset by peer]
<hcarty> thelema: I'd like to create a BatExceptionless module (or BatteriesExceptionless). It would be equivalent to Batteries with all of the Exceptionless modules in use. Do you have an opinion on the naming or approach?
<thelema> hcarty: BatteriesNoexn?
<hcarty> thelema: I'm planning to use 3.12-isms heavily in the .mli and possibly in the .ml
<thelema> and for approach, I'd suggest copying batteries.ml and adding "include Foo.Exceptionless" a lot
<thelema> and I wouldn't bother writing a .mli
<thelema> at least I haven't for batteries.ml. If it's not so hard with 3.12isms, maybe we should have one.
<hcarty> Lots of "module type of"'s
<thelema> I doubt it'd be useful
<hcarty> Probably not
<hcarty> thelema: I'm off for now. I'll ping you or send a pull request when I have something to look at.
<thelema> ok
<thelema> if you send a pull req, gasche is pretty quick on noticing those, for 2 reviews
dnolen has quit [Quit: dnolen]
eikke has joined #ocaml
Snark has quit [Quit: Quitte]
<thelema> gildor: ping
<thelema> e
<thelema> Page History
ygrek has quit [Quit: Leaving]
scrappy_doo_ has quit [Ping timeout: 252 seconds]
scrappy_doo_ has joined #ocaml
eikke has quit [Ping timeout: 255 seconds]
edwin has quit [Remote host closed the connection]
Plex has joined #ocaml
avsm has quit [Quit: Leaving.]
Morphous has quit [Ping timeout: 268 seconds]
pilki has joined #ocaml
<pilki> hola
<thelema> hi
<pilki> I'm playing around with GADTs in trunk
<pilki> and I think I don't understand anything :-\
<pilki> say I have the classical type (_, _) eq = Eq : ('a, 'a) eq;;
<pilki> this works fine :
<pilki> let f (type t) (x:t) (e: (t, int) eq) =
<pilki> let Eq = e in x + 1
<thelema> I can't say I understand GADTs except at their most abstract level - type paremeters can vary in output
<pilki> and I type val f : 'a -> ('a, int) eq -> int
<pilki> now, say I want something more subtle
<pilki> Error: This expression has type ex#0 M.t
<pilki> but an expression was expected of type int
Morphous has joined #ocaml
<thelema> ok, that's accurate, because int isn't a M.t
<pilki> it is, (is_int x) is a proof of it !
zorun has quit [Read error: Connection reset by peer]
<thelema> yes, but that equivalence is hidden by M's interface
<pilki> no, it's exported by the eq
<thelema> I don't think it is.
<pilki> I think it shoud be, that's all the point of the eq type
<tomprince> I would agree that it would make sense that it is, but it probably isn't implemented. It isn't designed as a theorem prover, after all.
<thelema> by using is_int, x is inferred to be "'a t", and that can't unify with int because 'a t is abstract
zorun has joined #ocaml
<pilki> look at my first example that works
<pilki> tomprince : type unification *is* the goal of GADTs, so if it does not work...
<thelema> pilki: it's unifying 'a and int there. Maybe it's the nominal typing involved with modules.
<thelema> (that breaks your 2nd code)
<pilki> I think it's mostly buggy :)
<pilki> I'm building a minimal example
<thelema> could be - poke garrigue or mantis with your problem
<pilki> it seems it can only unify type variables
<thelema> that makes sense
avsm has joined #ocaml
gasche has joined #ocaml
<gasche> pilki:
<gasche> let conv (type a) (type b) (x : a) (eq : (a, b) eq) : b =
<gasche> match eq with
<gasche> | Eq -> x
<gasche> let foo (type a) (x : a M.t) =
<gasche> conv x (M.is_int x) + 1
<gasche> (no idea why this works)
<gasche> note that, in conv, "match eq with Eq -> ..." and "let Eq = eq in ..." are *not* equivalent
<gasche> I think we could ask Jacques on the list; discussing GADT would be appropriate indeed nowadays
<pilki> let bar' (x: M1.t) (e: (M1.t, int) eq) =
<pilki> let Eq = e in
<pilki> x + 1
<pilki> arghl, sorry
<pilki> let cast (type a) (type b) (e: (a, b) eq) (x: a) =
<pilki> let Eq = e in (x:b)
<pilki> works well
<pilki> so I don't see the difference between match and let
Cyanure has quit [Remote host closed the connection]
dnolen has joined #ocaml
<gasche> hmm
<gasche> does not work on my machine
<gasche> I must have a slightly-old trunk, let's update
dnolen has quit [Remote host closed the connection]
dnolen has joined #ocaml
<pilki> I sent and email to Jacques
<pilki> we'll see
dnolen has quit [Client Quit]
<pilki> good night
pilki has quit [Quit: Leaving]
oriba has quit [Ping timeout: 240 seconds]
gasche has quit [Ping timeout: 240 seconds]
roha has quit [Ping timeout: 240 seconds]
oriba has joined #ocaml
EmmanuelOga has joined #ocaml
avsm has quit [Quit: Leaving.]
ikaros has quit [Quit: Ex-Chat]
struktured has quit [Remote host closed the connection]