gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
<mrvn> dead code is also far less of a problem as one might think. If it isn't used it just takes up disk space and is never loaded into memory.
<gildor> mrvn: it is parsed by ocaml
<mrvn> gildor: use ocamlopt
<gildor> mrvn: it is not an issue for user/dev but it takes time when testing
<gildor> mrvn: I don't compile the setup.ml code
<gildor> (not on disk at least)
<mrvn> oh, I thought you ment in batteries proper, not just the setup.ml
<thelema_> mrvn: not loaed into memory modulo page size
<mrvn> thelema_: we need more dead code so it fills pages. :)
<mrvn> if one uses only one or two things from batteries there should be plenty of pages not getting loaded though.
<thelema_> we just need to sort the dead code into the same pages
<mrvn> There is code out there that profiles a binary for what functions are being used and in what order and reorders them into the same pages.
<mrvn> on those old rotary disks that can speed up startup time by magnitudes.
<gildor> good night all
* mrvn heads to bed too.
kaustuv_` has quit [Remote host closed the connection]
olegfink has quit [Ping timeout: 240 seconds]
oriba has quit [Quit: Verlassend]
thelema has joined #ocaml
thelema_ has quit [Read error: Connection reset by peer]
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
ymasory has joined #ocaml
metasyntax has joined #ocaml
arubin has joined #ocaml
joewilliams is now known as joewilliams_away
dnolen has joined #ocaml
lopex has quit []
tauntaun has quit [Quit: Ex-Chat]
jonafan_ has joined #ocaml
jonafan has quit [Ping timeout: 272 seconds]
tauntaun has joined #ocaml
myu2_ has quit [Remote host closed the connection]
arubin has quit [Quit: arubin]
tauntaun has quit [Ping timeout: 252 seconds]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
myu2 has joined #ocaml
clog has joined #ocaml
vivanov has quit [Ping timeout: 250 seconds]
vivanov_ has quit [Ping timeout: 250 seconds]
Yoric has joined #ocaml
CoryDambach has quit [Ping timeout: 276 seconds]
CoryDambach has joined #ocaml
Cyanure has joined #ocaml
vivanov has joined #ocaml
vivanov_ has joined #ocaml
orbitz has quit [Ping timeout: 276 seconds]
orbitz has joined #ocaml
yezariaely has joined #ocaml
ygrek has joined #ocaml
edwin has joined #ocaml
yezariaely has left #ocaml []
Yoric has quit [Quit: Yoric]
ikaros has joined #ocaml
myu2 has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
myu2 has joined #ocaml
vivanov_ has left #ocaml []
<flux> cool, batteries has interval maps, just what I needed
<flux> I hope, atleast :)
jdavis has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
mcclurmc has left #ocaml []
lopex has joined #ocaml
ftrvxmtrx has joined #ocaml
myu2 has quit [Remote host closed the connection]
edwin has quit [Ping timeout: 252 seconds]
Obfuscate has quit [Read error: Operation timed out]
Obfuscate has joined #ocaml
myu2 has joined #ocaml
vivanov has quit [Quit: leaving]
vivanov has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
Oejet has joined #ocaml
Oejet has quit [Ping timeout: 240 seconds]
jonathandav has joined #ocaml
olegfink has joined #ocaml
edwin has joined #ocaml
tauntaun has joined #ocaml
ttamttam has joined #ocaml
_andre has joined #ocaml
olegfink has quit [Ping timeout: 240 seconds]
tauntaun has quit [Ping timeout: 252 seconds]
ygrek has quit [Remote host closed the connection]
olegfink has joined #ocaml
Cyanure has quit [Ping timeout: 276 seconds]
<gildor> vivanov: I got a pending request for your user account on forge.ocamlcore.org
<gildor> vivanov: have you any problems with registration ?
ttamttam has quit [Remote host closed the connection]
Cyanure has joined #ocaml
tauntaun has joined #ocaml
<vivanov> ill check it now
<vivanov> gildor: thanks very much - now its ok :)
myu2 has quit [Remote host closed the connection]
tauntaun has quit [Quit: Ex-Chat]
mal`` has quit [Quit: Coyote finally caught me]
vivanov has quit [Ping timeout: 250 seconds]
mal`` has joined #ocaml
vivanov has joined #ocaml
boscop has joined #ocaml
Oejet has joined #ocaml
mal`` has quit [Quit: Coyote finally caught me]
myu2 has joined #ocaml
dnolen has joined #ocaml
mal`` has joined #ocaml
kerneis has quit [Quit: Changing server]
kerneis has joined #ocaml
kerneis has quit [Client Quit]
kerneis has joined #ocaml
kerneis has quit [Client Quit]
kerneis has joined #ocaml
myu2 has quit [Remote host closed the connection]
kaustuv has quit [Remote host closed the connection]
<f[x]> test_runner.byte from batteries eats 1G RAM, poor hudson server could hardly survive that
<thelema> f[x]: ooh... sorry about that. I wonder what's taking so much ram...
<f[x]> I should have used ulimits but first lets try irc :)
<thelema> hmm, random string generation is probably not cheap... maybe it's the numeric compare tests...
<thelema> Well, it seems to be eating more than just 1GB
<thelema> maybe the changes to the quicktest random number generators mean that it's generating potentially rediculously large strings...
oriba has joined #ocaml
<thelema> but that should just raise an exception, as the string size on both 32-bit and 64-bit is limited to less than 2^word_size
<mrvn> 15MB on 32bit.
<mrvn> plenty of space on 64bit.
<thelema> yes, but if I accidentally created a string of random(2^word_size) size, it'd most likely fail
vivanov has quit [Ping timeout: 272 seconds]
<mrvn> thelema: unless you just happen to hit around 2^30
vivanov has joined #ocaml
<thelema> which would be the case under the old random number generation policy which used Random.bits(), but I redid the quickcheck generator and it generates random ints uniformly from the full int space
<flux> Random.int only generates random numbers up to 2^30?
<flux> so those strings could still relatively likely fit into 64-bit memory space
<flux> not many, though :)
<flux> even 2 of those would, on average, be 2^30 bytes
<thelema> yes, random.int stays in 32-bit land, and on a 64-bit platform, this would allow large strings to be generated
* thelema reviews recent commits
sepp2k has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
edwin has quit [Ping timeout: 276 seconds]
<thelema> very odd - the ug seems to be in a commit that just names some tests
Yoric has joined #ocaml
lopexx has joined #ocaml
ikaros has joined #ocaml
<flux> for future, perhaps setting an approrpriately low ulimit would be a good idea?
Kakadu has joined #ocaml
tauntaun has joined #ocaml
olegfink has quit [Ping timeout: 240 seconds]
Kakadu has quit [Client Quit]
* thelema bets there's a bug in String.nsplit
<thelema> yup, it fails hard when the separator to be found is empty
<flux> I guess it should then work like String.explode, but instead of returning chars, it would return strings
<thelema> yes, that was what the test I wrote expected.
<flux> if only strings were lists of chars, I bet the bug would have never arisen :)
<thelema> feh
<mrvn> flux: list of chars use 8/16 times the memory and don't have O(1) access
<mrvn> and aren't mutable, but that could be changed.
olegfink has joined #ocaml
edwin has joined #ocaml
<flux> mrvn, I didn't say there wouldn't be downsides ;)
<flux> but, how about if they could be accessed with a pattern matching syntax?
<flux> it would more more natural to handle corner cases
<mrvn> match s with 'f'::'o'::'o'::_ -> ...?
tauntaun has quit [Quit: Ex-Chat]
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
<flux> "foo" would obviously be the same as 'f'::'o'::'o'. but you'd need some anchors for trailing beginning and the end
<flux> also there would need to be a substring object around
<mrvn> Isn't that what streams are for or regexps?
<flux> streams eat data
<flux> regexps are difficult to check for exhaustiveneses
<flux> but I guess not impossible. that would be quite interesting as well.
<mrvn> how about an enumeration over the string?
<flux> ?
<flux> you mean ExtLib/Batteries Enum?
<mrvn> support for pattern matching enums would be nice.
<flux> well, enums are destructive as well
<flux> lazy lists on the other hand could be used ther
<mrvn> make non destructive ones
<flux> and you can already pattern match over lazy values
<flux> not sure if you can match over lazy lists, thoguh
<flux> (as provided by Batteries)
<mrvn> How do you make a lazy list?
<flux> but it's quite syntax heavy
ymasory has quit [Quit: Leaving]
<thelema> iirc, we have a syntax extension for pattern matching against lazy lists
<flux> type 'a lazy_list' = Head of ('a Lazy.t * 'a lazy_list) | Tail and 'a lazy_list = 'a lazy_list' Lazy.t or something
<thelema> ekstrand created one...
<mrvn> there you go then
* thelema looks for it
<thelema> maybe it's not in batteries... hmmm
mal`` has quit [Quit: Coyote finally caught me]
<thelema> ah, it never got merged with master...
<thelema> I guess it's time
mal`` has joined #ocaml
<thelema> okay, oasis, lazy-list-pattern-matching and a fixed nsplit pushed to github
<thelema> hopefully the hudson server can recover on this next build
lopexx has quit []
ymasory has joined #ocaml
lopexx has joined #ocaml
lopex has quit [*.net *.split]
ymasory has quit [*.net *.split]
jonathandav has quit [*.net *.split]
pantsd_ has quit [*.net *.split]
vouillon1 has quit [*.net *.split]
confound has quit [*.net *.split]
alpounet has quit [*.net *.split]
eye-scuzzy has quit [*.net *.split]
cthuluh has quit [*.net *.split]
f[x] has quit [*.net *.split]
mrvn has quit [*.net *.split]
pheredhel` has quit [*.net *.split]
Tianon has quit [*.net *.split]
schmrkc has quit [*.net *.split]
nimred has quit [*.net *.split]
mehdid has quit [*.net *.split]
olegfink has quit [Ping timeout: 240 seconds]
mal``` has joined #ocaml
mal`` has quit [Ping timeout: 264 seconds]
lopexx has quit []
svenl has quit [Ping timeout: 268 seconds]
svenl has joined #ocaml
boscop_ has joined #ocaml
dgfitch_ has joined #ocaml
hyperbor1ean has joined #ocaml
Pepe__ has joined #ocaml
lopex has joined #ocaml
Pepe_ has quit [Disconnected by services]
Pepe__ is now known as Pepe_
_andre_ has joined #ocaml
ikaros has quit [*.net *.split]
boscop has quit [*.net *.split]
_andre has quit [*.net *.split]
larhat has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
dgfitch has quit [*.net *.split]
tauntaun has joined #ocaml
schmx has joined #ocaml
schmx has quit [Changing host]
schmx has joined #ocaml
pantsd has joined #ocaml
cthuluh has joined #ocaml
mrvn_ has joined #ocaml
alpounet has joined #ocaml
confound has joined #ocaml
nimred__ has joined #ocaml
jonathandav has joined #ocaml
fx_ has joined #ocaml
ymasory has joined #ocaml
pheredhel has joined #ocaml
larhat has joined #ocaml
vouillon has joined #ocaml
Oejet has quit [Ping timeout: 240 seconds]
CoryDambach has quit [Read error: Connection reset by peer]
AdmWiggin has joined #ocaml
CoryDambach has joined #ocaml
dnolen has quit [Quit: dnolen]
ikaros has joined #ocaml
vivanov has quit [Remote host closed the connection]
vivanov has joined #ocaml
ikaros has quit [Client Quit]
mehdid has joined #ocaml
eye-scuzzy has joined #ocaml
joewilliams_away is now known as joewilliams
vivanov has quit [Read error: Connection reset by peer]
ymasory has quit [Quit: Leaving]
ikaros has joined #ocaml
ymasory has joined #ocaml
alp_ has joined #ocaml
nimred has joined #ocaml
rixed_ has joined #ocaml
clog has joined #ocaml
* gildor gtg
virtuoussin13 has joined #ocaml
ski has quit [*.net *.split]
ccasin has quit [*.net *.split]
Obfuscate` has quit [*.net *.split]
CoryDambach has quit [*.net *.split]
mehdid has quit [*.net *.split]
joewilliams has quit [*.net *.split]
eelte has quit [*.net *.split]
caligula_ has quit [*.net *.split]
bzzbzz has quit [*.net *.split]
ski has joined #ocaml
ccasin has joined #ocaml
Obfuscate` has joined #ocaml
CoryDambach has joined #ocaml
mehdid has joined #ocaml
joewilliams has joined #ocaml
eelte has joined #ocaml
caligula_ has joined #ocaml
bzzbzz has joined #ocaml
tauntaun has joined #ocaml
mfp has quit [Read error: Operation timed out]
<virtuoussin13> I keep hearing about how p4 was recently (relatively speaking) updated to have backwards incompatible changes. Does the manual linked on the website reflect these changes? or when they say "version 3.07" on that manual they mean it's a manual for version 3.07 of p4 and not the manual's version number?
<thelema_> almost certainly manual 3.07 is for version 3.07 of camlp4
<virtuoussin13> ah, so the wiki is my only hope?
<thelema_> yes
<thelema_> or examples
<virtuoussin13> okay thank you. Were the changes so startling as to make the manual on the website totally useless?
<thelema_> I'm not a camlp4 expert, so I'm only repeating what I remember hearing... Many things stayed the same but some important syntax for how to plug into the parser changed.
<thelema_> so not totally useless, but definitely won't work as is, and may need fundamental changes in some cases
<virtuoussin13> okay
<virtuoussin13> thank you, syntax extensions look fun but the wiki is a little...
<virtuoussin13> I guess I'll just use the examples and other people's work and the wiki when stuff is unclear
mfp has joined #ocaml
<hcarty> virtuoussin13: That seems to be the most common route
olegfink has quit [Ping timeout: 240 seconds]
virtuoussin13 has left #ocaml []
thelema has joined #ocaml
mo3b1us has joined #ocaml
waern_ has quit [Ping timeout: 250 seconds]
thelema_ has quit [Ping timeout: 250 seconds]
hyperbor1ean has quit [Ping timeout: 250 seconds]
Yoric has joined #ocaml
ymasory has quit [Ping timeout: 250 seconds]
alpounet has quit [Ping timeout: 250 seconds]
kerneis has quit [Ping timeout: 250 seconds]
alpounet has joined #ocaml
hyperboreean has joined #ocaml
kerneis has joined #ocaml
waern has joined #ocaml
jonafan_ has joined #ocaml
npouillard has quit [Ping timeout: 246 seconds]
npouillard has joined #ocaml
waern has quit [Ping timeout: 246 seconds]
jonafan has quit [Ping timeout: 246 seconds]
waern has joined #ocaml
tauntaun has quit [Ping timeout: 255 seconds]
52AAAKZJX has quit [Read error: Connection reset by peer]
ymasory has joined #ocaml
hto_ has joined #ocaml
pantsd_ has joined #ocaml
tauntaun has joined #ocaml
xl0_ has joined #ocaml
philtor has quit [Ping timeout: 252 seconds]
philtor has joined #ocaml
lopexx has joined #ocaml
alexyk has joined #ocaml
lopex has quit [Ping timeout: 240 seconds]
haelix has quit [*.net *.split]
pantsd has quit [*.net *.split]
_andre_ has quit [*.net *.split]
Amorphous has quit [*.net *.split]
hto has quit [*.net *.split]
xl0 has quit [*.net *.split]
mo3b1us has quit [Ping timeout: 255 seconds]
alexyk has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
Associat0r has joined #ocaml
alexyk has joined #ocaml
haelix has joined #ocaml
Amorphous has joined #ocaml
pozic has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
tauntaun has quit [Ping timeout: 255 seconds]
mo3b1us has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
ymasory has quit [Ping timeout: 252 seconds]
er98052 has joined #ocaml
<er98052> Is there a good way of modularizing a huge pattern match, viz """match message_type with | (... dozens of possibilities)""", possibly even in a way that each match figures in a separate module? I suppose I could just invoke the module on successful match, but I am hoping there's something nicer.
jm has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
<flux> er98052, polymorphic variants provide means for that
<flux> er98052, you can write for example: type a = [ `a | `b ] type b = [ `c | `d ] type d = [ a | b ] let handle_a = function `a -> "a" | `b -> "b" let handle_b = function `c -> "c" | `d -> "d" let handle_d = function #a as x -> handle_a x | #b as x -> handle_b x
ymasory has joined #ocaml
<mrvn_> flux: that works? neat
alexyk has joined #ocaml
<mrvn_> didn't know you could use # in a pattern matching
mrvn_ is now known as mrvn
<er98052> what does the # operator do?
<mo3b1us> Another solution is to group the matches, for instance: let handle x = match x with | a | b | c -> handle_abc x | d | e | f -> handle_def x
Oejet has quit [Quit: Leaving.]
<flux> er98052, #a is a shortcut for [ `a | `b ] -> ..
<flux> mo3b1us, but the problem with that is that the compiler exhaustiveness checks don't work anymore
<flux> if possible, you might already build the types in hierarchical manner to enable hierarchic handling
<mrvn> they sort of do. the type of the function lists all handled types and you get the error on the calling side.
<flux> or you might use another structure altogether, such as records with functions
<mrvn> or classes
<mo3b1us> flux, yes you should add generic match in handle_abc and handle_def that raises an unexpected exception. I recognize this is a little clumsy.
<mrvn> mo3b1us: if you add _ -> ... then it will accept any polymorphic variant
<mrvn> then you really have disabled the exhaustiveness checks
<mo3b1us> yes, you are right.
<er98052> building an hierarchy is not really on or desirable in my case. but using a function is something I should have thought of (duh)
<mrvn> # let handle_d = function #a as x -> handle_a x | `c as x -> handle_b x;;
<mrvn> val handle_d : [< `a | `b | `c ] -> string = <fun>
<mrvn> # handle_d `d;;
<mrvn> Error: This expression has type [> `d ]
alexyk has quit [Read error: Connection reset by peer]
<mrvn> or: # let handle_d : d -> char = function #a as x -> handle_a x | `c as x -> handle_# let handle_d : d -> char = function #a as x -> handle_a x | `c as x -> handle_b x;;
<mrvn> Error: This pattern matches values of type [< `a | `b | `c ]
<mrvn> I thing the exhaustiveness checks work just fine. you just get a different error.
heddar-fr has joined #ocaml
<mrvn> Sometimes I wonder if one couldn't get the type inference to say the handle_d function has type #d -> string or [< d ] -> string instead of [< `a | `b | `c | `d ] -> string.
<mrvn> i.e. get it to use the type aliases previously defined instead of the actual types behind it.
heddar-fr has left #ocaml []
tauntaun has joined #ocaml
alexyk has joined #ocaml
<hcarty> mrvn: I've wondered the same. Maybe a compiler switch to turn it on/off.
alexyk has quit [Client Quit]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
avsm has joined #ocaml
lopexx has quit []
olegfink has joined #ocaml
lopex has joined #ocaml
Cyanure has quit [Remote host closed the connection]
mo3b1us has left #ocaml []
edwin1 has quit [Remote host closed the connection]
olegfink has quit [Ping timeout: 240 seconds]
Vinnipeg has joined #ocaml
Vinnipeg has quit [Remote host closed the connection]
olegfink has joined #ocaml
jm has quit [Disconnected by services]
jm_ has joined #ocaml
enthymeme has joined #ocaml
srcerer has quit [Quit: ChatZilla 0.9.86 [Firefox 3.6.13/20101203075014]]
srcerer has joined #ocaml
willb1 has quit [Ping timeout: 276 seconds]
agarwal1975 has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
Oejet has joined #ocaml
ymasory has quit [Quit: Leaving]
fraggle_ has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
willb has joined #ocaml
Amorphous has quit [Ping timeout: 246 seconds]
lopexx has joined #ocaml
lopex has quit [Ping timeout: 240 seconds]
lopexx has quit []
lopex has joined #ocaml
Amorphous has joined #ocaml
jm_ has quit [Remote host closed the connection]
tauntaun has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
agarwal1975 has quit [Quit: agarwal1975]
er98052 has quit [Quit: er98052]
Yoric has quit [Quit: Yoric]
olegfink has quit [Read error: Operation timed out]
dnolen has joined #ocaml
Obfuscate` has quit [Quit: A poorly written script will replace me shortly.]
Obfuscate has joined #ocaml
surikator has joined #ocaml
jonathandav has quit [Ping timeout: 250 seconds]
alexyk has joined #ocaml
lopex has quit []
<surikator> Hi guys, do you know of any library for creating P2P networks in OCaml? I haven't found much... Thanks! (I'm not asking for P2P clients like MLDonkey. I'm asking for general libraries which I can use to create P2P networks, manage peers, etc.)
<hcarty> surikator: ocamlnet is probably your best bet. I don't know if it has modules specifically for P2P networking, but it likely has the components required to build one.
Associat0r has quit [Quit: Associat0r]