sepp2k has quit [Read error: Connection reset by peer]
Amorphous has quit [Ping timeout: 248 seconds]
jakedouglas has quit [Quit: Leaving.]
valross has quit [Remote host closed the connection]
elehack has joined #ocaml
metasyntax has joined #ocaml
<elehack>
thelema: I just pushed a commit redoing the Makefile change to default to ocamlfind's default and use the README-documented DESTDIR rather than PREFIX.
<elehack>
(if the user specifies no installation target, ocamlfind's default is better than ocamlc -where IMO)
<elehack>
but we didn't support the DESTDIR that we documented before, which was an error.
<thelema>
elehack: no problem - I looked for how we did PREFIX-style installation dir before, but didn't findn it
<thelema>
I'm all for making mistakes quickly and moving forward - exactly as you've done to fix what I committed.
<elehack>
ok, good to know :)
<elehack>
And now my PPA should have updated Batteries packages whenever they get through the build queue.
<thelema>
for 3.11?
<thelema>
should we put your PPA on the wiki?
<elehack>
yes, it's built against 3.11.
<elehack>
and the PPA is already on the Install page of the wiki.
<elehack>
it gets Git snapshots on a somewhat irregular basis.
<elehack>
(and has a few other goodies)
<thelema>
oh, I didn't realize.
<elehack>
np
* thelema
moves it up to the top of the page
<elehack>
the installing from packages section?
<thelema>
yes
<elehack>
that sounds like a good idea.
<elehack>
people probably would prefer doing that in general.
<thelema>
better...
<thelema>
especially lazy people, who might not scroll past the 'install from source' section
<elehack>
yeah
<elehack>
hey, the Debian people have updated the batteries package :)
<elehack>
I should checkout how they updated the debian/rules file and compare it with my changes sometime.
jakedouglas has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
|marius| has quit [Read error: Connection reset by peer]
elehack has quit [Quit: not a typewriter]
halfie has quit [Ping timeout: 264 seconds]
jakedouglas has quit [Quit: Leaving.]
kaustuv has joined #ocaml
<kaustuv>
Signature substitution + recursive modules lets me do something that I've always wanted in OCaml: duplicate record field names in a recursive type: http://ocaml.pastebin.com/9sAxUcV3
<kaustuv>
It's not 100% as pretty as it can be, but I can live with it.
<kaustuv>
(I suppose there is no reason why signature substitution is strictly necessary in this pattern, and might even be a nuisance since none of the modules will ascribe to the unsubstituted signature...)
iratsu has quit [Ping timeout: 246 seconds]
|marius| has joined #ocaml
ygrek has joined #ocaml
alexyk has joined #ocaml
<alexyk>
I'm inverting a nested Hashtbl with 3-levels, swapping, in each path (from,day,to,n), to and from: => (to,day,from,n). Simple nested iter takes oto long, while Haskell/Clojure equivalents run faster: http://paste.pocoo.org/show/238188/ -- better ways?
joewilliams is now known as joewilliams_away
iratsu has joined #ocaml
dskippy has joined #ocaml
<flux>
alexyk, I have no other advice than: 1) play with the GC parameters 2) play with the initial size of the hash
<flux>
profiling would tell if the steps might be helpful beforehand
<kaustuv>
In your calls to H.find_default, aren't you always constructing the default value even if it's not needed?
<flux>
alexyk, profiling native code is easy. compile with -g and after running use gprof on the binary
<flux>
(reading the results is slightly more tricky at times, though)
<alexyk>
kaustuv: thx! do you think exceptions will be faster than find_option?
<alexyk>
flux: ok, but I'll change it first :)
<kaustuv>
Yes because find_option is implemented using exceptions (and does 1 extra allocation)
<kaustuv>
but I doubt your code will show a measurable difference between exceptions and find_option
<thelema>
alexyk: I've replaced Hashtbl with Map and gained lots of speed - Hashtbl can have bad performance if hash is expensive
<kaustuv>
In this case he is hashing strings and ints, so hash is about as fast as it gets
<thelema>
*very* bad performance
<alexyk>
kaustuv: correct, the keys are very simple types
<thelema>
the ocaml string hash isn't that great, imnsho
<kaustuv>
thelema: explain? how can you be slower than O(string length)?
<kaustuv>
or do you mean that it is too collidy?
<alexyk>
thelema: is Batteries Map same pain to instantiate as the old one?
<alexyk>
I mean, can you play with substituting Hashtbl by Map easier?
<alexyk>
kaustuv: ok, find_option finishes in 125 seconds vs original 12 minutes vs Haskell's 100 seconds, acceptable :)
|marius| has quit [Remote host closed the connection]
<alexyk>
kaustuv: will now compare your's exceptional one :)
<kaustuv>
thelema: looking at ocaml/byterun/hash.c, the string hash function is basically the sdbm hash function from here: http://www.cse.yorku.ca/~oz/hash.html
<kaustuv>
Or wait, I lied. String hashing uses Combine_small(), not Combine(), so its hash constant is 19 not 65599. Hmm... You might be right
<thelema>
kaustuv: my experience with ocaml's hashing is pretty poor.
<thelema>
I had a Hashtbl of parsed regular expressions (simple, resursive variant type) hashed into a hashtbl with 10K buckets and I was only using <20 of the buckets
<thelema>
(according to ocamlviz)
<thelema>
alexyk: batteries map is easy to instantiate, but it's not mutable, so you'll have to make adjustments to replace hashtbl with it.
<thelema>
batteries map is simple polymorphic type, like hashtbl
<alexyk>
thelema: ok, cool
<alexyk>
is it Xavier's old pMap?
|marius| has joined #ocaml
<kaustuv>
thelema: If you are not averse to a little compiler hacking, change the Combine_small() on line 72 of byterun/hash.c to Combine() and see if you still have so many collisions
|marius| has quit [Read error: Connection reset by peer]
<thelema>
alexyk: yes, with more functions
<thelema>
kaustuv: not today. now I sleep. Maybe I'll play with that in the future.
<alexyk>
ok
ygrek has quit [Ping timeout: 245 seconds]
Amorphous has joined #ocaml
alexyk has quit [Quit: alexyk]
ttamttam has joined #ocaml
Yoric has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
valross has joined #ocaml
boscop has quit [Ping timeout: 258 seconds]
boscop has joined #ocaml
Yoric has quit [Quit: Yoric]
ikaros has joined #ocaml
Samae has left #ocaml []
ikaros has quit [Quit: Leave the magic to Houdini]
ftrvxmtrx has joined #ocaml
ttamttam has left #ocaml []
kaustuv has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
avsm has quit [Quit: Leaving.]
Associat0r has joined #ocaml
iratsu has quit [Ping timeout: 245 seconds]
valross has quit [Quit: Ex-Chat]
iratsu has joined #ocaml
ygrek has joined #ocaml
verte has joined #ocaml
dskippy has quit [Quit: Leaving.]
sepp2k has joined #ocaml
marteo has joined #ocaml
_andre has joined #ocaml
Yoric has joined #ocaml
ttamttam has joined #ocaml
oriba has joined #ocaml
oriba has quit [Client Quit]
Anarchos has joined #ocaml
Yoric has quit [Ping timeout: 258 seconds]
Associat0r has quit [Quit: Associat0r]
ttamttam has quit [Quit: Leaving.]
avsm has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ygrek has quit [Ping timeout: 245 seconds]
Nimblefinger has joined #ocaml
<Nimblefinger>
im just starting out trying to get my head round functional programming, and hopefully this is the right place to come for some help - im struggling to work out why this bit of code doesn't work. It's meant to create a list of digits in a number: http://pastebin.com/sXhDqSda
ygrek has joined #ocaml
<Nimblefinger>
I should say I'm manually inputting the length of the number for now, since I was trying to make it as simple as possible to work out why it isn't working - the error message highlights "(list (x mod 10**len) len-1)" and says it has type int but is here used with type int list
_unK has joined #ocaml
<orbitz>
Nimblefinger: what doesn't work?
<gildor>
Nimblefinger: len-1 -> (len - 1)
<gildor>
BTW, you also have redefined **, I suppose
<Nimblefinger>
yes I have, sorry i forgot to say that
<orbitz>
oh yes durh
<Nimblefinger>
ah
<Nimblefinger>
thanks
<Nimblefinger>
could you possibly explain why that was incorrect for me?
<gildor>
Nimblefinger: application of list take precedence over application of operator -
<Nimblefinger>
ahhh
<Nimblefinger>
thanks a lot :)
<Nimblefinger>
makes sense now
__gilles_ has quit [Remote host closed the connection]
<Nimblefinger>
well I've got my function to work and generate me a list of the digits in a number, but I'm pretty sure I'm going to be doing it in a really inefficient/daft way - would someone be able to comment a little on how to make this slicker, or just how bad/good it actually is since I have no real idea? http://pastebin.com/9uFifTuQ
<Nimblefinger>
I particularly am unsure about the length bit
<Nimblefinger>
oh, ignore the fact its called sumDigits - I'm eventually using it to solve one of the problems at projecteuler.net
<gildor>
Nimblefinger: humm, your method is very inefficient
<gildor>
Nimblefinger: using log to decompose a number is not a good idea