lamawithonel__ has quit [Ping timeout: 240 seconds]
lamawithonel__ has joined #ocaml
Tobu has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 265 seconds]
beginner has quit [Read error: Connection reset by peer]
beginner has joined #ocaml
kmc has quit [Ping timeout: 240 seconds]
kmc has joined #ocaml
ousado has quit [Remote host closed the connection]
twittard has joined #ocaml
twittard has quit [Client Quit]
Tobu has quit [Ping timeout: 272 seconds]
cdidd has joined #ocaml
ulfdoz has joined #ocaml
Tobu has joined #ocaml
zzz_ has quit [Remote host closed the connection]
zzz_ has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
ulfdoz has quit [Ping timeout: 240 seconds]
NihilistDandy has joined #ocaml
abdallah has joined #ocaml
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 245 seconds]
<abdallah>
Is there any noticeable efficiency difference between "type t = A of float | B of float" and "type t = float * bool" ?
ftrvxmtrx has joined #ocaml
<_habnabit>
Those mean completely different things
<_habnabit>
You couldn't use them interchangeably
Tobu has quit [Ping timeout: 248 seconds]
<companion_cube>
I find them quite similar, though
<companion_cube>
I mean, there's a nice isomorphism
mfp has quit [Ping timeout: 240 seconds]
<abdallah>
In my program, their use is encapsulated in a tiny module that is used a lot. t is abstracted so for the rest of the program it doesn't really make a difference which representation I choose. Moreover, none of these two representation is very intuitive for my task.
<abdallah>
I know that my floats are always between 0 and 1, so ideally I would use type t = float and use the sign bit to distinguish between case A and case B. However there is a bug in my implementation, probably due to the subtleties of -.0. and +.0.
<abdallah>
So I think I'll stick with the "type t = A of float | B of float" which has proven its value.
Tobu has joined #ocaml
<companion_cube>
do you think it's really a bottleneck?
<abdallah>
when the bit sign implementation wasn't buggy, there was between 10 and 20 % speed difference.
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<abdallah>
that's not too much, but it's still measurable.
<abdallah>
or rather 5 to 10 %... still!
scottmcl66 has joined #ocaml
<companion_cube>
first, correctness, then , speed ;)
<abdallah>
exactly, and at the moment I've more interesting things to do than correct my bit sign implementation, so I'll leave it for later.
<abdallah>
On the other hand, I'm confident I could switch to the "type t = float * bool" without introducing bug (as the interpretation of the floats is exactly the same), but I feel like, it's not worth it.
<companion_cube>
I don't know how A of float is implemented,but if you find out I'd be interested in the explanations
<edwin>
yeah you probably can't use restrict there
_andre has joined #ocaml
<edwin>
restrict is ok for memcpy but not for memmove
<edwin>
because restrict tells the compiler that the pointers don't alias, which they obviously do for overlapping ars
<edwin>
adrien: did you hit that bug with ocaml?
<adrien>
edwin: no, it was on an unrelated issues and incompatibilities between versions of gcc and libc
<adrien>
and the use of "gcc >= X breaks libc <= Y"
<edwin>
yeah libc had a bug, but older versions of gcc didn't punish you for it
<adrien>
the kind of bugs that's a lot of fun to deal with ;-)
<edwin>
I completely forgot about that bug though, it was almost a year ago ;)
snearch has joined #ocaml
<adrien>
I just stumbled on it a few days ago; can't remember why :P
<adrien>
I thought it was more recent
<edwin>
"Date: Sun, 10 Apr 2011 12:18:43 +0300"
leoncame` has quit [Ping timeout: 248 seconds]
otk_ has joined #ocaml
otk has quit [Ping timeout: 260 seconds]
Tobu has quit [Quit: No Ping reply in 180 seconds.]
Tobu has joined #ocaml
fantasticsid has joined #ocaml
jave has quit [Read error: Operation timed out]
roha has quit [Read error: Operation timed out]
bnwr has quit [Read error: Operation timed out]
NaCl has quit [Read error: Operation timed out]
roha has joined #ocaml
bnwr has joined #ocaml
NaCl has joined #ocaml
<probst>
Dear ocamlers. What is the difference between <> and != in OCaml? They seem to give me the same result?
<bnwr>
probst: the same difference as = and ==
<bnwr>
one compare the address location, the other the content
jave has joined #ocaml
<probst>
bnwr: thanks. So <> is true if the address location differs?
<adrien>
<> does not depend on the location in memory
<bnwr>
let x = [42] in let y = [42] in x OP y <-- try with OP being either <> or !=
iago has joined #ocaml
<bnwr>
with != it's true (because they are different locations)
<bnwr>
with <> it's false (because the values are equal)
<probst>
bnwr: thanks :)
<bnwr>
probst: you can also compare function by physical equality (though it's a weird notion of equality) but you can't do it with structural equality
<probst>
bnwr: as in they are the same function instance that is being passed around? vs functionality wise the same?
<adrien>
well, before structural equality, ocaml will use physical equality first
<adrien>
so it might work fine
<adrien>
but it might also raise an exception :-)
<probst>
adrien: aha, thanks :)
<bnwr>
let f x = x in let g y = y in f = g <--- raise an exception
<bnwr>
it's usefull when you have functions in reactive signals and you need some sort of equality
fantasticsid has quit [Ping timeout: 245 seconds]
fantasti` has quit [Ping timeout: 240 seconds]
<bnwr>
btw anyone knows what structural equality on unforced lazy values does?
<bnwr>
ohh… same exception as function comparison
avsm has quit [Quit: Leaving.]
ikaros has joined #ocaml
NihilistDandy has quit []
emmanuelux has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
dwhj has joined #ocaml
avsm has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
antegallya has joined #ocaml
Tobu has joined #ocaml
mfp has joined #ocaml
EmmanuelOga has joined #ocaml
letrec has joined #ocaml
Tobu has quit [Read error: Operation timed out]
<jave>
why doesnt "ocamlfind query -a-format -r yojson" show which cmxa files to link?
<jave>
"ocamlfind query -i-format -r yojson" seems to show the correct includes at least
<flux>
bnwr, quite fun, if they are forced the comparison works fine..
<flux>
that could lead to some quite surprising bugs :)
<adrien>
jave: you need -predicates native
<adrien>
obvious in hindsight ;-)
<adrien>
or however that's spelt
NihilistDandy has joined #ocaml
<jave>
adrien: thanks!
<adrien>
=)
<jave>
is it possible to trick ocamlfind to produce an entire set of flags for a dependency in one go? somewhat ike pkg-config?
<adrien>
I think so...
<adrien>
but also, why are you using -query and not calling ocamlfind $command directly?
<jave>
well, Im not really sure what to do. This is an existing project with an old build system im trying to modify to accept a couple of new dependencies
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
<adrien>
well, usually, the easiest and cleanest way is to replace calls to ocamlc/ocamlopt with calls to "ocamlfind ocamlc", "ocamlfind ocamlopt", ...
<adrien>
it can make cross-compilation pretty easy too
<jave>
oh okay.
<adrien>
(my goal is to get everything for cross-compilation of ocaml upstream and well by the end of the year)
<jave>
sounds cool
<jave>
well, Ill change $(OCAMLOPT) to $(OCAMLFIND) and whatch the breakage...
<avsm>
adrien: if you can do 32/64-bit x-compile, that would be most useful
<adrien>
you could: OCAMLOPT:=ocamlfind ocamlopt
<jave>
aha!
<adrien>
avsm: my goal is windows; I guess that once we have that, 32/64 bit should be pretty easy
<adrien>
ocamlfind's config handles using ocamlopt vs ocamlopt.opt too
Tobu has joined #ocaml
<avsm>
adrien: great!
<adrien>
the basic idea/process will be: yypkg, oasis support/tricks and oasis in lablgtk2
<adrien>
I guess that all these should be a good incentive to have support upstream :-)
<djcoin>
adrien: May I ask if you are part of the inria team ?
<adrien>
you can ask
<djcoin>
adrien: Are you part of the inria team ? :)
<adrien>
no :P
<djcoin>
Im wondering who is, in this chan :)
<djcoin>
Just curious
<adrien>
they're hiding
<djcoin>
Okay, because your "goal" -> cross compilation merge in upstream, seems pretty much be a "long term" task. I would have guessed you were part of some scientist organization for the promotion of ocaml, or something like that
<djcoin>
Whatever :)
<adrien>
djcoin: hmmm, but I don't think that any member of the "core team" is on the channel
<adrien>
there are already patches for cross-compilation
<djcoin>
Oh! ok
<adrien>
so cleaning and proving it's wanted and is going to be used
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<avsm>
its definitely useful in the xen build chain. kind of annoying right now that the ocaml bits of the tree are the only ones that can't cross-compile
<adrien>
yypkg packages for windows will be cross-compiled: it's faster, easier and it avoids some issues
<adrien>
like pkg-config depending on pkg-config
<adrien>
for build
Tobu has quit [Ping timeout: 272 seconds]
roha has quit [Quit: Leaving]
<probst>
dear ocamlers. If I am passed a record from one function in module A to a function in module B, how do I make sure I can still extract values from the record? Since the record definition lives in module A, module B cannot extract the record data. to another, and the record definition resides in the calling module. How can I still extract values from the record in the
Tobu has joined #ocaml
<probst>
Sorry. The previous message got sent before I had finished editing it. It should read: dear ocamlers. If I am passed a record from one function in module A to a function in module B, how do I make sure I can still extract values from the record? Since the record definition lives in module A, module B cannot extract the record data.
<adrien>
the syntax is: record.Module.field
<adrien>
and all variants to bring the values and types from the corresponding namespace
<probst>
adrien: thank you adrien!
<adrien>
:-)
pierre_m has joined #ocaml
<pierre_m>
Hi
<pierre_m>
I'm playing with the C/OCaml interface
<pierre_m>
oh
<pierre_m>
I think I just realized what my mistake is by writing down the question XD
<pierre_m>
classic
<adrien>
there was a library for a parser based on camlp4; anyone remember the name/link
cdidd has quit [Remote host closed the connection]
yroeht has quit [Ping timeout: 245 seconds]
yroeht has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
spearalot has quit [Quit: Computer has gone to sleep]
fraggle_ has joined #ocaml
snearch has quit [Quit: Verlassend]
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
wagle has quit [Ping timeout: 260 seconds]
edwin has quit [Quit: Leaving.]
abdallah has quit [Quit: Ex-Chat]
milosn_ is now known as milosn
letrec has joined #ocaml
<gildor_>
thelema: ping
<gildor_>
thelema: I have a pretty good implementation for bitset
<gildor_>
thelema: I see you did a lot of testing with various datastructure in benchsuite/bitset
<gildor_>
thelema: is it worth keeping it or should i just get rid of them
<gildor_>
(I am merging the repository before sending you the pull request)
<gildor_>
BTW, I think the most efficient DS for a bitset is a string ref
kmc has left #ocaml []
<gildor_>
I still cannot understand the need of Obj.magic all over the place
Xizor has quit [Ping timeout: 260 seconds]
<gildor_>
The speed up on my computer for general get/set/mem is 3.35ms -> 2.56ms (array is 2.26ms)
<gildor_>
but the most impressive speedup between former batBitSet and my optimized is count 496us -> 161us
<gildor_>
or next_set_bit 453 -> 367us
<gildor_>
and both count and next are way faster than array (760/470us)
<gildor_>
all in all I was able to get an Eratosthenes sieve 2 time faster than my first version using BatBitSet
<gildor_>
(well the sieve is not faster, but when you go over the limit of the sieve, the prime test is a lot faster because we use next_set_bit which is faster than a lot of array lookup)
emias has quit [Ping timeout: 265 seconds]
oriba has quit [Quit: oriba]
<gildor_>
thelema: tell me if I can throw all your tests (BitSetX in benchsuite/bitset.ml) or if I need to merge them, I'll do the pull request tomorrow
<gildor_>
(send me a mail, I am not that frequently on IRC lately)
djcoin has quit [Ping timeout: 260 seconds]
djcoin has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
Tobu has joined #ocaml
letrec has quit [Ping timeout: 252 seconds]
djcoin has quit [Quit: WeeChat 0.3.2]
twittard_ has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
twittard has quit [Ping timeout: 260 seconds]
twittard_ is now known as twittard
avsm has quit [Client Quit]
<thelema>
gildor_: ping
<thelema>
gildor_: reply by email sent.
Tobu has quit [Ping timeout: 248 seconds]
wagle has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 260 seconds]
milosn_ has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
<adrien>
thelema: properly placed ":>" worked well :-)
<adrien>
good night :p
<adrien>
water
<thelema>
adrien: great
<adrien>
when I left, I was worried I would have to place them somewhere I didn't want; came back, tried once where I liked, worked immediately :-)
<thelema>
you just have to choose the boundary between each type manually - ocaml won't convert automatically
<adrien>
right; it was quite frustrating at first however since the function could take _more_ params :P
<thelema>
yes, it seems like ocaml should be able to infer everything, but I'm sure there's a reason it doesn't
<adrien>
without my type annotations, it works I think; but I'm using .mli files so I didn't really have the choice
<adrien>
it's also quite annoying not to be able to write "let f (o : < foo: int; .. >)"
<adrien>
no, that you can
<adrien>
but you can declare a type with ".."
<thelema>
yes, the 'a required for unconstrained polymorphic types is a bit annoying
<adrien>
I'll have to cmigrep; but tomorrow :P
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 265 seconds]
iago has quit [Quit: Leaving]
Tobu has quit [Read error: Operation timed out]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
MaskRay has quit [Read error: Connection reset by peer]