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/
delamarc1e has joined #ocaml
delamarche has quit [Connection timed out]
delamarc1e has quit [Read error: 60 (Operation timed out)]
rillig has quit ["exit(EXIT_SUCCESS)"]
wkh has quit ["quitting the internets chat innit"]
yondalf has joined #ocaml
dibblego has joined #ocaml
mattam has quit [Remote closed the connection]
mattam has joined #ocaml
chessguy has joined #ocaml
yondalf_ has joined #ocaml
yondalf has quit [Read error: 110 (Connection timed out)]
pango_ has joined #ocaml
yondalf_ has quit ["leaving"]
chessguy has quit [" Like VS.net's GUI? Then try HydraIRC -> http://www.hydrairc.com <-"]
pango has quit [Remote closed the connection]
Skal has joined #ocaml
MisterC has joined #ocaml
godeke has quit [Remote closed the connection]
Ugarte has quit ["leaving"]
Ugarte has joined #ocaml
Godeke has joined #ocaml
Skal has quit [Read error: 110 (Connection timed out)]
batdog is now known as batdog|gone
delamarche has joined #ocaml
Snark has joined #ocaml
dibblego has quit ["Leaving"]
david_koontz has quit ["This computer has gone to sleep"]
pauldia has joined #ocaml
love-pingoo has joined #ocaml
jave has quit [Read error: 104 (Connection reset by peer)]
lmbdwr has joined #ocaml
<lmbdwr> #coq
<lmbdwr> heh
<lmbdwr> hi all
<lmbdwr> lo all
<love-pingoo> lo
slipstream-- has joined #ocaml
david_koontz has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
shawn has quit ["Leaving"]
m3ga has quit ["disappearing into the sunset"]
m3ga has joined #ocaml
dark_light has joined #ocaml
yondalf has joined #ocaml
Snark has quit ["Leaving"]
yondalf_ has joined #ocaml
yondalf has quit [Read error: 145 (Connection timed out)]
yondalf has joined #ocaml
yondalf_ has quit [Read error: 145 (Connection timed out)]
bzzbzz has quit ["leaving"]
yondalf_ has joined #ocaml
yondalf has quit [Read error: 145 (Connection timed out)]
pango_ is now known as pangoafk
yondalf_ has quit [Read error: 145 (Connection timed out)]
dark_light has quit ["Ex-Chat"]
yondalf has joined #ocaml
mikeX has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
yondalf_ has joined #ocaml
yondalf has quit [Read error: 145 (Connection timed out)]
yondalf_ has quit [Read error: 145 (Connection timed out)]
levi_hom1 has joined #ocaml
levi_home has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
pangoafk is now known as pango
slipstream-- has quit [Read error: 145 (Connection timed out)]
batdog|gone is now known as batdog
beschmi has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
delamarche has quit [Client Quit]
jajs has joined #ocaml
jajs has quit [Remote closed the connection]
jajs has joined #ocaml
clog_ has joined #ocaml
_fab has joined #ocaml
clog has quit [Read error: 110 (Connection timed out)]
clog_ is now known as clog
Leonidas has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC for those that like to be different"]
knobo has quit [Read error: 60 (Operation timed out)]
jp has joined #ocaml
knobo has joined #ocaml
delamarche has joined #ocaml
jp has left #ocaml []
<dan2> love-pingoo: ahoy
postalchris has joined #ocaml
delamarche has quit [Client Quit]
jp has joined #ocaml
Snark has joined #ocaml
jajs has quit [Remote closed the connection]
jp has left #ocaml []
bluestorm has joined #ocaml
TSC has quit [Remote closed the connection]
seto has left #ocaml []
mikeX has quit [Read error: 145 (Connection timed out)]
mikeX has joined #ocaml
romildo has joined #ocaml
<romildo> Hi.
<romildo> Does ocaml put a limit on the number of arguments in a function application?
TSC has joined #ocaml
<romildo> Because I have a program with a function with 25 arguments that runs ok on amd64 linux, but fails with a segmentation fault on x86.
<romildo> When reduce in 1 the number of arguments, it does not segafult anymore.
chessguy has joined #ocaml
romildo has quit ["Leaving"]
<postalchris> romildo: you've got to give us a minute!
Romildo has joined #ocaml
Romildo has quit [Client Quit]
romildo has joined #ocaml
<pango> well, that looks like a bug ;) btw the number of parameters alone is not sufficient (made a simplistic example of function with 26 parameters, and it didn't segfault)
Snark has quit ["Leaving"]
<romildo> Maybe it is because of the context I have used the function.
<romildo> The function is called as the callback of a button on the lablgtk GUI of my application.
<pango> anyway, any segfault is worth reporting... http://caml.inria.fr/mantis/
<postalchris> Is the function recursive?
<postalchris> Could be a stack overflow?
<romildo> The function is not recursive.
delamarche has joined #ocaml
love-pingoo has quit [Remote closed the connection]
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- The professional IRC Client"]
lmbdwr has quit ["Leaving"]
delamarche has quit [Client Quit]
romildo has quit ["Leaving"]
smimou has joined #ocaml
jp has joined #ocaml
jp has left #ocaml []
bluestorm is now known as bluestorm_aw
romildo has joined #ocaml
<romildo> Regarding the segmentation fault I reported earlier, would someone like to try a snippet of my program which is triggering the bug?
<romildo> Just to see if only happens on my computer.
<pango> sure
<romildo> I have reduced it to a minimum size. Just some of the GUI are constructed. You need only ocaml and lablgtk to run it.
bluestorm_aw is now known as bluestorm
<romildo> My system: "uname -a" gives:
<romildo> Linux malaquias 2.6.18-gentoo #2 PREEMPT Mon Oct 2 09:29:19 BRT 2006 i686 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux
<romildo> Compiled with:
<romildo> ocamlopt -I +lablgtk2 -o gui str.cmxa lablgtk.cmxa gtkInit.cmx gui.ml
<romildo> (The "str.cmxa" is not needed in the above command)
<romildo> Running it gives me:
<romildo> $ ./gui
<romildo> Segmentation fault
chessguy has joined #ocaml
<pango> couldn't reach rafb.net yet...
<romildo> My computer multiboots into some OSs. I have tried the program on both Gentoo Linux ~amd64 and ~x86. It segfaults only on ~x86.
<romildo> Is the link inaccessible to you?
<pango> strange, it works from another remove box
<romildo> x86 ?
<pango> s/remove/remote/
<pango> yup p4, ocaml 3.08.3
<romildo> ocaml 3.09.3 here
<pango> 3 warnings while compiling... and the programs stays idle when I start it
<pango> (no window appearing)
smimou has quit ["bli"]
<pango> uh, it worked under strace, and now it works without :)
<pango> fine with 3.08.3
<romildo> I am installing 3.08.3 to see if t works with this old version.
<romildo> It does work with 3.08.3 here too.
Leonidas has quit [Read error: 113 (No route to host)]
<romildo> Do you think that this program is stipped enough for a bug report?
<romildo> s/sipped/stripped/
<romildo> s/stipped/stripped/
<pango> Personally I'd say yes
<romildo> Anybody would test the program on x86 linux with ocaml-3.09.3 ? It does work with 3.08.3 for me and pango.
<romildo> New version of the test: http://rafb.net/paste/results/EY6wod61.html
<pango> it it's easy to remove most widgets, and it still triggers the bug, that'd be even better; but a 6kB file it quite good already
KirinDave has joined #ocaml
<romildo> Some minor changes in the call to the run callback hides the bug.
<romildo> For instance if I want a new parameter to the run callback, it works.
<romildo> s/want/add/
<KirinDave> I was hoping someone could help me with my ocaml-on-intel-mac problem. I cannot get ocaml to build for the life of me.
<pango> mmmh
<romildo> If I remove some of the widget parameters, it works, too.
<KirinDave> Does anyone have the expertise + inclination to help?
<romildo> pango: category of bug report is OCaml general?
<romildo> My test program works with ocaml-3.09.2 too.
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- 100,000+ downloads can't be wrong"]
romildo has quit ["Leaving"]
delamarche has joined #ocaml
romildo has joined #ocaml
romildo has left #ocaml []
romildo has joined #ocaml
<pango> romildo: ocaml general seems appropriate, there's not really choiec
<pango> s/choiec/choice/
<romildo> A little style of programming question: Which of the following
<romildo> let n = Array.length v in
<romildo> for i = 0 to n - 1 do
<romildo> (* some stuff *)
<romildo> done
<romildo> and
<romildo> for i = 0 to Array.length v - 1 do
<romildo> (* some stuff *)
<romildo> done
<romildo> is better?
<pango> Array.iter
<romildo> :)
<romildo> When one is worried with efficiency, Array.iter would be more expensive, as it envolves an extra function call for each iteration, right?
<romildo> s/envolves/involves/
<pango> not if the compiler is smart... But haven't checked whether it is in that case
batdog is now known as batdog|gone
<romildo> Also Array.iter does not seem appropriate for those cases where "some stuff" needs to access other elements of the array. Like this:
<romildo> v.(i) <- v.(i - 1) + v.(i + 1)
<pango> Array.iteri then
MisterC has quit [Read error: 104 (Connection reset by peer)]
delamarche has quit [Client Quit]
<romildo> If one wants to iteate over a subset of the array, what construct should be used?
<pango> there's no concept of subarrays in standard lib, so you'll have to create your own HoFs in that case
<romildo> pango: do not you like the iterator commands? for, while
<pango> they can't be mixed with functional paradigm, so they're only useful in very limited cases
<dan2> romildo: what are you doing? memoizing fibonacci?
<romildo> dan2: no
<romildo> pango: so you promote the functional paradigm, although the language is multi-paradigm.
<pango> I tend to use functional paradigm whenever I can. The ocaml syntax promotes it in subtle ways, too
<romildo> pango: I agree.
delamarche has joined #ocaml
<pango> Array.iter seems noticeably slower, a shame ;)
<dan2> pango: heh
<romildo> Probably the compiler does not optimize it and makes the function call at every iteration.
<pango> what I said, a shame
<dan2> isn't there an option for the compiler to inline functions
<pango> it does it automatically, and can be tweaked with -inline [threshold size]
<pango> however it did help
<pango> s/did/didn't/
<dan2> write your own array.iter then I guess...
datrus has left #ocaml []
<pango> testing copy&pasted code from array.ml, no need to reinvent the wheel
<dan2> pango: is that what you're doing right now?
<romildo> without the help of the compiler, it would not be better. It still will have a function call.
<pango> dan2: yes... And switching from wallclock to Benchmark module, to get more accurate results
<dan2> heh
<pango> romildo: not necessarily I think
<dan2> pango: I'm still impressed that you can define the list type in a single line in ocaml
<dan2> ;)
<dan2> type 'a node = { item : 'a; next : 'a node option; }
<pango> romildo: I think Array.iter itself could be inlined, with parameter passing inlined as let bindings (some correct me if I'm wrong)
<pango> dan2: or type 'a node = EmptyList | Cons of 'a * 'a node
<dan2> that would work too
<dan2> which is faster?
<pango> conceptually, lists are defined as type 'a list = [] | :: of 'a * 'a list
<dan2> I see
<pango> but that's not correct OCaml code; both [] and :: aren't accepted by the parser as correct constructors names
<dan2> pango: do you use military time as your system clock or conventional time?
<pango> that's slightly offtopic ;)
delamarche has quit [Client Quit]
<pango> however I always set the "cmos" clock in UTC, since I almost never use the-other-operating-system-preinstalled-on-that-laptop ;)
<bluestorm> here is a method for "having a binary method without having to publicly give the objet representation"
<bluestorm> it use a module to hide the 'repr' method
<bluestorm> the one i would have used is :
<bluestorm> method comparator = (fun another_repr -> (-) self#repr)
<bluestorm> method compare another_objet = another_objet#comparator self#repr
<bluestorm> it seems me, hum, cleaner
<bluestorm> (the idea is to use a closure to hide the objet representation, while actually giving a way to compare)
<bluestorm> (the code may be wrong)
<bluestorm> do my method have drawbacks i don't see ? what's you opinion about it ?
<romildo> pango: What do you think about these styles of programming (both are functional)?
<romildo> let rec loop sum = function
<romildo> | [] -> sum
<romildo> | x::xs -> loop (sum + x) xs
<romildo> in loop 0 numbers
<romildo> and
<romildo> List.fold_left (fun sum x -> sum + x) 0.0 numbers
<romildo> Of course the first is more verbose. But would it be more efficient? Is there any reason one would prefer the first to the second?
<KirinDave> Could someone give me some advice on building ocaml? I can't seem to get it to build at all, and the stock binaries for my platform won't let findlib install.
<pango> romildo: strange, I said previously that Array.iter looked slower, but Benchmark tells me otherwise: http://nopaste.tshw.de/115983098754a0d/
<pango> romildo: personally I'd take the latter; You eventually get tired of writing code like the former ;)
pauldia has quit [Read error: 110 (Connection timed out)]
<pango> romildo: btw List.fold_left ( +. ) 0.0 numbers works too
<romildo> pango: yes
<romildo> pango: The later is much more succint
<pango> and being idiomatic, everyone understands what it means
postalchris has quit ["Leaving."]
<romildo> pango: It is really strange. I did not expect Array.iter to be better.
<pango> if I read the results right, it's actually just as fast, not faster
<romildo> I have never seen the Benchmark module.
delamarche has joined #ocaml
<romildo> What does it meaning a line such as f3: 388 WALL (345.40 usr + 2.65 sys = 348.05 CPU) @ 24.05/s (n=8370)
<romildo> What is WALL?
<romildo> What is n?
<pango> it ran f3 8370 times in 348.05 cpu seconds, hence 24.05 times/s
<pango> wall = wall clock; since the box is not only running that program, wall clock is larger than cpu clock
<romildo> Then you are right, f3 is as fast as the f1 and f2. One maybe would say, slightly faster.
<pango> they're within 1% of each other, probably below noise level
delamarche has quit [Client Quit]
bluestorm has quit ["Konversation terminated!"]