Banana changed the topic of #ocaml to: OCaml 3.08.1 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
blugleblogle has joined #ocaml
themus has quit [Read error: 60 (Operation timed out)]
themus has joined #ocaml
blugleblogle has quit ["surchauffe cérébral ... surchauffe cérébral... interruption connection: homme-machine"]
blugleblogle has joined #ocaml
blugleblogle has quit ["surchauffe cérébral ... surchauffe cérébral... interruption connection: homme-machine"]
blugleblogle has joined #ocaml
cmeme has quit [Connection timed out]
cmeme has joined #ocaml
GreyLensman has joined #ocaml
blugleblogle has quit ["surchauffe cérébral ... surchauffe cérébral... interruption connection: homme-machine"]
kinners has joined #ocaml
det has quit [Read error: 60 (Operation timed out)]
GreyLensman has quit ["Leaving"]
det has joined #ocaml
zigong_ has joined #ocaml
cmeme has quit [Read error: 110 (Connection timed out)]
fremo has quit [Read error: 110 (Connection timed out)]
cmeme has joined #ocaml
kinners has quit ["leaving"]
vezenchio has joined #ocaml
mrsolo has joined #ocaml
cmeme has quit [Read error: 60 (Operation timed out)]
cmeme has joined #ocaml
kinners has joined #ocaml
mlh has quit [Client Quit]
cmeme has quit [Read error: 110 (Connection timed out)]
cmeme has joined #ocaml
daapp has joined #ocaml
pango_ has quit ["bbl"]
pango has joined #ocaml
kinners has quit ["leaving"]
mrsolo_ has joined #ocaml
Herrchen has joined #ocaml
mrsolo has quit [Read error: 113 (No route to host)]
cmeme has quit [Read error: 60 (Operation timed out)]
kinners has joined #ocaml
daapp has left #ocaml []
cmeme has joined #ocaml
mlh has joined #ocaml
kinners has quit [Read error: 60 (Operation timed out)]
mlh has quit [Client Quit]
gim has joined #ocaml
blugleblogle has joined #ocaml
Demitar has joined #ocaml
blugleblogle has quit [Remote closed the connection]
mrsolo_ has quit [Read error: 60 (Operation timed out)]
blugleblogle has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
DrSubby has joined #ocaml
DrSubby is now known as Submarine
blugleblogle has quit [Remote closed the connection]
Submarine has quit [Remote closed the connection]
blugleblogle has joined #ocaml
Submarine has joined #ocaml
blugleblogle has quit [Remote closed the connection]
Hanji has joined #ocaml
<Hanji> Hey, which ocaml emacs mode do you recommend?
<Submarine> the one shipping with ocaml? :-)
<Hanji> Can I get coloring with it?
<Submarine> yes
<Hanji> OK ... do I have to enable it somehow? Because I've got it loaded, and font-lock enabled, but it's not colorizing
<Smerdyakov> It colors very conservatively.
<Smerdyakov> It seems only to give strings and comments special treatment.
<Hanji> I'm not even getting that
<mellum> Try M-x font-lock-mode
<Smerdyakov> Perhaps you should throw a pinch of salt over your shoulder?
<Hanji> mellum: yeah, font-lock-mode is enabled
<Submarine> (require 'caml-font)
<Hanji> beautiful
<Hanji> thanks
<Smerdyakov> Hm. Do you get more than just strings and comments?
<Submarine> yes, I do
<Submarine> I get keywords, module names, strings, comments
<Hanji> yeah, I'm getting everything now
<Smerdyakov> I will try your advice for myself, then.
<Smerdyakov> Heeeeey, now _that's_ more like it! :-D
gim_ has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
Submarine has quit ["Leaving"]
smimou has joined #ocaml
vezenchio has quit ["Deadpool still votes for Perot. Every time. Just in case."]
pango has quit ["brb"]
pango has joined #ocaml
Submarine has joined #ocaml
CosmicRay has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
salo has joined #ocaml
smimou has joined #ocaml
<salo> is there a document i could read which would explain how to work with unboxed floats in ocaml?
<Submarine> floats are always boxed when outside of arrays and float-only records (the native code compiler also probably unboxes floats in CPU registers)
<calvin_> What would be a good way to represent a three dimensional vector?
<salo> can i compute with float arrays without boxing interim results? for example, can i componentwise sum two float arrays?
<Submarine> salo, no, but afaik the native compiler won't heap allocate the temporaries
<Submarine> just write the code and look at the asm
<salo> calvin: how about "type point = {x:float; y:float; z:float}"
<Submarine> calvin type vec = { x: float; y: float; z: float}
<calvin_> alright, thanks
<salo> submarine: does it make any difference if i am using the Array module or the BigArray module in terms of boxing?
<Submarine> in terms of temporaries, no
<Submarine> both float array and bigarrays are unboxed
<mellum> But if you care about floating point speed, then maybe Ocaml is simply the wrong language anyway.
<salo> this document:
<salo> suggesta a few ways to avoid boxing floats. interestingly, for/while loops can avoid boxing
<salo> mellum: perhaps, but it is always a balance. seems like even nieve ocaml code blows the doors of most other compilers
<Submarine> salo, this document does not say much more than was said here
<salo> it has a few points
monochrom has joined #ocaml
<Submarine> hmmm
mrvn has joined #ocaml
<Submarine> ok, when looking at asm code, indeed ocamlopt does not box temporaries (which are in CPU registers)
<Submarine> I've just compiled some more complex code, and I'm seeing some GC calls.
<mellum> salo: actually, the Ocaml compiler is pretty bad at optimizing. It has only very basic optimizations, no proper common subexpression elimination for example.
<Submarine> As far as I know, Xavier Leroy will only implement optimizations if they give *significant* yields on common code.
<mellum> What is "common code"?
<mellum> And what is "significant"?
<Submarine> "significant", I think, is something like 30%
<Submarine> "common code" = code that actually matters, as opposed to benchmarks
<mellum> Well, then you can do basically no optimization at all.
mrvn_ has quit [Read error: 110 (Connection timed out)]
<Submarine> salo, what kind of computations are you trying to implement?
<salo> lots of small computations on small vectors
<Submarine> what kind of computations?
<Submarine> and what is "small"?
<salo> i am writing a particle swarm optimizer. it is rather similar in nature to the n-body problem, and also to simple 3d graphics calculations. small is anywhere from 3 to 100, say
<Submarine> maybe write the vector ops in C
<Submarine> if you add long vectors, I'd say "use BLAS"
<mellum> Well, then you have a function call on each op.
<salo> yes, i could do that. my question was motivated by a desire to understand ocaml better tho
<Submarine> mellum, which is bad, indeed
<Submarine> salo, basically ocaml sucks at doing this kind of stuff
<salo> really? i arrived at ocaml by way of the language shootout results, in which ocaml comes out near the top in nearly all benchmarks
<mellum> But with this problem, most likely clever algorithms are more important than the compiler's quality anyway.
<mellum> salo: well, those are extremely artificial. And no floating point.
<Submarine> salo, if your goal is to implement a certain floating-point algorithm in the fastest way, then use C or FORTRAN
<salo> there are sseveral floating point tests, and they are not artificial from my perspective of scientific computing
<Submarine> you essentially cannot beat a good C or FORTRAN compiler on purely numerical code
<mellum> Dunno. I randomly benchmarked a Mandelbrot program in Ocaml, and it was like 10 times slower than C.
<Submarine> salo, do you have matrix-vector ops?
<Submarine> like C=AX+B where A is a matrix and B, X vectors?
<salo> sub: i understand your point, but of course it is nice if you can get very close from a pleasant language
<salo> sub: not with the PSO, no
<salo> of course one feasible option is to compile the fast float code with MLton and then link it in to the rest of the project
<Submarine> MLton?
<salo> doesn't box floats at all
<Submarine> linking SML to Caml!?!
<salo> i meant generating a .o file from MLton
<salo> am i talking crazy? this is quite new to me
<Submarine> well, you generally don't want to link together programs written in two garbage collected languages with two different runtime systems
<Submarine> your SML code will probably come with its own GC/runtime system
<Submarine> Caml has its own
<Submarine> linking the two will probably be high wizardry
<Submarine> I know guys who linked Lisp code to Caml code, it was heavy heavy wizardry
<salo> oh, that doesn't describe me. is this true even if i only use MLton to create a library object?
<Submarine> I don't know how MLton works, in particular.
<Submarine> But all garbage-collected languages I know of are difficult to link to.
<Submarine> Essentially, you have to collaborate with their GC.
<salo> i hadn't considered that, but i see your point
<Submarine> so if you ref to objects from Caml to, say, Lisp
<Submarine> you have to register a custom block in Caml that points to some Lisp GC root
<Submarine> and the reverse
<Submarine> notice that such an approach may result in uncollectable cycles
Submarine has quit ["Leaving"]
salo has quit []
blugleblogle has joined #ocaml
mlh has joined #ocaml
CosmicRay has quit ["Client exiting"]