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}"
<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