flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
<Yoric[DT]> (would be easier with GADTs, I figure)
kaustuv_ has quit [Read error: 104 (Connection reset by peer)]
kaustuv_ has joined #ocaml
rwmjones_ has quit ["Closed connection"]
m3ga has joined #ocaml
seafood has joined #ocaml
hsuh has joined #ocaml
mwhitney_ has quit [Read error: 110 (Connection timed out)]
seafood has quit []
seafood has joined #ocaml
<koppology> I am still somewhat troubled by the File.lines_of idiom
<koppology> I know that in Python it is common to use a generator to iterate over a file without loading it into memory
<koppology> (sorry for mentioning Python on the Ocaml channel :) )
<Camarade_Tux> he, there is pycaml and camlpy ;)
seafood has quit []
hkBst has quit [Read error: 104 (Connection reset by peer)]
<Camarade_Tux> http://www.reddit.com/r/programming/comments/86wko/minilight_a_minimal_global_illumination_renderer/ <- as I state in one of the comments, the ocaml version runs 50% faster than the C++ one on my computer :D
<Camarade_Tux> (and it uses objects)
Yoric[DT] has quit ["Ex-Chat"]
<Camarade_Tux> if HLVM speeds up ocaml by a 2 to 3 factor for such computations, I'm going to buy Harrop/FlyingFrog shares !
<thelema_> koppology: if you feel any better, the whole file isn't loaded at once.
Camarade_Tux has quit ["Leaving"]
rhar has joined #ocaml
<thelema_> actually, I think it might actually buffer before the get_char phase, so isn't as inefficient as I thought
<thelema_> I thnk it even mmaps the file if possible.
<thelema_> oops, no - you have to ask for that yourself -- IO.lines_of (open_in ~mode:[`mmap] filename)
<thelema_> quand je sors du metro, je pousse les vieux!
mwhitney_ has joined #ocaml
vuln has joined #ocaml
jeddhaberstro has quit []
seafood has joined #ocaml
koppology has quit [Remote closed the connection]
rhar has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
hsuh has quit [calvino.freenode.net irc.freenode.net]
jonafan has quit [calvino.freenode.net irc.freenode.net]
jamii has quit [calvino.freenode.net irc.freenode.net]
kaustuv has quit [calvino.freenode.net irc.freenode.net]
maxote has quit [calvino.freenode.net irc.freenode.net]
hsuh has joined #ocaml
jonafan has joined #ocaml
jamii has joined #ocaml
kaustuv has joined #ocaml
maxote has joined #ocaml
mwhitney_ has quit [Read error: 110 (Connection timed out)]
seafood_ has quit [Read error: 110 (Connection timed out)]
olegfink has quit [Remote closed the connection]
mwhitney_ has joined #ocaml
olegfink has joined #ocaml
jlouis has quit [Read error: 145 (Connection timed out)]
hsuh has quit ["bye tango dancers"]
sporkmonger has quit []
mwhitney__ has joined #ocaml
mwhitney_ has quit [Read error: 104 (Connection reset by peer)]
vuln has quit ["leaving"]
mwhitney__ has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
<flx_> gildor, well, I was about to check if the dates were any better there, but the links at: http://mirror.ocamlcore.org/caml.inria.fr/pub/ml-archives/caml-list/2008/01/index.en.html don't work at all
pierre_m has joined #ocaml
<pierre_m> hi
<pierre_m> anybody here use ocaml-r ?
sanguinev has joined #ocaml
<dj_ryan> heh
<dj_ryan> apparently "no"
<dj_ryan> so a question
<dj_ryan> how low level can i go with ocaml
<dj_ryan> lets say i wanted to write a memory intensive database product
* pierre_m doesn't go low level
<flx_> dj_ryan, you can use mmap and you have the posix functions from the Unix-module at your disposal
<dj_ryan> hmm
<dj_ryan> lets say i dont have the option of using mmap
<flx_> shared memory.. I don't remember existing primitives for that, but I suppose you could write them. finding a way to use them safely can be interesting..
<flx_> (other than mmapping /dev/zero that is for shm, but that requires parent-child relationship)
mwhitney__ has quit [Read error: 110 (Connection timed out)]
<tsuyoshi> you can mmap /dev/shm
mwhitney__ has joined #ocaml
<tsuyoshi> ocamlnet also has a posix shared memory hash table
<dj_ryan> hmm
<dj_ryan> interesting
<flx_> in any case, I don't see a problem in writing a database server in O'Caml
<tsuyoshi> I am working on one myself.. but I just wrote c stubs for a lot of stuff
<dj_ryan> intersting
<dj_ryan> so you hve to write certain memory primitives in C
<tsuyoshi> the locking is pretty hard to do in pure ocaml
seafood has joined #ocaml
<tsuyoshi> you can use fcntl locks, but it's a little slow
<dj_ryan> yeah you wouldnt want to do that
<dj_ryan> you probably want pthread-based locks
<tsuyoshi> yeah, that's what I did
Yoric[DT] has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
seafood has quit [Read error: 110 (Connection timed out)]
verte has joined #ocaml
_zack has joined #ocaml
Alpounet has joined #ocaml
seafood has joined #ocaml
_zack has quit [Read error: 104 (Connection reset by peer)]
mwhitney__ has quit [Read error: 110 (Connection timed out)]
seafood has quit []
<pierre_m> after parsing with ulex+ocamlyacc, do I have to do something special to clean everything ?
<pierre_m> right now I Parsing.clear_parser and close_in my_channel
<pierre_m> but after having parsing lots of files, my program freeze on a that it can parse when I ask it to parse only this one
mwhitney__ has joined #ocaml
<pierre_m> raaah le con
<pierre_m> (forg(et|ive) my last question)
<Alpounet> ne t'en veux pas à ce point :-)
<Alpounet> btw, what was the problem ?
_zack has joined #ocaml
Camarade_Tux has joined #ocaml
seafood has joined #ocaml
s4tan has joined #ocaml
<pierre_m> Alpounet: the problem was actually in the next file but my output had not been flushed. And it was because I commented the wrong line in my grammar :D
<gildor> flx_: yes, the mirror is under construction by httracker, availability depends on the state of httrack (mirroring software)
<gildor> flx_: but the date is not better, you just have another archive
kaustuv_ has quit [Read error: 110 (Connection timed out)]
OChameau has joined #ocaml
pierre_m has left #ocaml []
mwhitney__ has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
Yoric[DT] has joined #ocaml
hkBst has joined #ocaml
jeanbon has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
jamii has quit [Read error: 110 (Connection timed out)]
jeanbon has quit ["J'y trouve un goût d'pomme."]
verte has quit ["http://coyotos.org/"]
seafood has quit []
mwhitney__ has joined #ocaml
jamii has joined #ocaml
_andre has joined #ocaml
filp has joined #ocaml
_zack has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
sgnb has quit [Read error: 104 (Connection reset by peer)]
sgnb has joined #ocaml
grai has joined #ocaml
Yoric[DT] has quit [Remote closed the connection]
jamii_ has joined #ocaml
jonafan_ has joined #ocaml
jamii has quit [No route to host]
jonafan has quit [Read error: 110 (Connection timed out)]
Alpounet has quit [Read error: 110 (Connection timed out)]
Alpounet_ has joined #ocaml
willb has joined #ocaml
Alpounet_ has quit [Success]
Alpounet has joined #ocaml
Alpounet_ has joined #ocaml
willb has quit [Read error: 60 (Operation timed out)]
Alpounet has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
Smerdyakov has quit [Client Quit]
brendan has quit [calvino.freenode.net irc.freenode.net]
Alpounet_ has quit [Read error: 110 (Connection timed out)]
Alpounet has joined #ocaml
Alpounet_ has joined #ocaml
brendan has joined #ocaml
Alpounet has quit [Read error: 60 (Operation timed out)]
willb has joined #ocaml
mwhitney__ has quit [Read error: 104 (Connection reset by peer)]
mwhitney__ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Alpounet_ has quit [Read error: 110 (Connection timed out)]
Alpounet has joined #ocaml
kaustuv has left #ocaml []
Amorphous has joined #ocaml
kaustuv has joined #ocaml
sporkmonger has joined #ocaml
grai has quit ["leaving"]
Alpounet_ has joined #ocaml
Alpounet has quit [Read error: 110 (Connection timed out)]
hastake has joined #ocaml
hastake_ has quit [Read error: 104 (Connection reset by peer)]
jeanbon has joined #ocaml
Alpounet has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
Alpounet_ has quit [Read error: 60 (Operation timed out)]
Yoric[DT] has joined #ocaml
filp has quit ["Bye"]
itewsh has joined #ocaml
Alpounet has quit [Read error: 110 (Connection timed out)]
_zack has quit ["Leaving."]
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
thelema_ has quit [Read error: 60 (Operation timed out)]
ttamttam1 has joined #ocaml
Alpounet has joined #ocaml
jeanb-- has joined #ocaml
s4tan has quit []
Alpounet_ has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
Jeff_ober has joined #ocaml
bzzbzz has quit ["leaving"]
<Alpounet_> hi
<Jeff_ober> Hello
Snark has joined #ocaml
Alpounet has quit [Read error: 110 (Connection timed out)]
<Alpounet_> does anyone know why the following code gives ... the given output : http://ocaml.pastebin.com/d7fd96cf4 ?
<Jeff_ober> Sorry - no.
<Alpounet_> it should get connected ...
OChameau has quit ["Leaving"]
bzzbzz has joined #ocaml
<Jeff_ober> It looks like it did connect, but then got rejected. Is there some sort of required handshake you must pass back for IRC to retain your connection?
<Alpounet_> send the authentification strings
<flx_> jeff_ober, I wonder, have you taken a look at the IRC RFC?
<Alpounet_> and sometimes answer to the initial PING request
<flx_> jeff_ober, btw, did you try out the ocaml-irc module?
<Jeff_ober> fix_: No. I am completely guessing. My experience with IRC is xchat.
flx_ is now known as flux
<flux> well, I highly recommend looking at the RFC
<Jeff_ober> Alpounet_: well, flux highly recommend looking at the RFC
<Jeff_ober> :)
<Alpounet_> flux, I've taken a look at ocaml-irc, but it would need too much time and doesn't exactly fit my needs
<Alpounet_> But I still don't understand why this doesn't work...
<flux> oh I messed up who was talking about the problem :)
<Jeff_ober> :)
<Alpounet_> (too much time for learning)
<flux> well, it is indeed likely that you need to respond to the initial ping from the server
<Jeff_ober> He is PONGing back.
<Alpounet_> flux, the given code should do it... ?
<flux> ocaml-irc does cover some things that are boring to handle
<flux> alpounet_, what are you going to do?
<flux> and what wouldn't fit ocaml-irc..
<flux> its main event loop might need replacing, but it's only a few lines anyway
<Alpounet_> flux, trying to do a toplevel-like IRC bot
<flux> alpounet_, so it reacts to messages from irc?
<Alpounet_> flux, yeah.
<flux> alpounet_, that's the standard use case for caml-irc as far as I can see..
<Alpounet_> yep, but I'm not sure it is suitable for integrating communication (if I manage to do it) with toplevel
<Alpounet_> by the way, I've not seen a minimal example, which would have been very, very useful in my case.
<flux> I have something much, much less than minimal, if that's of any use: http://www.modeemi.cs.tut.fi/~flux/software/git/murmelo.git/
<flux> also it's not something I'd call "good code"
<flux> I'd call it code that was fast to hack up and do what I wanted :)
<flux> the beef for your use case is between "class murmelo_client" and "let process_same_second"
<Alpounet_> whatever it is, if it helps me to get started quickly in the hard stuffs for an "mlbot" (communication with a toplevel), it would be usefu
<flux> it's a bot for logging URLs from IRC
<flux> alpounet_, btw, were you aware about xavierbot?
<flux> IIRC it's written in perl, though :)
<Alpounet_> flux, yeah, that's the problem.
<Alpounet_> I was aware of it./
<flux> alpounet_, in any case, if you want to make it all in ocaml, you may find its pa_noexternal.ml and its init-file useful
<Alpounet_> where is it ?
<Alpounet_> google doesn't find it.
<flux> "xavierbot", first hit? http://et.redhat.com/~rjones/xavierbot/
<Alpounet_> no, pa_noexternal
<flux> it's with the source
<Alpounet_> ah, ok
<Camarade_Tux> Alpounet_, fwiw, lablgtk has an irc client as a demo
Jeff_ober has left #ocaml []
<Alpounet_> ow, interesting.
<Alpounet_> are you sure ?
<Camarade_Tux> I already connected with it :)
<Camarade_Tux> it's called camlirc
<Alpounet_> thanks
<Camarade_Tux> :)
<flux> that's not very small :)
ttamttam1 has left #ocaml []
Camarade_Tux has quit ["Leaving"]
_andre has quit ["Lost terminal"]
thelema_ has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
thelema has quit [Remote closed the connection]
mwhitney__ has joined #ocaml
slash_ has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
thelema has joined #ocaml
Yoric[DT] has joined #ocaml
<rwmjones> what exactly does TYPE_CONV_PATH do in sexplib/type-conv? It seems very undocumented, but you have to have it set to _something_ ...
<Alpounet_> well, I've a bot connected.
<hcarty> thelema: There seem to be a lack of consistency in the choice of exceptions thrown in Batteries modules
<hcarty> thelema: Should this be raised as a bug report, or some other way?
<thelema> hc: There's some debate about the exceptions raised in extString, what specifically are you thinking of
<hcarty> (example: List.hd [] would raise Empty_list, but List.reduce [] would raise Invalid_argument "List.reduce: empty list")
jlouis has joined #ocaml
jeanbon has quit ["J'y trouve un goût d'pomme."]
jeanbon has joined #ocaml
<mrvn> I wonder if that shouldn't raise List.empty?
<hcarty> The (very) newly checked in Seq module seems to use the Failure exception in a few places. I was going to suggest or submit a patch with a different choice. But when I checked List I saw that there doesn't seem to be a clear standard
<thelema> I'm not certain about the Empty_list exception myself...
<hcarty> mrvn: I would think so too, or Empty_list should go and be replaced by Invalid_argument "..."
<mrvn> Would be nice to have a exception hierachy.
<thelema> If it's not too much trouble, submit these as bugs - this kind of thing is important to me.
seafood has joined #ocaml
<thelema> as to an exception heirarchy... I think that's over-categorizing.
<thelema> *way* too much work for what it's worth.
<hcarty> thelema: Ok, will do. I just wasn't sure of the preferred way to report something like this
kick has joined #ocaml
kick has left #ocaml []
<thelema> If I was at my laptop, I'd take your bug report over IRC.
<mrvn> thelema: Should it be List.Empty, Array.Empty, Set.Empty, ... or Empty_list, Empty_array, Empty_set, ...?
<mrvn> or just Empty?
<thelema> mrvn: that's why I think Invalid_argument is probably better.
<Alpounet_> thans everybody for helping me with these network stuffs.
<thelema> this kind of thing has to be caught right near where it's raised anyway, so the name really doesn't matter that much.
<mrvn> thelema: Would be nice if List.Empty :> Invalid_argument
<mrvn> thelema: Invalid_argument is to broad though. The exception should be specific.
<thelema> mrvn: why? so you could do [with Invalid_argument _ -> ()] and catch List.empty?
<mrvn> thelema: So youcould have a functor that works with list, array, set, ... and catches Invalid_argument
<thelema> I disagree, they should be useful for debugging if they're not caught
<thelema> and they should mean something locally when caught
<thelema> i.e. reading the source, it should make sense where the exception might be raised
<mrvn> thelema: But a Set.Empty should not be caught when you expect a List.Empty.
<thelema> if you have a situation where either Set.empty or List.empty could be raised within a try..with block, you're doing something wrong.
<mrvn> empty might be a bad example here
<mrvn> thelema: I mean that is should be possible to keep exceptions from 2 modules apart even if theyir meaning overlaps.
<hcarty> mrvn: Invalid_argument includes a string, but that may be considered too fragile
<mrvn> hcarty: yeah. I would hate to have to match the string.
<thelema> maybe I don't get to that phase of programming very often (the catch-every-error-to-make-my-program-bulletproof phase), but rarely do I have try..catch without a good plan of where the exception is raised.
<mrvn> Also the string wouldn't work for functors.
<thelema> hcarty: Thanks for the bug report.
<Alpounet_> flux, how can I send a message with ocaml-irc ? :-p
<thelema> mrvn: if it was important, you could have an additional value in the functor's argument that contains the necessary string to match.
<hcarty> thelema: You're welcome. With the upcoming 1.0beta more-or-less freeze, this could turn problematic later on
jeanbon has quit ["J'y trouve un goût d'pomme."]
<mrvn> thelema: List.Empty, Array.Empty, Set.Empty,... would allow a functor to catch M.Empty instead of Invalid_argument _. M.Empty would be more readable.
jeanbon has joined #ocaml
<hcarty> mrvn: Is it possible to create an exception hierarchy in OCaml?
<hcarty> Or, rather, is it possible without extra modules or boilerplate
<mrvn> hcarty: you could throw objects.
rhar has joined #ocaml
<Yoric[DT]> But you can't cast them...
<Yoric[DT]> (well, you could with some Camlp4 boilerplate)
jonafan_ is now known as jonafan
mwhitney__ has quit [Read error: 110 (Connection timed out)]
Alpounet_ is now known as Alpounet
Snark has quit ["Ex-Chat"]
<Alpounet> good night all
Alpounet has left #ocaml []
<mfp> Yoric[DT]: I've realized there's a very strong reason to allow access to modules outside the Batteries.* hierarchy: circular dependencies
<mfp> i.e., a library that builds on Batteries.xxx cannot be integrated in Batteries because it'd create a circular dependency
<thelema> mfp: we deal with that often in developing abtteries
<mfp> thelema: it's different though
<thelema> There's many instances of code copy-and-pasted from extList to other modules
<mfp> the modules in batteries refer to each other directly, not through Batteries.*
<mfp> but 3rd party code wouldn't be able to --- if external access (not under Batteries) isn't allowed
<thelema> yes, we'd have to unplug batteries in order to integrate that.
<mfp> that means importing the source tree into batteries' git
<Yoric[DT]> mfp: interesting remark.
<mfp> instead of just merely wrapping it in Batteries' modules
<thelema> FWIW, I'm kinda for not maintaining all the heirarchies of modules that we maintain
<mfp> (as done e.g. with Camomile and friends)
<Yoric[DT]> But I don't think there's *any* solution which doesn't require splitting Batteries in at least two packages.
<thelema> one problem is that ocaml doesn't do submodules through subdirs.
<mfp> have you seen Jérémie's latest msg?
<Yoric[DT]> (and I mean packages as in Debian/GODI/etc., not as in modules)
* thelema wonders how difficult it'd be to fix ocaml build so that modules in subdirs would be viewed as sumbodules of that directory...
<thelema> except we don't really need that anymore - batteries is flat.
mwhitney__ has joined #ocaml
<mfp> except for the toplevel Batteries prefix
<mfp> hmm I don't see why 2 packages are needed
rodge has left #ocaml []
<Yoric[DT]> Because of circular dependencies *between packages*.
<Yoric[DT]> Still, I'm too tired to discuss this tonight.
<Yoric[DT]> I'm going to wish you all a pleasant night.
<mfp> night Yoric[DT]
<Yoric[DT]> And retreat to a cup of herbal tea.
<Yoric[DT]> Cheers.
<kaustuv> The right answer is to adopt the MLBasis system from MLton. </bait>
hkBst has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
<mrvn> -I /foo and Bar.Baz.t wouldn't check for /foo/bar/baz.mli?
<thelema> mrvn: if it does, I'm going to restructure batteries to use this.
<mrvn> thelema: it does in .
hkBst has quit [Read error: 104 (Connection reset by peer)]
Waleee has joined #ocaml
<thelema_> mrvn: what if foo/bar.mli exists?
Yoric[DT] has quit ["Ex-Chat"]
willb has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
kaustuv_ has joined #ocaml
slash_ has quit ["leaving"]