<pango>
something's weird in weak hashtables... instead of using a constant load of 200%, like normal hash tables, they use a variable factor t.limit (load = 100% * limit), that starts at 3, and that gets increased by 2 each time the weak hash table is resized (by +50%)
<pango>
that explains the poor performance if you start with a too small weak hash table... t.limit gets larger with each resize, leading to larger load than if you start with a "correctly sized" table
<pango>
I think the t.limit <- t.limit + 2; line in weak.ml is broken
<pango>
or maybe that's to take into account that weak hashtables do some over-allocation in each bucket (since they're weak arrays, instead of lists) ?
trrkkkkk has quit [Read error: 113 (No route to host)]
dibblego has quit ["Leaving"]
pango_ has joined #ocaml
sponge45 has quit ["zzzzzzzzzz"]
yondalf has quit ["leaving"]
falconair has quit [Client Quit]
pangon8 has quit [Remote closed the connection]
postalchris has quit [Read error: 148 (No route to host)]
ikaros has quit [Read error: 60 (Operation timed out)]
Snark_ has joined #ocaml
ikaros has joined #ocaml
_velco has joined #ocaml
jajs has joined #ocaml
pango_ has quit ["brb"]
pango has joined #ocaml
unfo- has quit [Read error: 110 (Connection timed out)]
mellum has joined #ocaml
yondalf has joined #ocaml
love-pingoo has joined #ocaml
velco has joined #ocaml
trrkkkkk has joined #ocaml
yondalf has quit [Read error: 110 (Connection timed out)]
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
pinupgeek has joined #ocaml
<pinupgeek>
hey there
<flux__>
well hi
<pinupgeek>
is Practical Ocaml from Apress the book to get ?
<pinupgeek>
i know nothing about ocaml
<flux__>
I don't know
<pinupgeek>
the online documentation looks good too
<flux__>
the reviews don't seem to appraise it (infact the opposite), but there was an ocaml-new-comer who appreciated it
<flux__>
the documentation and tutorials have worked for me
<pinupgeek>
ah ok
<flux__>
what languages do you already know?
<love-pingoo>
let l = 1::2::l << uh ? that works.. cool :)
<pinupgeek>
ruby, bit of Io , perl etc that sort a thing
<haelix>
love-pingoo: or rather, let rec l = ... ?
<love-pingoo>
yes, with a rec
<love-pingoo>
it makes it possible to represent graphs in an immediate way
<flux__>
pinupgeek, oh.. well ocaml can be somewhat of a culture shock then, I imagine :)
<flux__>
pinupgeek, but try browsing through some tutorials (ocaml-tutorial.org is a nice one) first
<haelix>
love-pingoo: not sure about that
<pinupgeek>
k
<haelix>
last time I tried to make graphs of values,
<haelix>
I ended up resorting to mutable fields
<love-pingoo>
can you think of an example I could try ?
<flux__>
I wonder if you can convert a mutable graph (with cycles) into a non-mutable one
<love-pingoo>
cyclicity test ?
<haelix>
(or to have an external representation, such as ( int *int ) list
<flux__>
love-pingoo, how about that problem :)
<flux__>
but that wasn't what you were after, I suppose
<love-pingoo>
I was after nothing, just realized that after reading a random post on SML...
<love-pingoo>
flux__: give me your mutable graph type and I'll try that
* love-pingoo
feels like hacking a little bit
<flux__>
type 'a t = { value : 'a; mutable conns : 'a t list }
revision17 has quit [Read error: 110 (Connection timed out)]
kral has joined #ocaml
_fab has joined #ocaml
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
<love-pingoo>
flux__: in the end I still think that it's possible to create arbitrary graphs, but not in a dynamic way
<love-pingoo>
I can define one by hand, but not convert from your immutable structure
yondalf has joined #ocaml
<love-pingoo>
problem is that I need a side-effect using the being-defined value in the let-rec (to mark seen vertices) and that's forbidden
<flux__>
I suppose one could write a c-module to do that
<flux__>
hmm
<flux__>
I wonder..
<flux__>
would this be legal? type 'a t' = { value' : 'a; conns : 'a t' list } let constify (t : t) = (Obj.magic t : t')
jajs has quit [Remote closed the connection]
<love-pingoo>
caml may be forbidding any non-constructor thing using the begin-rec-defined values, so C functions might be impossible too
<love-pingoo>
flux__: I wouldn't bet on that :D
<flux__>
atleast it works on my simple graph :-)
<flux__>
ah
<flux__>
it actually wouldn't 'really' work
<flux__>
because the underlying values might change
<flux__>
even if you can't change them
<flux__>
the original graph could be still changed
<flux__>
sort of like c++ const :)
<flux__>
(const reference)
trrkkkkkk has joined #ocaml
shawn__ has quit ["This computer has gone to sleep"]
shawn__ has joined #ocaml
trrkkkkk has quit [Read error: 148 (No route to host)]
yondalf has quit ["leaving"]
ramkrsna has joined #ocaml
piggybox has joined #ocaml
falconair has joined #ocaml
khaladan_ has joined #ocaml
<flux__>
hmm.. the Format-module doesn't appear to provide any alignment operations?
<flux__>
like if I have a (string * string) list and I wanted to output it neatly so that the first and second string are always beneath the previous one, the Format-module won't help me do that?
khaladan has quit [Read error: 145 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
gene9 has joined #ocaml
khaladan has joined #ocaml
gene9 has quit ["leaving"]
khaladan_ has quit [Read error: 145 (Connection timed out)]
pango is now known as pangoafk
_fab has quit []
Smerdyakov has joined #ocaml
Ugarte has quit [Read error: 104 (Connection reset by peer)]
Leonidas has joined #ocaml
gunark has quit [Nick collision from services.]
roughest has quit [Read error: 104 (Connection reset by peer)]
Roughest has joined #ocaml
postalchris has joined #ocaml
gunark has joined #ocaml
trrkkkkk has joined #ocaml
kral has quit [Remote closed the connection]
trrkkkkkk has quit [Read error: 113 (No route to host)]
holdenk has joined #ocaml
<holdenk>
hello
<holdenk>
Are there any good examples of how to do DB work in/with Ocaml?
<love-pingoo>
there used to be a jeremy around, who worked on that
<love-pingoo>
unfortunately, he disappeared
<buluc1>
there are libraries, e.g. for postgresql
<holdenk>
buluc1: I was looking at perhaps using the mysql module or the dbi module from mod_caml , but I was wondering if there were any example programs that used them [I'm extremely new]
swater has joined #ocaml
<gunark>
argh
<gunark>
is anyone using the fft bindings?
<gunark>
why am i getting "The external function `fftw_import_wisdom_iter' is not available" :(
trrkkkkkk has joined #ocaml
falconair has quit [Client Quit]
Demitar__ has quit [zelazny.freenode.net irc.freenode.net]
Demitar__ has joined #ocaml
<gunark>
do i need to do anything special when i'm loading a library with native bindings into a toplevel session?
Smerdyakov has quit [zelazny.freenode.net irc.freenode.net]
love-pingoo has quit [zelazny.freenode.net irc.freenode.net]
mellum has quit [zelazny.freenode.net irc.freenode.net]
lde has quit [zelazny.freenode.net irc.freenode.net]
zamez has quit [zelazny.freenode.net irc.freenode.net]
fremo has quit [zelazny.freenode.net irc.freenode.net]
l_a_m has quit [zelazny.freenode.net irc.freenode.net]
Hadaka has quit [zelazny.freenode.net irc.freenode.net]
swater has quit [zelazny.freenode.net irc.freenode.net]
slipstream has quit [zelazny.freenode.net irc.freenode.net]
_velco has quit [zelazny.freenode.net irc.freenode.net]
pinupgeek has quit [zelazny.freenode.net irc.freenode.net]
Snark_ has quit [zelazny.freenode.net irc.freenode.net]
seafood_ has quit [zelazny.freenode.net irc.freenode.net]
tsuyoshi has quit [zelazny.freenode.net irc.freenode.net]
ozzloy has quit [zelazny.freenode.net irc.freenode.net]
gim has quit [zelazny.freenode.net irc.freenode.net]
Amorphous has quit [zelazny.freenode.net irc.freenode.net]
Shimei has quit [zelazny.freenode.net irc.freenode.net]
Smerdyakov has joined #ocaml
love-pingoo has joined #ocaml
mellum has joined #ocaml
lde has joined #ocaml
zamez has joined #ocaml
l_a_m has joined #ocaml
fremo has joined #ocaml
Hadaka has joined #ocaml
trrkkkkkk has quit [zelazny.freenode.net irc.freenode.net]
trrkkkkk has quit [zelazny.freenode.net irc.freenode.net]
postalchris has quit [zelazny.freenode.net irc.freenode.net]
khaladan has quit [zelazny.freenode.net irc.freenode.net]
ramkrsna has quit [zelazny.freenode.net irc.freenode.net]
cmeme has quit [zelazny.freenode.net irc.freenode.net]
holdenk has quit [zelazny.freenode.net irc.freenode.net]
pattern has quit [zelazny.freenode.net irc.freenode.net]
mattam has quit [zelazny.freenode.net irc.freenode.net]
TaXules has quit [zelazny.freenode.net irc.freenode.net]
swater has joined #ocaml
slipstream has joined #ocaml
pinupgeek has joined #ocaml
_velco has joined #ocaml
Snark_ has joined #ocaml
tsuyoshi has joined #ocaml
seafood_ has joined #ocaml
ozzloy has joined #ocaml
gim has joined #ocaml
Amorphous has joined #ocaml
Shimei has joined #ocaml
ulfdoz has quit [zelazny.freenode.net irc.freenode.net]
gunark has quit [zelazny.freenode.net irc.freenode.net]
Roughest has quit [zelazny.freenode.net irc.freenode.net]
Leonidas has quit [zelazny.freenode.net irc.freenode.net]
shawn__ has quit [zelazny.freenode.net irc.freenode.net]
velco has quit [zelazny.freenode.net irc.freenode.net]
ikaros has quit [zelazny.freenode.net irc.freenode.net]
pingu has quit [zelazny.freenode.net irc.freenode.net]
bzzbzz has quit [zelazny.freenode.net irc.freenode.net]
haelix has quit [zelazny.freenode.net irc.freenode.net]
bebui has quit [zelazny.freenode.net irc.freenode.net]
zmdkrbou has quit [zelazny.freenode.net irc.freenode.net]
Norgg has quit [zelazny.freenode.net irc.freenode.net]
trrkkkkkk has joined #ocaml
holdenk has joined #ocaml
trrkkkkk has joined #ocaml
postalchris has joined #ocaml
khaladan has joined #ocaml
ramkrsna has joined #ocaml
cmeme has joined #ocaml
pattern has joined #ocaml
TaXules has joined #ocaml
mattam has joined #ocaml
gunark has joined #ocaml
Roughest has joined #ocaml
Leonidas has joined #ocaml
shawn__ has joined #ocaml
velco has joined #ocaml
ikaros has joined #ocaml
pingu has joined #ocaml
bzzbzz has joined #ocaml
ulfdoz has joined #ocaml
haelix has joined #ocaml
Norgg has joined #ocaml
zmdkrbou has joined #ocaml
bebui has joined #ocaml
buluc1 has quit [zelazny.freenode.net irc.freenode.net]
flux__ has quit [zelazny.freenode.net irc.freenode.net]
Foxyloxy has quit [zelazny.freenode.net irc.freenode.net]
buluc1 has joined #ocaml
flux__ has joined #ocaml
Foxyloxy has joined #ocaml
trrkkkkk has quit [Connection timed out]
<love-pingoo>
blam
postalchris has quit [Remote closed the connection]
<gunark>
ok yeah so the code compiles fine
<gunark>
but when i try to run it in toplevel i get
<gunark>
The external function `fftw_import_wisdom_iter' is not available
<mellum>
maybe you are not wise enough?
<gunark>
har har
<gunark>
... probably true though :(
trrkkkkk has joined #ocaml
love-pingoo has quit ["Leaving"]
trrkkkkkk has quit [Read error: 148 (No route to host)]
trrkkkkkk has joined #ocaml
Ugarte has joined #ocaml
bluestorm has joined #ocaml
trrkkkkk has quit [Read error: 145 (Connection timed out)]
trrkkkk has joined #ocaml
velco has quit ["Ex-Chat"]
ikaros has quit ["Leaving"]
trrkkkkk has joined #ocaml
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
ikaros has joined #ocaml
trrkkkkkk has joined #ocaml
<gunark>
what's Array1?
<gunark>
or rather, where is it documented?
<gunark>
oh nvm found it
<flux__>
gunark, maybe you want to build your own toplevel with ocamlmktop?
trrkkkk has quit [Read error: 113 (No route to host)]
<gunark>
yup just did that...
<gunark>
ok another question.... how do I create a bigarray of signed 16-bit ints?
<gunark>
Array1.create int16_signed_elt c_layout n
<gunark>
unbound value int16_signed_elt
<gunark>
same if i do Bigarray.int16_signed_elt, Array1.int16_signed_elt
<gunark>
etc.
<gunark>
eh... int16_signed, apparently... no _elt
<bluestorm>
hm
_velco has quit ["I'm outta here ..."]
trrkkkkk has quit [Read error: 113 (No route to host)]
kwak_ has joined #ocaml
trrkkkkkk has quit [Read error: 113 (No route to host)]
gim_ has quit [Read error: 60 (Operation timed out)]
gim_ has joined #ocaml
gim__ has quit [Read error: 54 (Connection reset by peer)]
khaladan_ has joined #ocaml
jajs has joined #ocaml
gim_ has quit [Read error: 60 (Operation timed out)]
khaladan has quit [Read error: 145 (Connection timed out)]
mpc has quit [Read error: 110 (Connection timed out)]
trrkkkkk has joined #ocaml
mpc has joined #ocaml
trrkkkkkk has joined #ocaml
trrkkkk has quit [Read error: 113 (No route to host)]
trrkkkk has joined #ocaml
trrkkkkk has quit [Read error: 145 (Connection timed out)]
Skal has quit [Read error: 54 (Connection reset by peer)]
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
rillig has joined #ocaml
trrkkkkk has joined #ocaml
trrkkkk has quit [Read error: 113 (No route to host)]
swater has quit ["Quat"]
swater has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
joshcryer has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
buluc1 is now known as buluca
pangoafk has quit ["Leaving"]
pango has joined #ocaml
pinupgeek has left #ocaml []
trrkkkkkk has joined #ocaml
mpc has quit [Read error: 110 (Connection timed out)]
trrkkkkk has quit [Read error: 113 (No route to host)]
trrkkkkk has joined #ocaml
trrkkkk has joined #ocaml
jajs has quit [Remote closed the connection]
trrkkkkkk has quit [Read error: 113 (No route to host)]
mpc has joined #ocaml
_JusSx_ has quit [Read error: 113 (No route to host)]
joshcryer has quit [Read error: 104 (Connection reset by peer)]
smimou has quit ["bli"]
kwak__ has joined #ocaml
trrkkkkk has quit [Read error: 113 (No route to host)]
kwak_ has quit [Read error: 145 (Connection timed out)]
trrkkkkk has joined #ocaml
joshcryer has joined #ocaml
kwak__ has quit []
trrkkkkkk has joined #ocaml
swater_ has joined #ocaml
jajs has joined #ocaml
trrkkkk has quit [Read error: 110 (Connection timed out)]
bluestorm has quit ["Konversation terminated!"]
trrkkkkk has quit [Read error: 110 (Connection timed out)]
swater has quit [Read error: 60 (Operation timed out)]
trrkkkkk has joined #ocaml
trrkkkk has joined #ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
trrkkkkkk has quit [Read error: 110 (Connection timed out)]
DRMacIver has joined #ocaml
Foxyloxy has quit [Connection timed out]
<DRMacIver>
Hi. I'm being an idiot, and am hoping for some rescue. :) I'm trying to define the function f : 'a list -> 'a list list -> 'a list list given by taking all pairs (x, y) where x is in the first argument and y is in the second, forming x::y from this and returning the list of all such values.
<DRMacIver>
But this needs to run fast and on large lists, so I'm trying to make it tail recursive.
<DRMacIver>
And I'm somehow having a total failure of brain in doing so.
<DRMacIver>
(The order of the output does not matter)
trrkkkkk has quit [Read error: 110 (Connection timed out)]
<ulfdoz>
Do you mean a cross product?
<DRMacIver>
I don't think so...
<DRMacIver>
The first argument is an 'a list. The second is an 'a list list. The output should be an 'a list list where each element is an element of the second argument with an element of the first consed onto the front.
<DRMacIver>
(And all such elements are contained within the list exactly once)
<DRMacIver>
This hsould be easy, but I'm being dim. :)
<ulfdoz>
For haskell I'd say, zip/zipWith. ;)
trrkkkkk has joined #ocaml
<DRMacIver>
Yeah, but my end result is going to involve messing around with hash tables in complicated ways, so I don't want to use haskell. :)
<DRMacIver>
Also the key point is tail recursive. zip implementations tend not to be.
<DRMacIver>
Anyway, I think I've got it now...
trrkkkk has quit [Read error: 145 (Connection timed out)]
swater_ has quit ["Quat"]
<DRMacIver>
Phew. Got it.
<DRMacIver>
As usual it's easy as hell once you see it. :)
<DRMacIver>
He says, only to find his code gives the wrong answer. Balls.