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
Anarchos has quit [Quit: sleeping time here]
ulfdoz has quit [Read error: Operation timed out]
ulfdoz has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
Cyanure has quit [Remote host closed the connection]
emmanuel__ has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
Progster has joined #ocaml
tbrady has quit [Quit: tbrady]
emmanuel__ has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
tbrady has joined #ocaml
<dsheets> ocamlfind is not in standard ocaml source distribution??
<dsheets> for some reason, i thought 3.12 had both ocamlbuild and ocamlfind standard
<NaCl> it is not
rudi_ has joined #ocaml
<rudi_> how to use batteries with oasis?
Progster has quit [Ping timeout: 244 seconds]
sepp2k has quit [Remote host closed the connection]
justdit_ has joined #ocaml
<_habnabit> rudi_, I don't understand the trouble you're having
justdit_ has quit [Ping timeout: 248 seconds]
justdit has joined #ocaml
<rudi_> _habnabit: I'm under the impression that BuildDepends: batteries should do this
<rudi_> but that doesn't work
<_habnabit> do "this"? "doesn't work"?
<rudi_> isn't "BuildDepends: batteries" under the exectuable section should add batteries as a dependancy to my project?
gnuvince has quit [Ping timeout: 246 seconds]
gnuvince has joined #ocaml
justdit has quit [Ping timeout: 250 seconds]
justdit has joined #ocaml
tbrady has quit [Quit: tbrady]
tbrady has joined #ocaml
tbrady has quit [Quit: tbrady]
justdit has quit [Ping timeout: 252 seconds]
Progster has joined #ocaml
<rudi_> if anybody uses batteries and oasis in their project I would love to take a look at your _oasis file...
<adrien> rudi_: I think there are links to them on oasis' website
<rudi_> adrien: ya I've looked at http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=oasis;a=headblob;f=/examples/findlib/_oasis for example. but no luck.
<rudi_> there is no example that is specifically for batteries though
<adrien> I meant: http://oasis.forge.ocamlcore.org/alreadyusing.html but I don't know if there are battery users there
<adrien> but there should be nothing specific to batteries
<adrien> do you get an error message?
Progster has quit [Ping timeout: 248 seconds]
<rudi_> just the standard stuff: "Error: Unbound module Batteries"
<adrien> you should pastebin your _oasis file
<rudi_> one sec, looking for that pastebin site with no ads
<adrien> and you reran "oasis"?
<rudi_> ...
<rudi_> no i did not I though ocaml setup.ml -configure was enough
<rudi_> thanks it works now
<adrien> heheh :P
<adrien> setup-dev Translate _oasis into a build system that auto-update
<adrien> I think that using oasis with that command would do what you want
<adrien> haven't used it however
<rudi_> i did "oasis setup" seemed to work fine
<rudi_> now just need to add camlp4 :D
Kakadu has joined #ocaml
edwin has joined #ocaml
fantasticsid has joined #ocaml
pango is now known as pangoafk
pangoafk is now known as pango
Cyanure has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ski has quit [Ping timeout: 255 seconds]
xcombelle has joined #ocaml
hto has quit [Quit: leaving]
hto has joined #ocaml
<adrien> and I add tags to yypkg build infrastructure in ohloh and I get that cabal is a similar project...
edwin has left #ocaml []
hto_ has joined #ocaml
hto_ has quit [Quit: leaving]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
justdit has joined #ocaml
grego has joined #ocaml
grego has quit [Quit: leaving]
justdit has quit [Ping timeout: 246 seconds]
ankit9 has joined #ocaml
Anarchos has joined #ocaml
emmanuelux has joined #ocaml
justdit has joined #ocaml
justdit has quit [Ping timeout: 240 seconds]
eni has joined #ocaml
ankit9 has quit [Ping timeout: 250 seconds]
eni has quit [Ping timeout: 240 seconds]
cdidd has quit [Quit: Leaving]
ankit9 has joined #ocaml
cdidd has joined #ocaml
justdit has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
eni has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
eni has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
Submarine has quit [Ping timeout: 248 seconds]
emmanuelux has quit [Ping timeout: 246 seconds]
<fasta> There are two sieves here: https://groups.google.com/d/msg/comp.ai.genetic/P4WP10TLSDI/U_bxEq44Yw4J . One in C and one in OCaml. The one in OCaml was faster 10 years ago (supposedly), but now the C version is over 15 times faster on my machine. How is that possible?
<adrien> compiler optimizations
<adrien> cpu caches
<fasta> You mean that the OCaml compiler basically just has falled behind?
<fasta> fallen*
<fasta> It's not like gcc takes a lot of time to compile it either.
<adrien> yes, and GCC does take a lot of time to optimize; that's something you see with bigger files
<fasta> Actually...
<fasta> It seems they are completely different programs.
<Qrntz> fasta, how did you track the running time?
<fasta> Qrntz: I just used time.
<fasta> I see a huge difference.
<fasta> Ocaml needs to allocate lots of stuff at run-time.
<Qrntz> I did the same and I see a ~20ms difference
<fasta> In C that's part of the text segment.
<fasta> Or well, I don't know that.
<Qrntz> nothing close to «15 times faster» on my machine
<fasta> Qrntz: AMD CPU?
<Qrntz> no, intel c2d e6600
<fasta> Qrntz: Intel Sandy Bridge here.
<fasta> Qrntz: compiler version?
<fasta> Qrntz: 4.6.3 here
<Qrntz> 4.6.3 as well
<fasta> Qrntz: I used ocamlc -unsafe.
<Qrntz> oh haha
<fasta> Qrntz: ocaml.opt *
<Qrntz> you do not measure bytecode against native code
<adrien> hah :-)
<fasta> Qrntz: er ocamlc.opt
<Qrntz> here lies your problem
<Qrntz> try ocamlopt
<Qrntz> not ocamlc.opt
<fasta> What is ocamlc.opt then?
<Qrntz> keep the -unsafe
<Qrntz> it is the native code executable of the bytecode compiler
<Qrntz> the regular ocamlc is a bytecode executable
<Qrntz> for portability sake
<adrien> -unsafe helps for arrays
<fasta> Why isn't it called ocaml_bytecode_compiler then?
<fasta> That would be a lot easier :)
<adrien> it's good to check without and with, but mostly a bad habit
<Qrntz> so, there's a bytecode executable for compiling bytecode, a native executable for compiling bytecode, a bytecode executable for compiling native code and a native code executable for compiling native code
<Qrntz> you used the second
<Qrntz> you should've used the third or the fourth
<Qrntz> it only matters if you value compilation time, they generate the same code
<fasta> Qrntz: Still a factor of 2 difference.
<fasta> Qrntz: but indeed, much better.
<Qrntz> :-)
<fasta> I think if the C program would the input size as input it would likely take about the same time.
<fasta> When does 'time' start running?
<fasta> After program load time, or before?
<Qrntz> before, afaik
<K_F> before, indeed
<Qrntz> it can be influenced by disk caches
<Qrntz> and such
<fasta> If everything would be inlined, would that help?
ankit9 has quit [Ping timeout: 246 seconds]
<fasta> I.e. I think a language like OCaml should be able to compile to that C code.
<fasta> I don't consider that to be an unreasonable thing to expect.
<adrien> output C code that can then be compiled by a C compiler?
<K_F> well, all languages have their strengths and weaknesses..
<Qrntz> you can try adjusting the inlining aggresiveness using the «-inline N» flag, but it probably won't help much
<fasta> adrien: for example, if their register allocation is better.
<Qrntz> I heard that 4.00 does inlining noticeably better, but I do not know the exact details
<fasta> Is it possible to type printf "hello %s %s" 5 "world" in OCaml?
<fasta> (Not a typo)
<fasta> In the D programming language that actually works.
<Qrntz> if in doubt, recall Xavier's axiom: «OCaml delivers at least 50% of the performance of a decent C compiler»
<Qrntz> no, that won't work
<Qrntz> it verifies types
<fasta> Qrntz: but in D it just derives that you want to call print_int, or whatever it is called.
<fasta> Qrntz: so, still type safe.
<Qrntz> but that's D.
<fasta> Qrntz: sure, and I think it's quite practical that it does that.
<Qrntz> I don't really understand why wouldn't one just «printf "hello %d %s" 5 "world"»
<fasta> D and OCaml seem to be about the same.
<adrien> fasta: that wouldn't bring better performance
<fasta> adrien: when compared to what?
<adrien> GCC compiles C code, written by users
<adrien> s/users/people/
<adrien> machine-generated code is different
<fasta> adrien: yes, and I think that for such 'imperative' code, it should be able to create human looking code.
<adrien> moreover, it doesn't properly handle tail-recursion
<adrien> that would kill the language unless some dirty workarounds are added
<adrien> and they would in turn make everything slower
<adrien> fasta: no, it shouldn't
<fasta> adrien: you might be right regarding the whole 'it would make the compiler slow'-argument.
<fasta> adrien: or even 'you are probably right'.
<adrien> not compiler: compiled output
<fasta> adrien: isn't it easy to see the correspondence between the two programs?
<adrien> compiling would probably be slower too but the bigger issue is that thre are some constructs which OCaml programers use all the time and which wouldn't be properly handled by something like GCC
<Qrntz> fasta, if you want an ML-like language that readily translates to C, try ATS
<Qrntz> OCaml is not one
<fasta> Qrntz: yeah, I am sort of a 'fan' of ATS, except for its syntax.
<fasta> Qrntz: partly because of my linear logic familiarity.
<Qrntz> s@yntax
<fasta> Yeah.
<fasta> I mean: who makes up that stuff?
<fasta> That's a rhetorical question.
<K_F> nothing beat INTERCAL :)
<fasta> I think being precise about what you mean is good.
<fasta> I.e. 'this object lives for exactly this long'.
<fasta> This runs in exactly 100ms.
<fasta> "This terminates".
<fasta> "This computes an object with the following properties."
sepp2k has joined #ocaml
justdit has quit [Ping timeout: 248 seconds]
justdit has joined #ocaml
oxc has joined #ocaml
oxc has quit [Quit: oxc]
tumdum has joined #ocaml
tbrady has joined #ocaml
rudi_ has left #ocaml []
rgrinberg has joined #ocaml
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
<adrien> when using godi, lablgtk's package using git always installs everything in site-lib, not pkg-lib
<adrien> I don't understand why, any idea?
justdit has quit [Ping timeout: 252 seconds]
eikke has quit [Ping timeout: 256 seconds]
agumonkey has joined #ocaml
ankit9 has joined #ocaml
eikke has joined #ocaml
tbrady has quit [Quit: tbrady]
<fasta> adrien: do you know how Ocsigen obtains persistent client programs?
<fasta> adrien: or even what they actually mean by that in technical terms?
<adrien> don't know
<fasta> adrien: I don't know what the difference is between site-lib and pkg-lib, but assuming you are right, likely just ignorance/lack of time on whoever packaged it?
eni has joined #ocaml
<adrien> I did work on the packaging and it's something godi is supposed to do automatically
<adrien> as for pkg-lib vs. site-lib, pkg-lib is for libs installed through godi, while site-lib is for others
fraggle_ has joined #ocaml
ankit9 has quit [Quit: Leaving]
Progster has joined #ocaml
eni has quit [Ping timeout: 248 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Kakadu has joined #ocaml
pango has quit [Ping timeout: 252 seconds]
pango_ has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Arsenik has joined #ocaml
Kakadu has joined #ocaml
Cyanure has quit [Read error: Connection reset by peer]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 255 seconds]
eni has joined #ocaml
pango_ is now known as pango
Progster has quit [Ping timeout: 272 seconds]
eni has quit [Read error: Connection reset by peer]
eni has joined #ocaml
tumdum has quit [Quit: tumdum]
avsm has joined #ocaml
tbrady has joined #ocaml
<tbrady> I have a program where mark_slice eats the most time, 12.8% specifically according to gprof. Is this a common figure?
<adrien> yes and no
<adrien> usually the GC isn't the bottleneck
<adrien> but it's not something that never happens either
<fasta> tbrady: is it a graph algorithm?
<tbrady> fasta: no, it's a financial thing. Kind of a foldl over a large text file.
<fasta> tbrady: still 12% is not that much.
<tbrady> Is it worth experimenting with the Gc module?
<fasta> tbrady: I would only worry about it when it is over 30% myself.
<adrien> tbrady: as fasta said, it's not your biggest concern
<adrien> it's good to know about GC settings however, but you won't get anything significantly faster here
<flux> tbrady, it can help adjusting the GC parameters
<flux> however, the defaults have been upped some time in near history
<flux> so it's probably less likely to help nowadays
<flux> unless you have a problem that creates a lot of data that could be thrown in a minor collection if the limits just were increased a bit..
<adrien> adjusting the values typically helps when you have lots of allocation and can spend some more memory
<tbrady> I'm curious because, for this use case I don't need gc at all. the data are always smaller than memory, so I'd turn it off entirely if I could.
<adrien> when I make the GC use more memory (do less work), I also return it to its previous settings once the code that allocates a lot is over
<flux> tbrady, well in that case you could have GC activate even more rarely
<adrien> tbrady: memory fragmentation, and "temporary" values
<flux> tbrady, do notice that you probably do create garbage a lot, death by thousnad cuts ;)
<adrien> but could we see gprof's output?
<tbrady> flux: how do I have it active less?
<adrien> yeah, if collections get triggered, it's because there was been garbage
<flux> tbrady, probably by increasing the numbers minor_heap_size and space_overhead with the Gc module
<adrien> it'll also increast latency when collecting
<fasta> tbrady: if you have infinite memory, it never runs.
<flux> surely you will need to tell ocaml gc first that you have infinite memory..
<fasta> tbrady: another way is to restructure a part of your program such that there are no allocations.
<fasta> Is that even possible in OCaml?
<adrien> let a = 3,4
<flux> it is, but it's going to be impractically limited
<adrien> allocates
<flux> adrien, but if you have for a = 1 to 10 x.(a) <- x.(a) + 1; done; does that allocate?
<flux> (+do)
<adrien> no idea :P
<adrien> I guess something like that could still do allocations because of boxing
<fasta> I think the best thing is still an interpreter like compiler and a sufficiently smart one.
<fasta> THe SSC runs when you are sleeping.
<fasta> I suppose that's an advantage of using SML.
<fasta> But... I don't really see mlton back in the language shootout.
<fasta> Is that because whole program compilation isn't that great?
<fasta> I.e. it depends more on other details of the compiler?
<adrien> languages like ATS and MLton would be faster for many of the things we've mentionned afaik
<adrien> mlton is slow as hell when it comes to building however
<adrien> I gave up after compiling "hello world"
<fasta> Yes, which is why you should never have it as a development compiler.
<fasta> adrien: it's not that slow.
<adrien> mlton makes g++ -O3 on a 486 look fast
<fasta> adrien: but yes, compared to ocaml or gcc it's terrible.
<fasta> It's good in that it trades human time for CPU time.
* adrien has been spoiled by ocaml
<fasta> But only when you don't notice that it is running.
<fasta> So, e.g. it has to run on some separate machine.
<fasta> Isn't there an OCaml to ML compiler?
<fasta> (which would then make use of MLton)
<adrien> SML and OCaml are different
xcombelle has quit [Ping timeout: 250 seconds]
eikke has quit [Ping timeout: 244 seconds]
<fasta> Doesn't OCaml have an allocation profiler?
<fasta> Why not?
<fasta> That seems like a _really_ basic tool to have.
<fasta> And also rather important.
eikke has joined #ocaml
<adrien> there is one but floating as a patch
<fasta> Instrumenting a program for CPU time isn't that hard.
<fasta> That takes a student a week.
<fasta> For memory I imagine it's about the same.
<fasta> I.e. as a source to source program transformation.
<fasta> Why didn't the Frenchies allocate (get it, haha) a student for that?
<adrien> a patch exists but it has never been merged, there must be a good reason
<adrien> (now could be a good time to talk about it again however)
<fasta> Why would it have to work as a patch to the compiler?
<fasta> I suppose it would be more practical, though.
<adrien> I meant
<adrien> coding it is not the issue: the code already exists
<adrien> the issue must be something else
<fasta> adrien: is the patch still working?
emmanuelux has joined #ocaml
<adrien> I think it hasn't been updated recently
<adrien> there is probably a mantis bug entry about it
<fasta> It seems all these research languages have broken tools.
<adrien> consider the slowdown caused by valgrind
<fasta> Java has good tools, Haskell amateuristic ones, Ocaml only has a compiler.
<fasta> adrien: I think that's more than acceptable.
<adrien> not an easy task to make it
<adrien> I don't care either about it but some do
<fasta> adrien: what do you do when you have a 40000 line OCaml program and find a memory problem?
<fasta> adrien: binary search?
<fasta> Manually doing that get olds really quick.
<fasta> gets old*
<adrien> I calm down, grab my katana and let it point where it wants: it's where the issue is
Anarchos has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
<fasta> adrien: what's the Ocaml malinglist of choice?
<fasta> adrien: mailinglist*
<thelema_> fasta: caml-list
<fasta> thelema_: http://caml.inria.fr/pub/ml-archives/caml-list/ only goes to 2010?
sepp2k has quit [Remote host closed the connection]
<fasta> I found a 3.12.1 patch, but it would have been nice if there was some kind of 'official' page for that.
<fasta> Also, what does ocaml-memprof do exactly; i.e. what is its output?
<fasta> And what are its limitations.
<fasta> adrien: did you mean that valgrind and ocaml play nicely along?
milosn has quit [Ping timeout: 250 seconds]
milosn has joined #ocaml
iago has joined #ocaml
eni has quit [Quit: Leaving]
agumonkey has quit [Quit: Lost terminal]
ski has joined #ocaml
cdidd has quit [Ping timeout: 265 seconds]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
sepp2k has joined #ocaml
<vext01> the ocaml beta 2 builds out of the box on openbsd/sparc64 :)