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
LeNsTR has quit [Quit: LeNsTR]
<ymasory> what's the difference between an exact union and a closed union?
oriba has quit [Quit: Verlassend]
strangy has quit [Quit: Leaving]
elehack_ has joined #ocaml
CoryDambach has joined #ocaml
drunK has quit [Remote host closed the connection]
myu2 has quit [Remote host closed the connection]
Amorphous has quit [Ping timeout: 272 seconds]
myu2 has joined #ocaml
Amorphous has joined #ocaml
myu2 has quit [Remote host closed the connection]
Modius has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
uefqej has quit [Ping timeout: 276 seconds]
alexyk has joined #ocaml
groovy2shoes has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
<eye-scuzzy> moin
elehack_ has quit [Ping timeout: 265 seconds]
elehack_ has joined #ocaml
elehack_ has quit [Client Quit]
myu2 has joined #ocaml
ulfdoz has joined #ocaml
alexyk has joined #ocaml
ymasory has quit [Quit: Leaving]
alexyk_ has joined #ocaml
alexyk has quit [Quit: alexyk]
alexyk_ is now known as alexyk
alexyk has quit [Client Quit]
ulfdoz has quit [Ping timeout: 255 seconds]
jamii_ has joined #ocaml
<jamii_> are there any prngs for ocaml that allow splitting seeds?
groovy2shoes has quit [Quit: groovy2shoes]
myu2_ has joined #ocaml
myu2 has quit [Read error: No route to host]
almaisan-away is now known as al-maisan
noisymouse has joined #ocaml
<noisymouse> hi all!
<noisymouse> any way I can put one match statement inside another?
<adrien> yes: wrap it inside a "being ... end" or "( ... )" block
<noisymouse> well I have the thing I'm matching my variable to
<noisymouse> and then I have ->
<noisymouse> but don't I have to put a return value after ->?
Yoric has joined #ocaml
<adrien> well, the return value will be the return of value of the inner match if you don't have anything else in the outer match clause
<adrien> there's nothing special here: it could as well be a function in place of your inner match
<noisymouse> could you show me an example somewhere?
LeNsTR has joined #ocaml
<mrvn> let foo x y = match x with 0 -> y | _ -> match y with 0 -> x | _ -> x+y
decaf has quit [Quit: Leaving]
jamii_ has quit [Quit: Leaving]
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
jonafan has quit [Read error: Connection reset by peer]
<noisymouse> mrvn: thanks for the help
<noisymouse> I almost got the homework done before the midnight deadline, but alas
<noisymouse> anyway, I think my professor will at least appreciate my approach
explodus has quit [Ping timeout: 276 seconds]
explodus has joined #ocaml
edwin has joined #ocaml
Modius has quit [Ping timeout: 255 seconds]
ttamttam has joined #ocaml
<Axioplase_> noisymouse: He will, if you're among the first homeworks he reads :)
<noisymouse> well, some people had already submitted their homeworks
Yoric has joined #ocaml
myu2_ has quit [Remote host closed the connection]
al-maisan is now known as almaisan-away
bbc has joined #ocaml
_andre has joined #ocaml
ikaros has joined #ocaml
avsm has joined #ocaml
Nepomuk has joined #ocaml
munga has joined #ocaml
<Axioplase_> noisymouse: don't underestimate the bad mood of a teacher/TA who has already read a lot of terribly bad homeworks :)
ftrvxmtrx has joined #ocaml
LeNsTR has quit [Quit: LeNsTR]
edwin1 has joined #ocaml
edwin has quit [Disconnected by services]
edwin1 is now known as edwin
almaisan-away is now known as al-maisan
Yoric has quit [Quit: Yoric]
al-maisan is now known as almaisan-away
almaisan-away is now known as al-maisan
<adrien> that might be with the latest sexplib: it looks like that when I use camlp4, I lose the location of errors
<adrien> File "/tmp/camlpp43e5a4", line 42, characters 16-32:
<adrien> instead of the right file and the right line, anyone saw that?
albacker has quit [Remote host closed the connection]
Yoric has joined #ocaml
myu2 has joined #ocaml
al-maisan is now known as almaisan-away
almaisan-away is now known as al-maisan
al-maisan is now known as almaisan-away
ptrf has joined #ocaml
Nepomuk has quit [Quit: Leaving]
ccasin has joined #ocaml
mehdid has quit [Ping timeout: 264 seconds]
munga has quit [Ping timeout: 240 seconds]
mehdid has joined #ocaml
Yoric has quit [Quit: Yoric]
mnabil has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Client Quit]
Yoric has joined #ocaml
ski has quit [Ping timeout: 264 seconds]
ski has joined #ocaml
munga has joined #ocaml
mnabil has quit [Ping timeout: 255 seconds]
mnabil has joined #ocaml
boscop has joined #ocaml
mnabil has quit [Read error: Connection reset by peer]
mnabil has joined #ocaml
eaburns has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ccasin has quit [Quit: Leaving]
ccasin has joined #ocaml
ftrvxmtrx has joined #ocaml
ttamttam has quit [Remote host closed the connection]
avsm has quit [Ping timeout: 240 seconds]
ccasin has quit [Ping timeout: 250 seconds]
Yoric has quit [Quit: Yoric]
jonafan has joined #ocaml
<thelema> odd, I'm reading a large file into memory (~800MB), and valgrind (massif) finds a string getting creates that's almost exactly 1.8 times that size
<adrien> thelema: hold on... need to dig up mantis
<adrien> hey, the "reported by me" thing helped: http://caml.inria.fr/mantis/view.php?id=4773
thelema_ has joined #ocaml
<rixed> Is there a way to write this more concisely ? "List.map (fun o -> o#some_method) object_list"
<rixed> Like "List.map #some_method object_list" ?
<thelema_> rixed: no, there's no syntax for that.
<thelema_> adrien: awesome, thanks a lot
<rixed> thelema_: thx. Do you think there is a profound reason for that (other than no more available fancy ascii chars :))
thelema has quit [Ping timeout: 276 seconds]
<adrien> thelema_: you're welcom =)
<thelema_> rixed: the designers of ocaml seem to like things being explicit
<adrien> rixed: I often which for getters and setters for records too, but I guess I prefer a clean and light syntax
<mrvn> type foo = Foo of int List.map Foo [1;2;3] would be nice too
<thelema_> adrien: if you like, you can write [let some_method x = x#some_method] ... [List.map some_method object_list]
<thelema_> maybe xavier also thinks that camlp4 can be used for that, so special compiler support isn't needed
<adrien> yeah, that's usually what I do when I need it more than once
<adrien> and tru
<adrien> e
ymasory has joined #ocaml
<adrien> (.field) or (#field) shouldn't be a big problem since that's not valid ocaml anyway
<mrvn> I also don't like that you need to specify the namespace for fields where the type is already perfectly obvious: x.Foo.y.Foo.z
<mrvn> Could camlp4 simplify that too?
mnabil has quit [Ping timeout: 272 seconds]
<thelema_> mrvn: z isn't necessarily from Foo. And sadly, I don't think camlp4 can do that for you
_andre has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
myu2 has quit [Remote host closed the connection]
<mrvn> thelema_: now, z can come from anywhere. But x.Foo.y specifies the type completly so the .z is obvious where it comes from.
<mrvn> -w
<mrvn> Having to type in the namespace for z can only introduce a type error in case you mistype.
<adrien> but actually, Foo.(x.y.z) should work now, no,
<adrien> ?
<adrien> never really used that syntax
<mrvn> adrien: huh? Is that reviced syntax or even newer?
<mrvn> Doesn't help with x.Foo.y.Bar.z
<adrien> should be 3.12 or pa_can'trememberwhat
<mrvn> Would x.Foo.y.Foo.Bar.z be Foo.(x.y.Bar.z)?
ymasory has quit [Read error: Operation timed out]
Edward__ has joined #ocaml
munga has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Quit: Leaving]
<thelema_> mrvn: yes, the problem is that cmalp4 doesn't have access to types
<thelema_> wow, the test-comments here are very nice - we'll have to get this into batteries: https://github.com/kig/preludeml/blob/master/src/prelude.ml
<kaustuv> Writeup of my experiments the last couple of days on unboxed arrays: http://www.lix.polytechnique.fr/~kaustuv/misc/incr_uarray/ (comments welcome)
Yoric has joined #ocaml
<thelema_> kaustuv: actually, I've done work on routers, and the cost for them to keep statistics is quite significant. Moral: don't underestimate the cost of *many* counters.
<thelema_> kaustuv: nicely written. I'm a bit sad at the end that ocaml lost.
<thelema_> You'll lose some of your narrative power, but it might help people skim / get an idea of the flow of things to present your summary first
eaburns has left #ocaml []
<adrien> kaustuv: can't really comment but I've had similar troubles not having gcc completely remove pure functions
<adrien> or rather, functions which computations are not used
<thelema_> kaustuv: lastly, some notes on why bigarray isn't as fast as C might be useful
<adrien> I've never been really sure that it wasn't sometimes doing that at least in parts
<adrien> kaustuv: maybe -fnoipa-pure-const could work: -fipa-pure-const "Discover which functions are pure or constant. Enabled by default at -O and higher."
<thelema_> oops, sorry for horrible url paste, sed.bordeaux.inria.fr/seminars/profiling_20100511.pdf
<adrien> thelema_: might be beamer
<kaustuv> thelema_: I would love to find out why bigarrays are not as fast as C. I think mfp had a good suggestion yesterday about code hoisting, but I didn't fully understand it
<mfp> kaustuv: take Array1.(unsafe_)get: it's got extra indirections compared to Array.(unsafe_)get because the address is computed as (roughly) & ba[1]->data[size * index] (bigarrays are custom blocks)
<thelema_> kaustuv: also, it'd probably help (someone) to point out that the type annotation on incr_array is very important for performance
<kaustuv> thelema_: yes, I plan to add a comment about that presently.
<thelema_> otherwise, very nice.
<kaustuv> mfp: Yes, I understand that, but I don't think one level of indirection can amount for the drastic difference between Array and Bigarray.Array1 in this example.
cthuluh has quit [Quit: "Our life is frittered away by detail... Simplify, simplify" -- Thoreau]
thelema_ is now known as thelema
cthuluh has joined #ocaml
<mfp> now if you have something like for i = j to k do arr.{j} <- x done you'd want the code to be like (in C) sometype *ptr = ((struct caml_ba_array *)Field(ba, 1))->data[j]; for(n = 0; n < k - j + 1; n++; ptr++) { *ptr = x; }
<thelema> and the ocaml compiler won't do that kind of factorizing for you like GCC
<mfp> (modulo typos such as the missing &, and s/;/,/ ugh)
<mfp> thelema: the pb (relative to Array) is that you cannot do it manually either
edwin has left #ocaml []
<kaustuv> mfp: thanks, I think I get your point now.
<kaustuv> strictly speaking, the reason gcc -O3 is so fast is that it is doing an addq to an address in memory, which I think neither OCaml's nor GHC's codegen covers
ygrek has joined #ocaml
_andre has quit [Quit: leaving]
<mfp> thelema: btw. the slides you linked to were definitely created with beamer (that is, libextract says producer - pdfTeX-1.40.10 creator - LaTeX with beamer class version 3.07)
<adrien> libextract sounds nice, is it http://www.gnu.org/software/libextractor/ ?
<mfp> yes that one
<mfp> just ran extract on the pdf
alexyk has joined #ocaml
<adrien> thanks =)
<kaustuv> Does anyone know what the status is on that LLVM backend for OCaml proposed a few years back? ISTR Jon Harrop was involved in some kind of mentorship role. Was the project canned?
alexyk has quit [Read error: Connection reset by peer]
munga has joined #ocaml
ulfdoz has joined #ocaml
ftrvxmtrx has joined #ocaml
munga has quit [Ping timeout: 240 seconds]
dskippy has joined #ocaml
ymasory has joined #ocaml
<thelema> mfp: thanks much - now I just have to get their beamer template
<thelema> kaustuv: yes, jon is working on hlvm instead, an ocaml-like language with a very different backend. He's having pretty good success, from what he writes about it, although it's still quite a toy language still
* adrien is really wondering if his recent changes (gc) are really that good
drunK has joined #ocaml
mattam has joined #ocaml
mattam has quit [Client Quit]
mattam has joined #ocaml
<alpounet> kaustuv, it was rejected (as a Jane Street Summer Project)
<alpounet> it was about having an HLVM backend for the OCaml compiler
<adrien> couldn't the reprensentation be made somehow compatible?
<alpounet> nope
<alpounet> since the IR becomes the LLVM IR at some point when using HLVM
<adrien> right, no choice here
smerz has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ezyang has quit [Ping timeout: 240 seconds]
Tianon has quit [Ping timeout: 272 seconds]
yezariaely has joined #ocaml
avsm has joined #ocaml
mnabil has joined #ocaml
ymasory has quit [Ping timeout: 250 seconds]
yezariaely has quit [Quit: Leaving.]
groovy2shoes has joined #ocaml
ymasory has joined #ocaml
hcarty has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
bbc has quit [Quit: leaving]
decaf has joined #ocaml
almaisan-away is now known as al-maisan
lamawithonel has joined #ocaml
ygrek has quit [Remote host closed the connection]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
Yoric has quit [Quit: Yoric]
ymasory has quit [Ping timeout: 250 seconds]
alexyk has quit [Quit: alexyk]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
hexmode has joined #ocaml
<hexmode> Would someone here be willing to look at an Ocaml diff and tell me if it is sane?
<hexmode> should be just whitespace differences, but I've never used ocaml
<adrien> let tex_mod_reset () = (modules_ams := false; modules_nonascii := false; modules_encoding := UTF8; modules_color := false)
<adrien> parens are useless, we tend to use 2-spaces for the indentation, and I couldn't find issues, but this kind of diff is probably where it's the easiest to miss changes
elehack is now known as elehack|out
thieusoai_ has joined #ocaml
thieusoai_ has quit [Remote host closed the connection]
tnguyen has joined #ocaml
<tnguyen> j #python
tnguyen is now known as thieusoai_
al-maisan is now known as almaisan-away
Edward__ has quit []
thieusoai_ has quit [Read error: Connection reset by peer]
thieusoai_ has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
thieusoai_ has quit [Quit: thieusoai_]
ftrvxmtrx has joined #ocaml
<hexmode> adrien: thanks
* hexmode had stepped out to eat
ikaros has quit [Quit: Leave the magic to Houdini]
mnabil has quit [Ping timeout: 240 seconds]
dskippy has quit [Quit: Leaving.]