cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
postalchris has quit ["Leaving."]
mbishop has quit ["Leaving"]
mikeX has quit ["leaving"]
david_koontz has quit ["Leaving"]
metaperl has joined #ocaml
<metaperl> anyone have alink to ICFP 2007 programming contest?
Z4rd0Z has joined #ocaml
<scruffie> google is your friend: http://www.icfpcontest.org/
<metaperl> scruffie: thanks
metaperl has left #ocaml []
pants1 has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit ["Leaving"]
Mr_Awesome has quit ["...and the Awesome level drops"]
dark_light has quit [Connection timed out]
Z4rd0Z has quit []
Z4rd0Z has joined #ocaml
Z4rd0Z has quit [Client Quit]
mbishop has joined #ocaml
alkoma has joined #ocaml
alkoma has left #ocaml []
Submarine has quit [Remote closed the connection]
benny_ has joined #ocaml
benny has quit [Read error: 145 (Connection timed out)]
smimou has joined #ocaml
pstickne_ has quit [Connection timed out]
pstickne_ has joined #ocaml
scruffie has quit []
bluestorm_ has joined #ocaml
love-pingoo has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
bluestorm_ has joined #ocaml
rickardg has joined #ocaml
rickardg has left #ocaml []
bluestorm_ has quit [Remote closed the connection]
MarcWeber has joined #ocaml
<MarcWeber> Is there a cross-platform gui library (binding) for ocaml ?
<mattam> lablgtk is cross-platform
zhllg has quit [Read error: 110 (Connection timed out)]
danly has joined #ocaml
danly_ has quit [Read error: 60 (Operation timed out)]
<MarcWeber> Hi mattam. Thanks. Then I missunderstood another post. only open gl is unmantained, not the whole lablgtk. All right.
malc_ has joined #ocaml
yangsx has joined #ocaml
slipstream has joined #ocaml
slipstream-- has quit [Read error: 145 (Connection timed out)]
junis has joined #ocaml
<junis> how does one concatenate strings in ocaml
<malc_> "a" ^ "b"
<junis> thank you
<malc_> rtfm
yangsx has left #ocaml []
<fremo> :)
<junis> is there a F# forum on freenode network?
<junis> i cannot find one
<junis> is there a F# channel on freenode...
<malc_> yes
Z4rd0Z has joined #ocaml
<junis> what is its name.. i cannot find it
<malc_> #fsharp
<junis> why!.. there is none there...
* junis laughs...
<malc_> there's a chanbot there, be positive
<junis> hehe... .o)
<malc_> saceni >B) /ctcp malc_ version
<malc_> whoops
<junis> what is the type of printf;; in ocaml... i have not ocaml installed here... can someone help me...
<flux> printf is magic in ocaml
<flux> its type is ('a, out_channel, unit) format -> 'a
<flux> and no, you can't really do a printf-like-function yourself
<flux> but you can use the pre-existing to write your own printf-redirections with ksprintf
<junis> how does one print a string in ocaml?...
<flux> print_endline "hello world" is one option, although I usually use Printf.printf "hello world\n%!"
<junis> thank you
malc__ has joined #ocaml
<junis> is there not a print_string : string -> unit = <fun:clo@0_3> in ocaml
<gim> # print_string;;
<gim> - : string -> unit = <fun>
<junis> aha...
malc_ has quit [Read error: 110 (Connection timed out)]
gim has quit [Remote closed the connection]
zhllg has joined #ocaml
<fremo> funny: val (*) : int -> int -> int
<fremo> (to me at least :)
<flux> it is, infact, a bit funny
<flux> because you can't type (*) in ocaml and get the same result
<flux> but the amusement value is limited ;)
<fremo> hehe :)
<junis> let unt_1 = fun x -> ();;
<junis> woops... i'm sorry
zhllg has quit [Read error: 110 (Connection timed out)]
zhllg has joined #ocaml
cjeris has joined #ocaml
gim has joined #ocaml
pango has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
pango has joined #ocaml
junis has quit []
bluestorm_ has joined #ocaml
love-pingoo has quit ["Leaving"]
Submarine has joined #ocaml
love-pingoo has joined #ocaml
jacobian has quit [Remote closed the connection]
jacobian has joined #ocaml
Mr_Awesome has joined #ocaml
mnemonic has joined #ocaml
<mnemonic> hi
vital303 has joined #ocaml
gim has quit [Remote closed the connection]
mikeX has joined #ocaml
<love-pingoo> fuck
<love-pingoo> my app spends 20% of its time in Array.blits ...
<love-pingoo> the overall perf is not too bad, but that's a sad figure
<love-pingoo> the next line in the profiling result is 16% for vorbis encoding
<love-pingoo> that should be the most costly thing
<flux> what does the app do?-o
<love-pingoo> it's liquidsoap, on a conf that reads a mp3 and outputs vorbis to icecast
<flux> so where does it need Array.blit? it copies audio buffers around?
<love-pingoo> yup
<flux> don't do that ;)
<love-pingoo> I wish I could, but that doesn't seem that simple.
<love-pingoo> liquidsoap internally works on fixed-length buffers
<flux> so why are the audio buffers copied around?
<love-pingoo> but I can't tell libmad that I want a fixed amount of output data
<flux> are they postprocessed?
<love-pingoo> so I have to have an intermediate structure for filling my internal buffers from the chunks that mad gives me
<flux> are the array contents modified?
<love-pingoo> they can be, yes
<flux> would it be a big change to support (fixed size) array slices where it now supports whole (fixed size) arrays?
<love-pingoo> it'd be nice to get exactly the amount I want from mad.. they may have an internal buffer anyway
<flux> I think it's quite possible libmad also gets 'some' amount of data
<flux> with compression it might be difficult to see how much data you get before decoding the data
<love-pingoo> that'd be a non-trivial change indeed, with lots of possible interference
<love-pingoo> how copying a range of floats can be slower than encoding them in vorbis ?
<flux> maybe you should check how many bytes per second you are copying
<love-pingoo> I wish blit was memcpy
<flux> is it really much different?-o
<flux> how about using bigarrays?
<love-pingoo> flux: 44100*32
<flux> atleast with them it should be..
<flux> so it's 8 intermediate copies?
<love-pingoo> more specifically I'm blitting 44100*2 floats per second
<flux> oh, right
<love-pingoo> it's not 16bit samples, sorry
<flux> I forgot that already
<flux> you're getting float data from libmad?
<love-pingoo> yes, converted to float array array by libmad
<malc__> ahem..
<malc__> *32?
<malc__> ocaml's float is Cs double
<malc__> so it should be *64
<love-pingoo> I was thinking of the underlying 16bit samples, which was wrong
<love-pingoo> anyway, there is clearly a caml overhead here, I doubt that it's a bandwidth problem
<flux> love-pingoo, btw, how much does gc take?
jlouis has quit [Remote closed the connection]
<love-pingoo> not much, but the memory consumption is a bit high
MarcWeber has quit [Read error: 110 (Connection timed out)]
<love-pingoo> it was better with the string output of mad concerning the memory
jlouis has joined #ocaml
<flux> hmm.. so libmad is creating float which something is converting to doubles?
<love-pingoo> yes
<flux> does that show in the profiling somewhere?
<love-pingoo> not immediately
<flux> but yeah, a single copy of 88200 doubles maybe shouldn't consume that much
<flux> that is, assuming vorbis is atleast somewhat heavy operation :)
<flux> how about compared to actual mp3 decodoing?
<flux> decoding, even
<love-pingoo> I also have a function that outputs that much data to strings (doing float -> int), in C code, and it's "only" 16% of the time
<love-pingoo> so it's converting _and_ copying
<flux> well, it writes less
<love-pingoo> agreed
<love-pingoo> what did you want to compare ?
<flux> decoding mp3 and duplicating the double-buffer
<love-pingoo> ocaml_vorbis_encode is 16%, ocaml_mad_decode is 9%
<flux> and copying 20%
<love-pingoo> yes
<flux> maybe you're accidentally doing more copying than you think?-)
<love-pingoo> I feel that you're getting my (disa)point(ment)
<love-pingoo> that'd be a good explaination.. but that's not very likely
<malc__> comment it out
<flux> you could throw in a test-copy if dummy double array, and then a similar with Bigarray of doubles
<love-pingoo> Bigarray sounds like it could help
<malc__> anyhow 44100*2*64 is peanuts
<love-pingoo> I'm a bit reluctant to move (again) everything from Array to Bigarray but well..
<flux> love-pingoo, did you check that the number of calls to Array.blit is something sane
<malc__> i have to move 60825600 per second around
<love-pingoo> float are not boxed in my arrays, so it must be possible to just memcpy, right ?
<love-pingoo> blit does a for-loop, taking advantage of the individual unboxing but not copying the whole thing as a whole
<malc__> yep
<flux> I just benchmarked by ocamlopt binary
<flux> it copies 41724037 doubles per second
<malc__> $PREFIX/lib/ocaml/array.ml:blit
<love-pingoo> hey, I'm gonna try -unsafe
<malc__> pointless
<malc__> blit already does unsafe stuff
<love-pingoo> shit
<malc__> it's just terribly inefficient
<malc__> half decent memcpy implementation will outperform it by an order of magnitude
<flux> but it's not quite trivial to specialize an Array.blit implementation for floats/ints/other non-boxed types?
<flux> hm, maybe it could detect it somehow at runtime
<love-pingoo> doesn't matter
<flux> infact, why can't it just always do memcpy?
<love-pingoo> I don't mind throwing a bit of C code for my own use
<love-pingoo> flux: mutable stuff ? garbage collection ?
<flux> do they matter?
<love-pingoo> memcpying boxed values might be rude
<love-pingoo> I'm not very comfortable here, but I'd be careful
<flux> what else does copying a boxed value do than just copy the value?
<flux> it doesn't do a deep copy anyway
<love-pingoo> however I do feel that an unboxed float array is a float* and shoud admit memcpy
<flux> maybe I just don't understand how it works, though
<flux> well, atleast Bigarray should have the floats unboxed
<malc__> double Arrays are always unboxed in OCaml
<love-pingoo> flux: I don't know (for memcpy)
<malc__> they are special
<malc__> ditto for records
<malc__> which created some confusion in the past (this fact mixed with functors)
<love-pingoo> ok I'm writing blit_float in C
<flux> if that works and boosts the performance, post something to the caml mailing list ;-)
<love-pingoo> I should search the list first, actually :)
<love-pingoo> Alain writes that blit tests that the array contains floats for every cell
<love-pingoo> and says that one could avoid the call to modify for every cell and call memmove when the copy is not from the new generation to the old one
<love-pingoo> the bug is old but marked as open
* malc__ discovers that he can read french
<love-pingoo> lol
<love-pingoo> WOW IT WORKS
<love-pingoo> let's profile this crazy blind hack
<love-pingoo> 20.10 0.42 0.42 caml_float_pcm_to_s16le
<love-pingoo> 14.83 0.73 0.31 ocaml_vorbis_encode_buffer
<love-pingoo> 10.53 0.95 0.22 camlFloat_pcm__rms_204
<love-pingoo> 9.09 1.14 0.19 caml_float_array_blit
<love-pingoo> yesss
<love-pingoo> that's more reasonable
<malc__> what was the time before?
<love-pingoo> 20% for Array.blit (absolute times are pointless, I don't time the whole process)
<malc__> 9% now?
<love-pingoo> yup
<love-pingoo> pcm_to_s16le is the conversion from float array to a string representing 16bit samples
<love-pingoo> we know how to optimize it
<love-pingoo> (a bit)
<malc__> so only a 2x increase..
<love-pingoo> that's not wonderful
<malc__> that's downright pathetic
<love-pingoo> worse, I'll have to do resampling and not only blit.. if I don't do it in C the perfs will be really bad again
<love-pingoo> I should never have thought of moving liq from string to float arrays
<malc__> liq?
<love-pingoo> liquidsoap, the audio streamer
mrchebas has joined #ocaml
Mr_Awesome has quit ["...and the Awesome level drops"]
<mrchebas> hi guys
<mrchebas> where can i find some info about ocaml's garbage collector?
<love-pingoo> scholar.google.com ?
<mrchebas> i hoped for a more precise pointer but thanks anyway :)
<mrchebas> i would like to find out how the GC finds the pointers
jlouis has quit [Remote closed the connection]
jlouis has joined #ocaml
Z4rd0Z has quit []
<mrchebas> thanks guys
* mrchebas checks the links
mrchebas has quit []
love-pingoo has quit ["Connection reset by pear"]
<jacobian> I'm getting an error that netstring and pcre make inconsistent assumptions while compiling ocsigen on ubuntu
<jacobian> anyone seen that before?
<jacobian> Bug #83944 in ocamlnet (Ubuntu)
<jacobian> found it
david_koontz has joined #ocaml
Submarine has quit ["Leaving"]
love-pingoo has joined #ocaml
david_koontz has quit [Read error: 110 (Connection timed out)]
shafire has joined #ocaml
<shafire> hi
<shafire> can i use fastcgi with ocaml?
<mbishop> and ocamlnet has some cgi stuff too
david_koontz has joined #ocaml
<shafire> and fastcgi=
<shafire> ?
malc__ has quit ["leaving"]
shafire has quit ["Verlassend"]
mnemonic has quit ["leaving"]
chealer has joined #ocaml
<chealer> hi. is there an equivalent of - use "foo.sml"; in ocaml, and if so, what is it?
<mikeX> what does that do?
<mikeX> there's #use "foo.ml";; in the toplevel
<chealer> mikeX: hum, really. I get
<chealer> # use "tp2.ml";;
<chealer> Unbound value use
<mikeX> # #use
<chealer> ooh
<chealer> thank you
<mikeX> there's also #load
<mikeX> for loading .cmo/.cmx files
<mikeX> np
_chris has joined #ocaml
cjeris has quit [Read error: 54 (Connection reset by peer)]
smimou has quit ["bli"]
love-pingoo has quit ["Connection reset by pear"]
bluestorm_ has quit ["Konversation terminated!"]
schlumpf_mac has joined #ocaml
forestbuyer has joined #ocaml
forestbuyer has left #ocaml []
schlumpf_mac has left #ocaml []
bluestorm_ has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]