dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | 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/
clog has joined #ocaml
dark_light has quit ["Ex-Chat"]
dark_light has joined #ocaml
<mikeX> is there a way to have a dictionary structure that guarantees == instead of = for it's keys?
chessguy has joined #ocaml
<Smerdyakov> mikeX, odd question. I don't know what interpretation of your words you could have where the answer isn't "yes, trivially."
<mikeX> Smerdyakov: nevermind, I wasn't thinking clearly : )
<mikeX> I don't think I even know what i had in mind
<mikeX> what I really wanted was a ``stronger'' key to a certain hash table
sponge45 has joined #ocaml
mikeX has quit ["zzz"]
johnnowak has joined #ocaml
mpc has quit []
<jordan-> are there functions to convert a string to a list?
<tsuyoshi> a list of what?
<beschmi> there is explode : string -> char list in extLib
Smerdyakov has quit ["Leaving"]
Skal has joined #ocaml
Skal has quit [Remote closed the connection]
beschmi has quit ["Leaving"]
Skal has joined #ocaml
Skal has quit [Read error: 104 (Connection reset by peer)]
Skal has joined #ocaml
sponge45 has quit ["zzzzzzzzzz"]
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- Leading Edge IRC"]
pango_ has joined #ocaml
yondalf has joined #ocaml
pango has quit [Remote closed the connection]
yondalf has quit ["leaving"]
_velco has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
kral has joined #ocaml
_fab has joined #ocaml
fab_ has joined #ocaml
fab_ has quit [Client Quit]
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
buluca has quit [Read error: 131 (Connection reset by peer)]
love-pingoo has joined #ocaml
_fab has quit []
mikeX has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
<pango_> mikeX: your question made me think of "hash consing" (http://www.lri.fr/~filliatr/software.en.html and others)
<pango_> for strings, a weak hash table is often useful... one just have to take care not mutating (now shared) strings :)
<mikeX> that seems interesting, my teacher used a hashcons module but I didn't really understand how it worked (or what it was needed for)
<pango_> another think to look for, is that OCaml hash tables don't save hash values, so when hash tables need to be resized, all elements gets rehashed
<pango_> which can be expensive for large sets of strings... Better give an approximatively correct size when creating the hash table
<pango_> (or at least not too small "since it will be resized automatically anyway")
<mikeX> ot, are private methods a new addition (>3.0.8)? I don't recall seeing any before
ikaros_ has joined #ocaml
ikaros_ has quit [Client Quit]
velco has joined #ocaml
<love-pingoo> anybody knows how to check that a package is newer than a given version using ocamlfind ?
<flux__> crude way would be something like ocamlfind query package -l | grep '^version:' | .. more shell here ..
<love-pingoo> I didn't know -l, thanks. But that's still a bit crude indeed..
<flux__> maybe -format can do something useful to remove the need for grep
<love-pingoo> "ocamlfind query camomile -l | grep '^version:' | grep 0.[0-6]" will be enough to check that camomile isn't too old
<flux__> try to make a check that won't break in the future :)
<flux__> note that . matches any character
<love-pingoo> oops :)
slipstream has joined #ocaml
Demitar has quit [Read error: 104 (Connection reset by peer)]
<mikeX> reading the paper on hashconsing, why is "choosing a prime number is always a good idea" (for hash table initial size)?
slipstream-- has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
Demitar has quit [Client Quit]
Demitar has joined #ocaml
johnnowak has quit []
l_a_m has quit [Read error: 110 (Connection timed out)]
mikeX has quit ["leaving"]
MisterC has joined #ocaml
Skal has quit [Connection timed out]
<mellum> mikeX: It isn't, unless you have a lame hash function.
<flux__> would choosing a prime be a bad idea then, if not taking the efficiency of dividing by 2^n into account?
_JusSx_ has joined #ocaml
l_a_m has joined #ocaml
<mellum> flux__: no. but it would be stupid not to take that into account
Smerdyakov has joined #ocaml
Sweetsha1k has joined #ocaml
Sweetshark has quit [Read error: 110 (Connection timed out)]
jordan- has quit ["This computer has gone to sleep"]
jordan- has joined #ocaml
buluca has joined #ocaml
bmiller has joined #ocaml
kral has quit [Remote closed the connection]
danly has joined #ocaml
jordan- has quit [Read error: 110 (Connection timed out)]
velco has quit ["Ex-Chat"]
ziggurat has joined #ocaml
love-pingoo has quit ["Leaving"]
_velco has quit ["I'm outta here ..."]
mikeX has joined #ocaml
_fab has joined #ocaml
khaladan has joined #ocaml
smimou has joined #ocaml
Snark has joined #ocaml
khaladan_ has quit [Connection timed out]
bmiller has quit []
_fab has quit [Read error: 110 (Connection timed out)]
_fab has joined #ocaml
protoscript has quit [Read error: 110 (Connection timed out)]
bmiller has joined #ocaml
bmiller has quit [Client Quit]
Sweetsha1k has left #ocaml []
<flux__> mellum, how many cycles is a div on a modern cpu anyway?
<flux__> versus a suitable hashing function
<mellum> flux__: depends. i386 has very fast div IIRC, most other something like 50-100 cycles
<flux__> on pentium it takes about 15 cycles
<flux__> I'd imagine less on more modern cpus..
<mellum> nope.
<mellum> for example alpha and ia64 don't even *have* a div instructino.
<flux__> and how modern is alpha?
<mellum> It' just not important, and takes heaps of transistors if you want to get it right.
<flux__> ia64, now there's a point
<flux__> although it appears it's an architecture soon to be extinct
<mellum> well, alpha is about 20 years more modern than i386, for example.
<flux__> can you buy an alpha these days?
<flux__> without resorting to a second-hand store..
<mellum> you're surely not going to argue that i386 is a better architecture than alpha? because that would certainly loos you every bit of credibility :)
<flux__> I'm not sure where I was making such a claim
<flux__> alpha was a very nice architecture, especially considering when it was designed
<flux__> and it's a shame it didn't last.
<flux__> but I wouldn't say that because alpha doesn't have a built-in div, one should determine that div is something bad
<flux__> it's just something that wasn't determined to be so useful that it needs to be in the core
<flux__> nowadays there are multiple units that can do 128 bit floating point/integer operations
<mellum> but not integer division.
<flux__> I think we can afford a hashing algorithm having one additional div in it
<mellum> and floating point division is still slow.
<mellum> It's only worth it if your hash sucks. And if your hash sucks, you're fucked anyway.
<flux__> well, it still might be cheaper to have a nice prime div than a real hash
<mellum> the prime stuff will mitigate it a little, but you'll run into trouble.
<mikeX> alpha lives on partly through amd64
<mikeX> right?
<mellum> mikeX: how so?
<flux__> md5, which I guess would be a decent hash, takes 337 cycles on a pentium
<mellum> nobody uses md5 for a hash table.
<mellum> If you want to see a really good hash table, habe a look at the Python source. They *really* thought things over. And it's nicely documented.
<mikeX> well part of the alpha team went to amd, and they said a lot of the alpha lives inside amd64, at it's core
<flux__> I think in the last year or so I've used 1. byte xor (2. byte rol 1) xor (3. byte rol 2) etc, it wasn't very good but did its job :)
<mikeX> that's what I've read at least
<mellum> For example, if you want things to be fast, you absolutely have to take cache line effects into account.
<mikeX> hm I could be full of crap, can't find the article now
<flux__> I too may have heard it been mentioned, that some of the alpha-team went to amd
<flux__> but I suppose it can refer to the architecture below the level a developer sees it
<mikeX> yes
bmiller has joined #ocaml
<mikeX> iirc it said tha amd64 has a small risc core, on top of which x86 was implemented or something similar
<pango_> that's not specific to amd64
<mikeX> ?
<pango_> I think all Pentiums have such architecture, so it's a, maybe, 10 years old trick
<mikeX> hmm
<pango_> unless they specified something more precise than that
Snark has quit ["Leaving"]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
chessguy has joined #ocaml
_JusSx_ has quit [Client Quit]
bmiller has quit []
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- The professional IRC Client"]
smimou has quit ["bli"]
ziggurat has quit ["Leaving"]
khaladan has quit [brown.freenode.net irc.freenode.net]
TaXules has quit [brown.freenode.net irc.freenode.net]
mattam has quit [brown.freenode.net irc.freenode.net]
l_a_m has quit [brown.freenode.net irc.freenode.net]
fremo has quit [brown.freenode.net irc.freenode.net]
Hadaka has quit [brown.freenode.net irc.freenode.net]
Demitar has quit [brown.freenode.net irc.freenode.net]
pattern has quit [brown.freenode.net irc.freenode.net]
MisterC has quit [brown.freenode.net irc.freenode.net]
ikaros has quit [brown.freenode.net irc.freenode.net]
tsuyoshi has quit [brown.freenode.net irc.freenode.net]
shawn__ has quit [brown.freenode.net irc.freenode.net]
gim has quit [brown.freenode.net irc.freenode.net]
seafood_ has quit [brown.freenode.net irc.freenode.net]
Amorphous has quit [brown.freenode.net irc.freenode.net]
ozzloy has quit [brown.freenode.net irc.freenode.net]
Shimei has quit [brown.freenode.net irc.freenode.net]
mikeX has quit [brown.freenode.net irc.freenode.net]
buluca has quit [brown.freenode.net irc.freenode.net]
cmeme has quit [brown.freenode.net irc.freenode.net]
flux__ has quit [brown.freenode.net irc.freenode.net]
Foxyloxy has quit [brown.freenode.net irc.freenode.net]
zamez has quit [brown.freenode.net irc.freenode.net]
ulfdoz has quit [brown.freenode.net irc.freenode.net]
Ugarte has quit [brown.freenode.net irc.freenode.net]
triple_ has quit [brown.freenode.net irc.freenode.net]
pingu has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
bebui has quit [brown.freenode.net irc.freenode.net]
Norgg has quit [brown.freenode.net irc.freenode.net]
haelix has quit [brown.freenode.net irc.freenode.net]
Demitar has joined #ocaml
pattern has joined #ocaml
MisterC has joined #ocaml
ikaros has joined #ocaml
tsuyoshi has joined #ocaml
shawn__ has joined #ocaml
seafood_ has joined #ocaml
ozzloy has joined #ocaml
gim has joined #ocaml
Amorphous has joined #ocaml
Shimei has joined #ocaml