gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
struktured has joined #ocaml
sebz has joined #ocaml
joewilliams_away is now known as joewilliams
Skolem_ has joined #ocaml
Skolem has quit [Ping timeout: 248 seconds]
Skolem_ is now known as Skolem
mbac has quit [Ping timeout: 252 seconds]
emmanuelux has quit [Ping timeout: 244 seconds]
NaCl has quit [Remote host closed the connection]
mbac has joined #ocaml
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
shachaf has quit [Remote host closed the connection]
Boscop has quit [Ping timeout: 256 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
Modius has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
alkoma has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
mbac has quit [Ping timeout: 255 seconds]
mbac has joined #ocaml
joewilliams is now known as joewilliams_away
joewilliams_away is now known as joewilliams
sebz has quit [Quit: Computer has gone to sleep.]
sebz_ has joined #ocaml
alkoma has joined #ocaml
struktured has quit [Ping timeout: 252 seconds]
sebz_ has quit [*.net *.split]
Amorphous has quit [*.net *.split]
Tianon has quit [*.net *.split]
noj has quit [*.net *.split]
dcolish has quit [*.net *.split]
Lor has quit [*.net *.split]
fabjan has quit [*.net *.split]
sgnb has quit [*.net *.split]
Tobu has quit [*.net *.split]
jlouis has quit [*.net *.split]
rossberg has quit [*.net *.split]
mbac has quit [*.net *.split]
jonafan has quit [*.net *.split]
mattam has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
schme has quit [*.net *.split]
Modius has quit [*.net *.split]
junsuijin has quit [*.net *.split]
f[x] has quit [*.net *.split]
wagle_ has quit [*.net *.split]
_habnabit has quit [*.net *.split]
raphael-p has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
brendan has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
malouin has quit [*.net *.split]
rby has quit [*.net *.split]
haelix has quit [*.net *.split]
wormphlegm has quit [*.net *.split]
bacam has quit [*.net *.split]
nimred has quit [*.net *.split]
TaXules has quit [*.net *.split]
zmoazeni has quit [*.net *.split]
ohwow has quit [*.net *.split]
deavid has quit [*.net *.split]
rwmjones has quit [*.net *.split]
caligula has quit [*.net *.split]
diml has quit [*.net *.split]
svenl has quit [*.net *.split]
bitbckt has quit [Ping timeout: 248 seconds]
sebz_ has joined #ocaml
mbac has joined #ocaml
Modius has joined #ocaml
Amorphous has joined #ocaml
Tianon has joined #ocaml
junsuijin has joined #ocaml
rossberg has joined #ocaml
jlouis has joined #ocaml
Tobu has joined #ocaml
sgnb has joined #ocaml
fabjan has joined #ocaml
Lor has joined #ocaml
dcolish has joined #ocaml
noj has joined #ocaml
jonafan has joined #ocaml
caligula has joined #ocaml
wormphlegm has joined #ocaml
mattam has joined #ocaml
ohwow has joined #ocaml
f[x] has joined #ocaml
wagle_ has joined #ocaml
snarkyboojum has joined #ocaml
schme has joined #ocaml
zmoazeni has joined #ocaml
bacam has joined #ocaml
nimred has joined #ocaml
TaXules has joined #ocaml
deavid has joined #ocaml
rwmjones has joined #ocaml
_habnabit has joined #ocaml
haelix has joined #ocaml
rby has joined #ocaml
malouin has joined #ocaml
Pepe_ has joined #ocaml
brendan has joined #ocaml
Asmadeus has joined #ocaml
raphael-p has joined #ocaml
svenl has joined #ocaml
diml has joined #ocaml
mbac_ has joined #ocaml
bitbckt has joined #ocaml
mbac has quit [Ping timeout: 276 seconds]
bitbckt has quit [Changing host]
bitbckt has joined #ocaml
joewilliams is now known as joewilliams_away
everyonemines has joined #ocaml
ulfdoz has joined #ocaml
struktured has joined #ocaml
sebz_ has quit []
alang has joined #ocaml
bobry has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
dnolen has joined #ocaml
sebz has joined #ocaml
dnolen has quit [Quit: dnolen]
ulfdoz has quit [Read error: Operation timed out]
zorun has joined #ocaml
bobry has quit [Ping timeout: 258 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
thomasga has joined #ocaml
rixed has quit [Ping timeout: 252 seconds]
wagle_ has quit [Read error: Connection reset by peer]
junsuijin has quit [Quit: Leaving.]
wagle has joined #ocaml
edwin has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
thomasga has quit [Quit: Leaving.]
alkoma has quit [Remote host closed the connection]
sebz has quit [Quit: Computer has gone to sleep.]
sebz_ has joined #ocaml
ankit9 has joined #ocaml
avsm has joined #ocaml
thomasga has joined #ocaml
Cyanure has joined #ocaml
ikaros has joined #ocaml
pheredhel has quit [Ping timeout: 252 seconds]
orbitz has quit [Ping timeout: 260 seconds]
ski has quit [Ping timeout: 260 seconds]
mundkur has quit [Ping timeout: 252 seconds]
hyperboreean has quit [Ping timeout: 260 seconds]
ousado_ has joined #ocaml
The_third_man has quit [Ping timeout: 260 seconds]
ousado has quit [Ping timeout: 260 seconds]
ski has joined #ocaml
struktured has quit [*.net *.split]
Amorphous has quit [*.net *.split]
Tianon has quit [*.net *.split]
noj has quit [*.net *.split]
dcolish has quit [*.net *.split]
Lor has quit [*.net *.split]
fabjan has quit [*.net *.split]
sgnb has quit [*.net *.split]
Tobu has quit [*.net *.split]
jlouis has quit [*.net *.split]
rossberg has quit [*.net *.split]
ankit9 has quit [*.net *.split]
zorun has quit [*.net *.split]
jonafan has quit [*.net *.split]
mattam has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
schme has quit [*.net *.split]
Cyanure has quit [*.net *.split]
sebz_ has quit [*.net *.split]
wagle has quit [*.net *.split]
bitbckt has quit [*.net *.split]
Modius has quit [*.net *.split]
f[x] has quit [*.net *.split]
_habnabit has quit [*.net *.split]
raphael-p has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
brendan has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
malouin has quit [*.net *.split]
rby has quit [*.net *.split]
haelix has quit [*.net *.split]
wormphlegm has quit [*.net *.split]
bacam has quit [*.net *.split]
nimred has quit [*.net *.split]
TaXules has quit [*.net *.split]
zmoazeni has quit [*.net *.split]
ohwow has quit [*.net *.split]
edwin has quit [*.net *.split]
deavid has quit [*.net *.split]
rwmjones has quit [*.net *.split]
ikaros has quit [*.net *.split]
caligula has quit [*.net *.split]
diml has quit [*.net *.split]
svenl has quit [*.net *.split]
hnrgrgr has quit [*.net *.split]
thomasga has quit [*.net *.split]
alang has quit [*.net *.split]
mbac_ has quit [*.net *.split]
asmanur_ has quit [*.net *.split]
chambart has quit [*.net *.split]
olasd has quit [*.net *.split]
mehdid has quit [*.net *.split]
gildor has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
flux has quit [*.net *.split]
adrien has quit [*.net *.split]
taupin has quit [*.net *.split]
alpounet has quit [*.net *.split]
yroeht has quit [*.net *.split]
foocraft has quit [*.net *.split]
explodus has quit [*.net *.split]
patronus_ has quit [*.net *.split]
zzz_ has quit [*.net *.split]
vram0 has quit [*.net *.split]
mejalx has quit [*.net *.split]
wishi has quit [*.net *.split]
emias has quit [*.net *.split]
hto has quit [*.net *.split]
djanatyn has quit [*.net *.split]
ttblrs has quit [*.net *.split]
metasyntax|work has quit [*.net *.split]
mcclurmc has quit [*.net *.split]
thelema has quit [*.net *.split]
wtetzner has quit [*.net *.split]
joewilliams_away has quit [*.net *.split]
Reaganomicon has quit [*.net *.split]
Skolem has quit [Quit: Skolem]
rixed has joined #ocaml
hyperboreean has joined #ocaml
shachaf has joined #ocaml
The_third_bug has joined #ocaml
orbitz_ has joined #ocaml
mundkur_ has joined #ocaml
pheredhel` has joined #ocaml
eikke has joined #ocaml
ikaros has joined #ocaml
Cyanure has joined #ocaml
thomasga has joined #ocaml
ankit9 has joined #ocaml
sebz_ has joined #ocaml
edwin has joined #ocaml
wagle has joined #ocaml
zorun has joined #ocaml
alang has joined #ocaml
struktured has joined #ocaml
mbac_ has joined #ocaml
asmanur_ has joined #ocaml
chambart has joined #ocaml
olasd has joined #ocaml
mehdid has joined #ocaml
gildor has joined #ocaml
hnrgrgr has joined #ocaml
bitbckt has joined #ocaml
Modius has joined #ocaml
Amorphous has joined #ocaml
Tianon has joined #ocaml
rossberg has joined #ocaml
jlouis has joined #ocaml
Tobu has joined #ocaml
sgnb has joined #ocaml
fabjan has joined #ocaml
Lor has joined #ocaml
dcolish has joined #ocaml
noj has joined #ocaml
jonafan has joined #ocaml
caligula has joined #ocaml
wormphlegm has joined #ocaml
mattam has joined #ocaml
ohwow has joined #ocaml
f[x] has joined #ocaml
snarkyboojum has joined #ocaml
schme has joined #ocaml
zmoazeni has joined #ocaml
bacam has joined #ocaml
nimred has joined #ocaml
TaXules has joined #ocaml
deavid has joined #ocaml
rwmjones has joined #ocaml
_habnabit has joined #ocaml
haelix has joined #ocaml
rby has joined #ocaml
malouin has joined #ocaml
Pepe_ has joined #ocaml
brendan has joined #ocaml
Asmadeus has joined #ocaml
raphael-p has joined #ocaml
svenl has joined #ocaml
diml has joined #ocaml
fraggle_ has joined #ocaml
flux has joined #ocaml
adrien has joined #ocaml
taupin has joined #ocaml
alpounet has joined #ocaml
yroeht has joined #ocaml
foocraft has joined #ocaml
explodus has joined #ocaml
patronus_ has joined #ocaml
zzz_ has joined #ocaml
vram0 has joined #ocaml
mejalx has joined #ocaml
wishi has joined #ocaml
emias has joined #ocaml
djanatyn has joined #ocaml
ttblrs has joined #ocaml
metasyntax|work has joined #ocaml
mcclurmc has joined #ocaml
thelema has joined #ocaml
wtetzner has joined #ocaml
joewilliams_away has joined #ocaml
Reaganomicon has joined #ocaml
larhat has joined #ocaml
hto has joined #ocaml
hyperboreean is now known as Guest6083
<f[x]> thelema, thanks, fixed
<f[x]> next ENOSPC scheduled in a half a year ;)
everyonemines has left #ocaml []
sebz_ has quit [Quit: Computer has gone to sleep.]
Guest6083 has quit [Quit: leaving]
hyperbor1ean has joined #ocaml
ttamttam has joined #ocaml
sebz has joined #ocaml
emmanuelux has joined #ocaml
hyperbor1ean is now known as hyperboreean
avsm has quit [Quit: Leaving.]
ztfw has joined #ocaml
avsm has joined #ocaml
Boscop has joined #ocaml
lopex has joined #ocaml
_andre has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
bitbckt has quit [Quit: out]
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
funtkronic has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
thomasga has quit [Ping timeout: 260 seconds]
hcarty has joined #ocaml
everyonemines has joined #ocaml
<everyonemines> Hey guys, I was looking at the stdlib and...
<everyonemines> max and min are implemented with if statements! Aren't there hardware instructions for those? That's not ok.
<everyonemines> Fast max and min are important for fast code.
<flux> I imagine it depends a lot whether your code in fact uses such operations ;-)
<flux> (I imagine compilers make very little use of them)
<everyonemines> They are VERY IMPORTANT
<adrien> SSE4 has PMAXSD or PMAXUD for 32 bit signed/unsigned integers, which might be useful.
<everyonemines> faster sorts are possible
<everyonemines> for example
<adrien> if you need this kind of optimization, use C or ASM
<flux> faster sorts of integer arrays perhaps, but how about in general case? I doubt that..
<everyonemines> I don't need it now personally, but it's not OK from a compiler standpoint.
<adrien> I guess they would have to be builtins
<everyonemines> adrien: Isn't the goal for ocaml to be as fast as C? Shouldn't we take easy ways of getting performance then?
<adrien> no, it isn't
<flux> I think it's very realistic to add support for such things, though
<thelema> everyonemines: We could add 100K builtins for every instruction of every CPU and fallback code for if the instruction isn't available
<flux> (not sure if INRIA would be willing to integrate such patches though)
<thelema> It would be difficult and error-prone, but possible.
<everyonemines> This is a basic operation supported by multiple processors natively.
<adrien> apparently, not
<adrien> if it took SSE4 to get it...
<thelema> And then we might get much higher marks on various microbenchmarks, but for real code, it'd probably be less than a 1% improvement
<everyonemines> Depends on the code.
<everyonemines> For array sorting it could be significant.
<thelema> everyonemines: of course. microbenchmarks
<flux> I can easily see some image manipulation code would be limited by bounding operations
<everyonemines> Yeah, graphics too.
<flux> I mean, sum pixels, limit to range 0..255
<adrien> ah, I knew I was being stupid
<adrien> everyonemines: there's a way to get faster int comparisons
<thelema> flux: array bounds checks are optimized in high-end processors
<everyonemines> adrien: ... ?
<adrien> make sure that ocaml isn't using generic comparisons but int-specific ones
<adrien> with int-specific:
<flux> thelema, not array check, but simple: pixel <- min 255 (max 0 (pixel_a + pixel_b))
<adrien> cmpq%rbx, %rax
<adrien> jg.L100
<adrien> ret
<adrien> die tabs, die
<everyonemines> Isn't the "if" more expensive than the compare?
<flux> adrien, linux-tip: xclip -o | expand | xclip -i :)
<flux> ifs are bad, but I imagine CPUs would detect those cases?
<adrien> without, it's too long for me to paste in the channel
<everyonemines> flux: Empirically, it matters.
<flux> in any case, the stackoverflow question has microbenchmarks, no?
<adrien> and it involves a C function call
<adrien> flux: :s/\t/ /g :P
<flux> and it gives 100% speedup
<adrien> everyonemines: on x86, branching (if) is fine; on ARM, not really afaik
thomasga has joined #ocaml
<everyonemines> adrien: Nope, still a lot slower than native max/min.
<everyonemines> Or compares.
<flux> everyonemines, so 100% speedup if you do 100% min/max.. but likely your code does something else as well..
<adrien> afaiu, there is no "native max/min"
Modius has quit [Read error: Connection reset by peer]
<everyonemines> no that's different actually
<thelema> batteries has Int.min/max
<adrien> everyonemines: but if you make sure the version used is not polymorphic, you already get a big speedup
<adrien> start there
<everyonemines> I wonder if you get speedup with pattern matching.
<adrien> hevea can be really annoying
<everyonemines> Instead of using if statements.
<adrien> pattern matching is slower iirc
<everyonemines> How do you tell when it's slower or faster?
<everyonemines> I'm pretty sure it's faster in some cases...
<adrien> testing, reading the assembly
<ousado> it will translate to a jump table if possible, no?
<everyonemines> I mean, when do you expect it to be faster?
<adrien> last time I tried, "compare" was slower to make when using match ... with and I don't think min or max would be faster (prove me wrong; I don't see how to code it)
<everyonemines> How about http://pastebin.com/zktUuvWW
munga has joined #ocaml
<everyonemines> Or am I writing the match in a slow way?
<thelema> everyonemines: not so good, I expect, as you'll end up doing two comparisons
<thelema> L7 is better
<thelema> except for the "then x"
<thelema> oh, clip. n/m
<adrien> slowest way I think :P
<ousado> ocaml enforces sequential evaluation of pattern matches, right?
<thelema> ousado: the semantics are that. It can optimize in any equivalent way
<ousado> yes
<adrien> t(min) : 4.171226
<adrien> t(clip) : 6.273421
<adrien> t(clip_int) : 0.753052
sebz has joined #ocaml
<adrien> with only "0" as arguments always
<adrien> let clip x a b = match (x>a, x<b) with
<adrien> let clip_int x (a : int) (b : int) = match (x>a, x<b) with
<adrien> so, what about specifying these ": int" ? :P
<flux> adrien, sufficient to specify 'x' as int :)
<adrien> heh, right ;-)
<adrien> btw:
<adrien> t(min) : 4.274784
<adrien> t(min_int) : 0.188068
<everyonemines> So if you add type annotations, the comparison goes faster?
<thelema> everyonemines: yes
rixed has quit [Ping timeout: 240 seconds]
<adrien> and I think that profiling the code shows what's happening:
<adrien> t(min) : 15.584658
<adrien> t(min_int) : 0.188475
<adrien> also, from the profiling: 33.80 3.90 3.90 300000005 0.00 0.00 compare_val
<adrien> so, a third of the time is used in the polymorphic comparison function
<everyonemines> I compiled my 2 clip versions, results:
<everyonemines> version 1 0m2.886s
<everyonemines> version 2 0m2.795s
<everyonemines> if statements win!
<everyonemines> ....in this case, but probably not always
<everyonemines> OK, I re-ordered the pattern matching and now it's 0m2.794s
<everyonemines> PATTERN MATCHING WINS
<thelema> probably within statistical error
<adrien> and cpu frequency switch and power saving effects
<everyonemines> Nope, it's repeatable.
<everyonemines> The actual difference is a bit larger with repeated trials, I was just amused by the .001s difference.
avsm has quit [Quit: Leaving.]
kizzx2 has joined #ocaml
<kizzx2> any OcalIDE users around?
<kizzx2> it may sound really silly :P but how do you invoke "ocamlbuild" from OcalIDE?
<everyonemines> I tried let clip2 (x:int) (a:int) (b:int) = if x>a then (if x<b then x else b) else a;;
<everyonemines> but it's the same speed.
<everyonemines> Am I doing it wrong?
<everyonemines> You're not using the actual min_int function right?
<everyonemines> or value rather, the default min_int
<adrien> kizzx2: can you make a Makefile and invoke it from ocalide,
<adrien> ?
bitbckt has joined #ocaml
<everyonemines> OK, nevermind, I compiled to a different location. The type annotations make it much faster.
<adrien> =)
<everyonemines> Thanks for that tip, by the way.
<edwin> everyonemines: let clip2 (x:int) (a:int) (b:int) = if (x > a && x < b) then x else if x < a then a else b;
<adrien> :-)
<edwin> would that help? to have just one branch for most common
<everyonemines> edwin: Nope, it's 1.66 instead of 1.28
<everyonemines> er, off by 10x but you get the idea
<edwin> does ocamlopt short-circuit?
<thelema> edwin: yes
<everyonemines> Beats me.
<edwin> ah it'd be better if it didn't in this case
<everyonemines> You shouldn't assume the answer is usually X.
<thelema> edwin: why?
<everyonemines> It might usually clip.
<edwin> btw doesn't sse3 or sse4 have some clip builtins?
<edwin> but the overhead of a function-call to a C stub would probably hurt
<hcarty> kizzx2: I haven't used it in a long time, but I think the simplest approach is to create a project with OcaIDE's ocamlbuild support and then compile however Eclipse does its compilation
<adrien> let clip3_int (x:int) (a:int) (b:int) = if x<=a then a else (if x<b then x else b)
<adrien> is much faster for me btw
<adrien> (I swapped the two branches)
<adrien> hmmm; I don't know why I tried that actually... but it's faster... but I have no idea what I had in mind when I tried it
<thelema> everyone: how are you testing?
<everyonemines> I'm using time on a big for loop.
<everyonemines> Compiling with ocamlopt.
<edwin> but what are your clip limits? is it really 0 and 255 always?
<everyonemines> clip2 i 500 5000
<everyonemines> adrien: I got the same speed.
<everyonemines> You're probably using different clip inputs, I tried to balance them.
<adrien> and clip2 gets as fast as my clip3 when I use -inline 1000; and clip_int (first try) gets twice as fast with -inline 1000
<adrien> I'm using 0 0 0
<adrien> anyway, I'm done playing; I'm going to hit hevea on the head
<adrien> or simply give up
<everyonemines> So the lesson I learned is, polymorphic functions are slow.
<hcarty> everyonemines: Some are slow relative to optimized type-specific versions
<hcarty> everyonemines: Polymorphic comparison is one example
ohwow has left #ocaml []
<everyonemines> I noticed that type annotations didn't help with max and min, unlike >
<adrien> it's easy to see how int comparison can be much faster ;-)
<thelema> everyonemines: that's because of the bug you pulled up on mantis
<everyonemines> Still not as fast as native max/min :-
<thelema> everyonemines: for a microbenchmark, yes
<everyonemines> But I was looking at the (actually problematically slow) polymorphic compare.
`fogus has joined #ocaml
<hcarty> everyonemines: I don't know how well it's advertised in general, but there are a fairly large number of blog posts, mailing list posts and other sources talking about optimizing inner loops in OCaml by eliminating polymorphic comparison
<everyonemines> The issue isn't > itself, it's calls to polymorphic functions.
<everyonemines> If the type is known, it's faster.
<hcarty> Is that true for every function?
<hcarty> Every polymorphic function that is
<everyonemines> I'm guessing....most of them.
<hcarty> I doubt List.map suffers terribly. But <, >, =, compare, etc. all dig into the dirty underbelly of OCaml to do what they do
emmanuelux has quit [Ping timeout: 244 seconds]
<hcarty> Polymorphic comparison is slow in part because it dives into the underlying structure of values. Most other functions involving polymorphism don't need to do that.
<everyonemines> On a related note, I think I could write a faster array sort function than the stdlib has.
<everyonemines> Would that be worthwhile?
<thelema> everyonemines: sure, if it benchmarks well, we can put it into batteries
<thelema> hcarty: not true for most functions. Compare is special because the compiler will insert specialized code for a few types.
<thelema> hcarty: the builtin polymorphics, compare and (=), are improved by knowing types
<thelema> I can't think of anything else
<everyonemines> So if you want to sort arrays faster, use let cmp (x:int) (y:int) = compare x y;;
<everyonemines> ?
<thelema> arrays of ints. and I think batteries has a faster int.cmp than even specializing compare
<thelema> yes, it does
<hcarty> thelema: That's my understanding
<thelema> hcarty: anything else?
<thelema> hcarty: do you know of any other functions improved by type knowledge?
<everyonemines> external compare : int -> int -> int = "caml_int_compare"
<everyonemines> Interesting.
<hcarty> thelema: No - I had thought min and max might be, but maybe not.
<hcarty> thelema: There aren't many more grossly polymorphic functions in OCaml
<thelema> hcarty: nope, min and max are plain ocaml functions, no special optimization
<everyonemines> Yeah, seeing that was what got me started.
<hcarty> I guess you could write type-specialized min and max functions using type-specific compare
<everyonemines> Polymorphism isn't really ocaml's strength...actually, I think Core does that?
<hcarty> I don't think Batteries has anything like that yet.
<hcarty> Core may
<hcarty> everyonemines: Polymorphism as it exists in polymorphic comparison goes against how most of OCaml works
<everyonemines> Yeah, but in theory you can transfer type knowledge downward and specialize.
<hcarty> OCaml doesn't do that. MLton does for SML.
<thelema> everyonemines: the specialization of comparison operators is the only way that types affect codegen
<hcarty> Or, OCaml doesn't do that in general.
<hcarty> thelema: Right
<everyonemines> Yeah. I know, whole program compilation, makes compilation slower.
<hcarty> It also makes the compiler more complex and makes performance less predictable
fraggle_ has quit [Quit: -ENOBRAIN]
<hcarty> Not that I would complain if functors suddenly became performance-hit-free in OCaml :-)
<everyonemines> What do you use for btrees, then?
<everyonemines> I guess there's probably something in batteries.
<hcarty> There are btree implementations on github if not in Batteries.
<everyonemines> If you pass map.make a specialized compare it should be decent though, right?
<thelema> avltree is in batteries, but I find that if I'm not using the tree as a map or set, I need to write my own tree anyway
<thelema> everyonemines: yes
<hcarty> thelema: On the topic of premature optimization - I was going to grumble about always requiring threading IO-overhead in Batteries before the recent module split you made for 2.0. Then I realized I've been using threaded Batteries almost exclusively without trouble.
<thelema> :)
<thelema> it's hard to notice, as IO is pretty expensive anyway
<thelema> it's optional now - if you compile with threads, the batteriesThread module will be ... hmm, maybe it doesn't quite work. I need to put the init into a .cmx
<thelema> I just realized that linking a .cm[x]a doesn't actually inject code at startup
<hcarty> thelema: It doesn't? I thought toplevel phrases were evaluated in the linked module(s).
<thelema> .cmx files, yes. .cmxa files don't automatically link in all .cmx files contained within
<hcarty> Ah, of course.
lopex has quit []
<kizzx2> adrien, hcarty: to answer my own question, OcalIDE (like its Java counterpart) builds continuously, i need to go to Project -> Properties and add the ocamlbuild targets there
<kizzx2> every other configuration can be typed in _tags
<adrien> working fine now?
<kizzx2> adrien: yeah :)
<adrien> =)
<kizzx2> i was looking at Project -> Build but the button was also grayed
<kizzx2> it turns out it would build continously once i have added the target
<kizzx2> s/was also/was always/
milosn has quit [Ping timeout: 255 seconds]
milosn has joined #ocaml
milosn has quit [Ping timeout: 256 seconds]
fraggle_ has joined #ocaml
ag4ve has joined #ocaml
eikke has quit [Read error: Operation timed out]
alang has quit [Ping timeout: 260 seconds]
everyonemines has left #ocaml []
<adrien> edwin: I have to go but this is the preliminary and incomplete new introduction to the new lablgtk-react: http://notk.org/~adrien/lablgtk-react-intro.pdf
<adrien> it's not complete but should be alright
<adrien> from "Actually, there is still one thing: the" to the end, it's TOD
<adrien> TODO
sebz has quit [Quit: Computer has gone to sleep.]
<adrien> (might have huge errors and issues currently)
lopex has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Ping timeout: 258 seconds]
arquebus has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Reaganomicon has quit [Remote host closed the connection]
alang has joined #ocaml
ztfw has quit [Read error: Operation timed out]
arquebus has quit [Quit: Page closed]
<edwin> adrien: thanks, will read it
<adrien> take all your and if something doesn't make sense, it's my fault
<adrien> also, it's kind of a guide to a first example that anything else
<adrien> =)
<edwin> module Set include Set is a bit confusing
<edwin> and then you instantiate another module from Set via react thats called Set again...
<adrien> ok, thought so, I'll change that
<adrien> (finding names is hard :P )
<adrien> I'll name one Zipper at least
<edwin> also on_action is part of the 2nd Set, right?
<adrien> yes
<adrien> the idea is that the first Set is independant of lablgtk-react (I have a completely independant Zipper that can be used for anything else)
<adrien> then you add a few values
<adrien> and use that in the functor
<adrien> thanks for the initial feedback, I have to go now
<edwin> k
ulfdoz has joined #ocaml
Anarchos has joined #ocaml
eikke has joined #ocaml
joewilliams_away is now known as joewilliams
larhat has quit [Quit: Leaving.]
ygrek has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
lpereira has joined #ocaml
eikke has quit [Ping timeout: 260 seconds]
munga has quit [Ping timeout: 258 seconds]
funtkronic has quit [Quit: Page closed]
preyalone has joined #ocaml
<preyalone> How can I tell if a string contains another string?
<preyalone> something to the effect of string_contains : string -> string -> bool
<mfp> preyalone: in batteries, String.exists haystack needle
<preyalone> mfp: Thanks!
<mfp> (BatString if you don't open Batteries, that is)
Reaganomicon has joined #ocaml
tac-tics has joined #ocaml
<tac-tics> Is it possible to compile ocaml down to ANSI C?
<tac-tics> rather than bytecode/machine code?
<_habnabit> well, you can make the bytecode compiler emit C
<tac-tics> cool
<tac-tics> I wanted to try and use Ocaml to simplify some of the complicated logic in an Android app I'm writing
<tac-tics> The app is written in C using the NDK which compiles C down to the proper assembly
<tac-tics> thanks :)
milosn has joined #ocaml
<_habnabit> eh? wouldn't scala or clojure be better for that?
<preyalone> Which module (regular OCaml, not Batteries) includes the regex functions?
<_habnabit> lagged.
<_habnabit> preyalone, Str
<preyalone> Error: Reference to undefined global `Str'
<_habnabit> okay?
<tac-tics> _habnabit: I don't know Scala or Clojure, but I know C, and I know enough Haskell to churn out the code i need in Ocaml
<preyalone> Ah, I had to add #load "str.cma" ;; to the beginning in order for OCaml to find Str.
<preyalone> Okay... ocaml can't find Str unless I add a #load directive, but ocamlc can't compile because it doesn't recognize the syntax. How do I compile a .ML file so that it can access the Str module?
<_habnabit> normally I use ocamlbuild for compilation so I don't have to muck around with invoking ocaml{c,opt} myself
<kizzx2> preyalone: man ocamlc
<_habnabit> way less tedious
<kizzx2> preyalone: if you want to use ocamlc, you need to explicitly type str.cma some where
<kizzx2> preyalone: for example something like `ocamlc (some other flags to tell where the libs are) str.cma my_program.cmo -o out`
<kizzx2> again i've switched to ocamlbuild so ive forgotten how to do it proper :P
<_habnabit> ocamlbuild is really the way to do it.
<kizzx2> hey guys, how can i specify that a functor accepts an argument that should implements multile signatures?
<kizzx2> example of what i mean: http://pastebin.com/NRqx8JsE
<preyalone> Mkay. http://caml.inria.fr/pub/docs/manual-ocaml/manual037.html details proper ocamlc options, but it's annoying that ocaml and ocamlc accept different syntax, i.e. are different languages.
<kizzx2> preyalone: so unless for training/learning purpose you should go ocamlbuild
<_habnabit> kizzx2, module type Bar (Fred: Ord) (Foo: FooSig)
<preyalone> kizzx2: Hmm, thanks.
<kizzx2> _habnabit: doesn't that create a functor with 2 parameters?
<preyalone> Does ocamlbuild come with official OCaml, or do I install it separately?
<_habnabit> kizzx2, wait, what
<_habnabit> kizzx2, you want this to implement /both/ interfaces?
<kizzx2> _habnabit: well i want to specify that `Bar` needs to implement both
<kizzx2> yes
<kizzx2> and Ord.t should equal to FooSig.t
<kizzx2> for `Bar`
<_habnabit> make a module type that includes both
<kizzx2> sorry
<kizzx2> i meant `Fred` should implement both
<kizzx2> :P
<kizzx2> preyalone: separately, i'd personally go with GODI
ztfw has joined #ocaml
<kizzx2> preyalone: well you know what, maybe it comes with it by default
<kizzx2> not sure :P
<_habnabit> so, module type FredSig = sig include Ord include FooSig end
<_habnabit> (doesn't ocamlbuild come with non-godi ocaml as well?)
<preyalone> kizzx2: How does GODI compare with Batteries? Wild guess: GODI is like CPAN and Batteries is like ActiveState Perl.
<_habnabit> batteries is just an extended stdlib
<_habnabit> since the default ocaml stdlib is kinda anemic
<kizzx2> preyalone: GODI is like CPAN, Batteries is like writing Haskell in OCaml, or boost in C++
<kizzx2> preyalone: i.e. it liberates you from the malnutritioned language :P
<kizzx2> _habnabit: Error: Multiple definition of the type name t. Name smust be unique in a given structure or signature
<_habnabit> yeah, there's syntax to clobber that
<_habnabit> and I can't remember it offhand
<kizzx2> i thougth it woudl be quite common?
<preyalone> kizzx2: "like writing Haskell in OCaml" <- That's funny, I started with Haskell and decided to give OCaml a try.
<_habnabit> I've never needed to do this
<tac-tics> preyalone: I don't think that's too uncommon, Haskell is the most successful of the FP languages
<tac-tics> at least in IRC idle count
<kizzx2> preyalone: that will give you the much needed function composition (|-) operator and also teh `where` syntax (omg can't live without this) and also F#'s pipeline operator |>
<tac-tics> what does F#'s |> do?
<preyalone> tac-tics: I'd say Lisp is more successful, measured by popularity, but no need to quibble.
<kizzx2> "hello world" |> print_string = print_string "hello world"
<tac-tics> is that all? hmm
<tac-tics> I guess it looks more "OO" that way?
<preyalone> zomg I love function composition
<_habnabit> what's object-oriented about that?
<kizzx2> tac-tics: it lets you chain functions my_list |> List.filter ((>) 3) >| List.filter ((>) 4)
<tac-tics> _habnabit: it mimick's a method's caller.method syntax, sorta
<tac-tics> yeah
<_habnabit> not really.
<kizzx2> well it "sort of" look like how ruby does it, if you will
preyalone has quit [Quit: Page closed]
<tac-tics> _habnabit: that looks awfully close to my_list.filter( > 3).filter( > 4)
<kizzx2> my_list.select{|x| x > 3}.select{|x| x > 4}
<tac-tics> yeah
<tac-tics> but I can appreciate simple combinators like that
<tac-tics> (I personally love Haskell's $)
<kizzx2> from BatPervasives seems we have a similar operator (**>)
<kizzx2> but last i tried it seemed broken
<kizzx2> and the doc warns that it will change soon
<kizzx2> i meant (**>) was meant to be similar operator for ($)
<kizzx2> tac-tics: do you happen to know the answer to my question? http://pastebin.com/NRqx8JsE
<tac-tics> kizzx2: no, I'm a ocaml nub
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
<_habnabit> here's a more comprehensive pipeline
<_habnabit> kizzx2, didn't I tell you what to do?
<kizzx2> _habnabit: Error: Multiple definition of the type name t. Name smust be unique in a given structure or signature
<_habnabit> kizzx2, yes, and there's syntax for telling ocaml to clobber one of the type definitions
<_habnabit> kizzx2, did you want me to find it for you
<kizzx2> _habnabit: well i am finding :P of coz getting spoonfed woudl be nice :P
<kizzx2> i am not sure how to phrase it to google, i tried "ocaml clobber type definition" without luck
<kizzx2> i know something is called "sharing constraint" might be related but not sure how to use it in this context
<kizzx2> o
<kizzx2> the := inside signature
<kizzx2> this is new to me :P
<kizzx2> _habnabit: thanks
ygrek has quit [Ping timeout: 248 seconds]
junsuijin has joined #ocaml
eikke has joined #ocaml
preyalone has joined #ocaml
<preyalone> bitbckt: I created an OCaml equivalent for Python's if __name__=="__main__". It's not too inelegant. http://rosettacode.org/wiki/Scripted_main#OCaml
ankit9 has quit [Quit: Leaving]
<preyalone> If you know of a way to check if a string contains a substring without having to use the Str module, let me know. :)
preyalone has quit [Client Quit]
ygrek has joined #ocaml
emmanuelux has joined #ocaml
penryu has joined #ocaml
ttamttam has joined #ocaml
kizzx2 has quit [Ping timeout: 248 seconds]
eikke has quit [Ping timeout: 258 seconds]
Boscop__ has joined #ocaml
Boscop_ has quit [Ping timeout: 245 seconds]
<_habnabit> that's some crazy indentation
<_habnabit> ... that's some crazy code
<tac-tics> _habnabit: looks like someone was a GNU programmer :P
ttamttam has left #ocaml []
<tac-tics> (or maybe it's the Linux coding style that uses 8 spaces....)
<_habnabit> that's hard tabs.
<_habnabit> but indenting in for nested let is pretty crazy
<tac-tics> yeah
<thelema> at least the try isn't extra indented
<_habnabit> ... and this code is insane anyway
<thelema> yup, pretty inefficient.
<_habnabit> the `with _ -> ()` tells me exactly how he writes his python code too. :(
<hcarty> _habnabit: I removed the ... non-standard indentation and "rec" from main
<thelema> if Filename.basename Sys.argv.(0) = "scriptedmain" then main()
<hcarty> _habnabit: Still perhaps non-standard code, but a bit easier on the eyes
<bitbckt> what. the.
<hcarty> thelema: It could be scriptedmain.ml or scriptedmain.exe...
<_habnabit> what if you're running ./scriptedmain/test.ml
<thelema> hcarty: not if compiled as instructed
<thelema> and it could be foo.exe, if the executable was renamed
<hcarty> thelema: True re: the instructions
eikke has joined #ocaml
<thelema> let chop_nofail s = try Filename.chop_extension s with Invalid_argument -> s
<thelema> if chop_nofail (Filename.basename Sys.argv.(0)) = "scriptedmain" then main ()
<hcarty> I like it
<hcarty> It's an odd approach to a relatively odd task
preyalone has joined #ocaml
mnabil has joined #ocaml
<preyalone> I've installed the Getopt module. getopt.cma is in /usr/local/lib/ocaml/site-lib/getopt/. But when I compile with "ocamlc -o ios7crypt -linkall str.cma getopt.cma ios7crypt.ml", I get "Error: Unbound module Getopt".
<thelema> preyalone: it looks like getopt installed via findlib
<preyalone> thelema: Yes.
<thelema> preyalone: try `ocamlfind ocamlc -packages getopt,str -linkall -o ios7crypt ios7crypt.ml`
<thelema> err, -package
joewilliams is now known as joewilliams_away
<thelema> and -linkpkg
preyalone_ has joined #ocaml
<thelema> preyalone: did you get those corrections?
<preyalone_> Wait, do I need to also supply the flag -linkpkg, and if so where would it go among the other flags?
<thelema> anywhere, and I believe -linkpkg can replace -linkall
<_habnabit> (should really just use ocamlbuild, though.)
<thelema> _habnabit: for a single file project, maybe overkill
preyalone has quit [Ping timeout: 252 seconds]
eikke has quit [Ping timeout: 256 seconds]
<preyalone_> thelema: Can -linkpkg replace -linkall in regular old ocamlc, or only in ocamlfind ocamlc?
<preyalone_> _habnabit: Thanks, I will probably use ocamlbuild in the future, but yeah, I'd like a simpler build command for single file projects.
<_habnabit> 'ocamlbuild x.byte' is pretty simple, but okay
<thelema> preyalone_: only ocamlfind ocamlc
<preyalone_> thelema: Then I'll use -linkall for now, unless ocamlfind borks.
<thelema> preyalone_: if you're using ocamlfind to produce an executable, you'll need -linkpkg (possibly in addition to -linkall)
<preyalone_> thelema: Oy.
<preyalone_> I'm getting a syntax error on line 54. https://gist.github.com/1254768
<thelema> _habnabit: except it'd be something like: 'ocamlbuild -use-ocamlfind -tag pkg_str -tag pkg_getopt x.byte
<preyalone_> I'm not sure when to end lines with a semicolon, when they're optional, and when they're flat wrong to use.
<hcarty> thelema, preyalone_: -linkpkg should be sufficient
<preyalone_> hcarty: Thanks.
<thelema> separate lines in a phrase with ;, don't end phrases with them
<thelema> preyalone_: problem is on lines 38 and 47
<thelema> also, don't put | at the end of lines, put it *before* match clauses
mnabil has quit [Ping timeout: 256 seconds]
<preyalone_> Thanks. Now I'm getting a type error in line 41, because Getopt doesn't document itself too well.
<thelema> preyalone_: also, you probably don't want to use strings, but a variant type for mode
<thelema> type mode = Help | Encrypt | Decrypt | Test
<preyalone_> thelema: Yeah, I just didn't learn OCaml's record syntax yet.
<thelema> preyalone_: not a record, a variant type
<preyalone_> What's the difference?
<preyalone_> Latest code gets a type error on line 43. https://gist.github.com/1254768
<thelema> a record is a sum type, like a tuple but with names
<thelema> err, product type
<preyalone_> k
<thelema> variants are sum types - like enumerations in other languages but better
<thelema> because data can be attached to alternatives
<thelema> type tree = Empty | Node of tree * int * tree
<preyalone_> Is the difference simply that records have named values while variants don't?
<thelema> no, records hold n things at once, variants hold one of n things
<thelema> type foo = {first_name: string; last_name: string}
<thelema> type foo = First_name of string | Last_name of string
<preyalone_> tree is a variant, foo is a record?
<thelema> with the first, you have a first name and a last name
<thelema> with the second, you have a first name *or* a last name
<preyalone_> Aye.
<preyalone_> In Haskell, both forms are just called records.
<thelema> odd.
<preyalone_> I understand the purpose of both forms, I use them frequently. If a record is small enough, I just use a variant to describe it.
<thelema> I understand them as being pretty orthogonal.
<thelema> ah, you're thinking record vs. tuple
<thelema> type foo3 = (string * string)
<thelema> tuples can replace small records
<preyalone_> yup
<thelema> variants... not so much, unless you really want an extra dose of type safety and want to pattern match to get at values
<preyalone_> Do you have getopt installed? I'm not sure why I'm getting a type error on line 43.
<thelema> the type of specs should be: type opt = char * string * (unit -> unit) option * (string -> unit) option
<thelema> the first two fields I see no problem with, but the third field seems wrong - "Some password"?
<preyalone_> Yep. I'm basing my code off the sample.ml file that comes with getopt. I'm having trouble making sense of the individual arguments. Not necessarily their types, but their purpose.
<preyalone_> AHA.
_andre has quit [Quit: Lost terminal]
<preyalone_> thelema: My code approaches properly typed, but it's still not quite there. https://gist.github.com/1254768
hcarty has quit [Quit: leaving]
metasyntax|work has quit [Quit: WeeChat [quit]]
preyalone_ has quit [Ping timeout: 252 seconds]
preyalone has joined #ocaml
<preyalone> I want to set the mode in addition to setting "password" to the option of -p, but I don't know how to get Getopt to do this. https://gist.github.com/1254768
orbitz_ has quit [Quit: Reconnecting]
orbitz has joined #ocaml
<thelema> preyalone: you might need () around your functions in line 28 and 29
<thelema> and then the variant constructor "Some", as you have nones on lines 30 and 31
<preyalone> thelema: It's still not quite right. https://gist.github.com/1254768
<thelema> ah, getopt.set returns an action all by itself. You'll have to do that by hand if you're going to write your own function
<thelema> Some(fun p -> mode := Encrypt; password := p)
<preyalone> k
<thelema> and no Some on L30,L31
<preyalone> Aye
<preyalone> Strangely, if you uncomment line 30, the program no longer compiles. https://gist.github.com/1254768
<thelema> odd. the specific error you're having would be useful to help
<thelema> oh... you're using , to separate list elements
<thelema> it should be [1;2;3], not [1,2,3]
<preyalone> got it.
<thelema> both are valid syntax - the first is a list of three elements each an int
<thelema> the second is a list of one element, that being a tuple of three ints
<preyalone> tuples are comma delimited, lists are semicolon demlited?
<thelema> lists are semicolon delimited bounded by [], arrays are semi delim'ed bounded by [| |]
<thelema> tuples don't have to be bounded by anything, but often are bounded by normal (), just for precedence
<preyalone> thelema: In sample.ml, the specs list is bounded by [ ].
<thelema> yup, it's a list.
<thelema> (1;2;3) is an expression that says to evaluate 1, throw the result away, then evaluate 2 and throw the result away and then evaluate 3
<thelema> same without ()
<thelema> you need [] to make a list
<preyalone> thelema: I got the code working with just [ and ], so there's something funny going on.
<preyalone> OHHHHHH. [| and |] bound arrays, but not lists.
<preyalone> The crucial difference between arrays and lists was lost on me for a second.
<preyalone> Now my program has a logical bug. In sample.ml, when you run ./sample -x with no arguments to -x, it correctly prints "Fatal error: exception Getopt.Error("Option -x must have an argument")"
<preyalone> But in ios7crypt.ml, you should get the same error by entering ./ios7crypt -e or ./ios7crypt -d with no arguments.
<preyalone> Instead, when you do ./ios7crypt -e/-d, nothing happens. the program silently quits.
<preyalone> wait a minute... is that because in the current code, i never access password and hash? stupid lazy programming
<thelema> ocaml isn't lazy.
<thelema> do you actually set password or hash?
<thelema> ocaml isn't lazy unless you ask for it specifically.
<Qrntzz> there is lazy evaluation
<Qrntzz> but it isn't needed in most of the cases
<thelema> Qrntzz: you have to ask for it specifically.
<Qrntzz> indeed
<Anarchos> Qrntzz i remember streams in caml light :)
`fogus is now known as fogus-away
<preyalone> all: The problem is not lazy evaluation; even when I print out the values of password and hash, I get the same problem. Instead of an error about missing arguments, the program quits silently.
<preyalone> Current code: https://gist.github.com/1254768
<thelema> well, if main is being called, at least one of the clauses in the match statement will be called (or an exception will be raised in parse_cmdline, which we've seen gives output.
<thelema> preyalone: try getting rid of your main testing routine.
<thelema> also, main and usage don't need to be [let rec] -- a simple [let] will suffice
<preyalone> I modified the match expression to handle bad args, but same behavior. https://gist.github.com/1254768
<preyalone> thelema: What is let rec for?
<thelema> for defining recursive functions
<preyalone> ah.
<preyalone> I thought it meant "recording"
<thelema> the modification to the match expression is a bad one - you should be explicit on all match cases, ocamlc will check on compilation if you've missed any cases
<thelema> also, hard tabs for indent aren't proper style.
<thelema> and it's guaranteed that no other value could be matched by the type of mode.
hcarty has joined #ocaml
<preyalone> Why does https://gist.github.com/1254944 display an error when -x has no arguments, but https://gist.github.com/1254768 ignores missing arguments?
eikke has joined #ocaml
<hcarty> thelema: I was able to install ocamlgsl through odb.ml
<preyalone> I commented out the main testing bits and just wrote main "ios7crypt", but it still ignores missing arguments to -e and -d.
<thelema> dunno. possibly a bug in getopt, although I'd be surprised. I don't use getopt, for really simple stuff I use the Arg module in the stdlib, and for complex stuff, I have my own arg2
<thelema> hcarty: great. Can you put a comment in oasis-db about that?
<thelema> hcarty: I'll promote gsl to testing.
* thelema should set a stable sometime.
preyalone_ has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
preyalone has quit [Ping timeout: 252 seconds]
Associat0r has quit [Quit: Associat0r]
<hcarty> thelema: Done.
<hcarty> thelema: Thanks for updating the package!
eikke has quit [Ping timeout: 245 seconds]
<preyalone_> I think I found the problem. The with _ bit hides all errors.
<thelema> ah, yes it would.
<hcarty> preyalone_: let () = ... is generally safer than let _ = ...
<hcarty> preyalone_: It will let you know if you're ignoring something you don't intend to.
<thelema> try this instead: "let chop_nofail s = try Filename.chop_extension s with Invalid_argument -> s in if chop_nofail (Filename.basename Sys.argv.(0)) = "scriptedmain" then main ()"
<hcarty> Or, rather, let you know if you are ignoring a non-unit value
<thelema> hcarty: try ... with _ -> ()
<hcarty> thelema: Ah, oops.
<hcarty> preyalone_: The comment stands, but is not directly applicable to this topic :-)
<preyalone_> Bugger, there's no reason to use exceptions in regex matching. Just return Some match or None.
<preyalone_> hcarty: Noted.
<preyalone_> Working code: https://gist.github.com/1254768
<preyalone_> All that's left is to fill in the actual encryption/decryption/testing functions.
<preyalone_> Does anyone know if there's a QuickCheck library for OCaml?
<thelema> yes
<thelema> preyalone_: if your needs aren't too complex, use this one: https://github.com/ocaml-batteries-team/batteries-included/blob/master/qtest/quickcheck.ml
<preyalone_> thelema: Does that require Batteries itself?
<thelema> no
<thelema> there's no "open Batteries" or references to "BatFoo" modules
<hcarty> thelema: Do you have any thoughts/plans on what is required before a Batteries 2.0 release?
<thelema> hcarty: I should announce such a thing on the mailing list. And I should merge any commits to the 1.x branch to the v2 branch
edwin has quit [Remote host closed the connection]
<thelema> hcarty: can you `odb.ml benchmark`?
<hcarty> thelema: Failure "Could not extract tarball for benchmark(benchmark-1.0.tar.gz)".
<hcarty> thelema: It looks like it isn't downloading properly
<thelema> yup, a bunch of files in oasis-db are failing
<hcarty> benchmark could probably be uploaded again. Which others are failing?
<thelema> csv, ocamlmod
<thelema> had a problem with spotlib, but it seems to have recovered
Boscop has joined #ocaml
<thelema> n/m, ocamlmod is back up...
Boscop__ has quit [Ping timeout: 260 seconds]
<thelema> ocaml-irrlicht
<hcarty> thelema: Did these work in the past?
<hcarty> I haven't tried installing any of them before now
<thelema> I'm not certain. I think I'm the only one promoting to testing, and I don't promote to testing unless it's worked for me once
<thelema> there'
<thelema> s some problem with hdf4
<thelema> I think one of the URLs is missing the filename
<hcarty> I've promoted packages to testing as well, but also only ones I've packaged.
<hcarty> s/packaged/testing/
<thelema> no worries
<thelema> I just haven't noticed your promotions, I guess
ygrek has quit [Ping timeout: 248 seconds]
<hcarty> s/testing/tested/...
<hcarty> I haven't done it with many packages
<hcarty> Only when I notice a new package and am able to test it
<thelema> sure
<hcarty> thelema: What's the problem with hdf4? I only see one source for the .tar.gz on the oasis-db site.
<hcarty> Although I thought I had put in the original URL when I uploaded it.
bobry has joined #ocaml
preyalone_ has quit [Ping timeout: 252 seconds]
lpereira has quit [Quit: Leaving.]
<hcarty> Odd. "ocaml odb.ml hdf4" works here
Boscop_ has joined #ocaml
Boscop has quit [Ping timeout: 258 seconds]
Boscop__ has joined #ocaml
Boscop_ has quit [Ping timeout: 260 seconds]
<hcarty> thelema: The files in testing/pkg/info/ look like the have the correct content for hdf4
<hcarty> Ack... I can't type. s/the/they/
<thelema> maybe a bug in odb - I'll debug after I'm done with my presentation
* thelema is happy to be able to include the XKCD on significance in the presentation
<hcarty> Not bad
Boscop__ has quit [Ping timeout: 255 seconds]
Boscop__ has joined #ocaml
Boscop__ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
<hcarty> thelema: I'll check the logs later to see if there is anything I can do to help with the odb trouble
<hcarty> Have a good evening
<thelema> thanks
hcarty has quit [Quit: leaving]
ikaros has quit [Quit: Ex-Chat]
eikke has joined #ocaml
Modius has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Disconnected by services]
Boscop_ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
joewilliams_away is now known as joewilliams
Boscop_ has joined #ocaml
Boscop has quit [Disconnected by services]
Boscop_ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Disconnected by services]
Boscop_ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
sebz has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Disconnected by services]
Boscop_ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Disconnected by services]
Boscop_ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
Amorphous has quit [Ping timeout: 244 seconds]
Cyanure has quit [Remote host closed the connection]
oriba has joined #ocaml
joewilliams is now known as joewilliams_away
Amorphous has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
tac-tics has quit [Quit: tac-tics]
ag4ve has quit [Ping timeout: 258 seconds]
bobry has quit [Ping timeout: 260 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
ztfw has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
dnolen has joined #ocaml
oriba has quit [Quit: oriba]
Apsalar has joined #ocaml
sebz_ has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ulfdoz_ has joined #ocaml
arubin has joined #ocaml
lopex has quit []
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
<Apsalar> hey all, ocaml newbie here; are there any standard implementations of memoization, or is it still a roll-your-own deal at the present?
virtuoussin13 has joined #ocaml
<virtuoussin13> Hi, is there a good way to get the size of size_t from within ocaml?
<_habnabit> virtuoussin13: And then do what with it?
<virtuoussin13> Output it to a bytecod header, I'm writing an assembler that emits Lua bytecode. Part of the binary header is the size of a size_t :-\
<_habnabit> That seems pretty strange.
<virtuoussin13> Yep, but there we go.
<_habnabit> Isn't it supposed to be cross-platform?
<virtuoussin13> lua? apparently not, when I hard coded it to 4 bytes it didn't work on my professor's 64-bit computer...
<virtuoussin13> And when I just tried to run a bytecode file produced on his computer it died with "bad header in precompiled chunk"
<_habnabit> Well, I guess lua is more braindead than I thought it was.
<NaCl> virtuoussin13: you could bind a C function to ocaml
<NaCl> although if you are studying compilers and whatnot, then an FFI is probably the last thing you want to touch
<virtuoussin13> ?? what do you mean by that?
<NaCl> which part?
<virtuoussin13> the FFI bit, why wouldn't I want to touch that?
<NaCl> they can get messy
<NaCl> but if all you are doing is acquiring the size of size_t, then it should be relatively simple
<virtuoussin13> :-\ I take it from that there's no good way to get it?
emmanuelux has quit [Ping timeout: 244 seconds]
<virtuoussin13> short of dropping into C and returning sizeof(size_t)?