rwmjones changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.1 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
ReachingFarr has quit ["Work's over"]
jlouis has joined #ocaml
thermoplyae has quit ["daddy's in space"]
m3ga has quit ["disappearing into the sunset"]
jlouis_ has quit [Read error: 110 (Connection timed out)]
postalchris has quit [calvino.freenode.net irc.freenode.net]
mwc has joined #ocaml
mwc has quit [Client Quit]
mwc has joined #ocaml
tjohnson has left #ocaml []
dramsay has quit ["This computer has gone to sleep"]
yminsky has joined #ocaml
thermoplyae has joined #ocaml
jstanley has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
kmeyer has joined #ocaml
seafood__ has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
dramsay has joined #ocaml
postalchris has joined #ocaml
postalchris has quit [Client Quit]
mwc has quit [Read error: 110 (Connection timed out)]
maayhem has quit [Remote closed the connection]
AxleLonghorn has joined #ocaml
dramsay has quit ["Leaving"]
Cosmos95 has joined #ocaml
mwc has joined #ocaml
_Azimuth has joined #ocaml
Cosmos95 has quit []
_Azimuth has quit [Remote closed the connection]
kbidd has quit ["Leaving"]
thermoplyae has quit ["daddy's in space"]
thermoplyae has joined #ocaml
<mbishop> Anyone here know if there has been any activity since 2006 on Successor ML/ML2000?
thermoplyae has quit ["daddy's in space"]
pantsd has joined #ocaml
pantsd has left #ocaml []
mwc has quit ["Leaving"]
netx has joined #ocaml
seafood__ has quit []
ttamttam has joined #ocaml
ygrek has joined #ocaml
<tsuyoshi> well, keep in mind that ocaml now generates pic on amd64
AxleLonghorn has left #ocaml []
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
filp has joined #ocaml
kmeyer has quit ["Leaving"]
kmeyer has joined #ocaml
ygrek has quit [Remote closed the connection]
Morphous_ has joined #ocaml
Morphous has quit [Read error: 110 (Connection timed out)]
aziem has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
Tetsuo has joined #ocaml
rwmjones has joined #ocaml
OChameau has joined #ocaml
rwmjones has quit [Remote closed the connection]
rwmjones has joined #ocaml
seafood_ has joined #ocaml
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
g36130 has joined #ocaml
g36130 has quit [Client Quit]
g361301 has quit [Read error: 104 (Connection reset by peer)]
seafood__ has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
mfp has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
jderque has joined #ocaml
StoneNote has quit []
aziem has quit ["Lost terminal"]
rwmjones has quit ["Closed connection"]
rwmjones has joined #ocaml
munga has joined #ocaml
kig has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
Tetsuo has quit ["Leaving"]
g36130 has joined #ocaml
g36130 has quit []
letrec has joined #ocaml
<letrec> Hi! I'd like to write a lexer which handles binary values (as opposed to integers). Can I use genlex?? I'm asking, because genlex recognize 010101 as integers, which is not good. What are my options?
<Yoric[DT]> What do you want to produce when you meet 010101 ?
<rwmjones> letrec, I've no idea about genlex, but what happens if you parse "0b010101"?
<Yoric[DT]> I'm pretty sure it's an integer.
<Yoric[DT]> But anyway, the output values produced by Genlex contain no case for binary.
<petchema> binary values are integers, don't mix up values and representation
<letrec> I think genlex returns Int 1 then String "b"... I'd have a type bin = Bin of string and I'd like it to be used in that case.
<Yoric[DT]> Well, I'm pretty sure genlex is not appropriate.
<letrec> Arbitrary precision binary numbers do not map to ocaml integers
<letrec> So, what do you advise me to use (I'm new to ocaml, so I have no idea).
<petchema> Genlex doesn't fit
<Yoric[DT]> Either ocamllex or ulex.
dramsay has joined #ocaml
seafood__ has quit [Connection timed out]
authentic has quit [Read error: 110 (Connection timed out)]
Cosmos95 has joined #ocaml
seafood_ has joined #ocaml
<flux> the relational algebra library the guy was talking about has been published: http://eigenclass.org/hiki/typed-relational-algebra-in-OCaml
<flux> interesting stuff, apparently usable
seafood_ has quit []
<flux> doesn't support cursor (yet, I suppose)
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
<flux> lots of other stuff is missing too, but a very promising first release (well, a git-snapshot..)
_Azimuth has joined #ocaml
_Azimuth has quit ["ERC Version 5.3 (IRC client for Emacs)"]
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
<kig> what am i doing wrong? http://pastie.caboo.se/148220 is 7x slower than the corresponding C program http://pastie.caboo.se/148221
<rwmjones> kig, did you mean to use the *unsafe* string functions?
sergez_ has joined #ocaml
<rwmjones> kig, do you have any particular test data with that?
<kig> for f in 1 2; do cat /dev/urandom | head -c 1228800 > a$i.dat; done; time cat a1.dat a2.dat | ./blend > /dev/null # what i've been testing with
<kig> and yes, read that unsafe string get is faster than safe (can do bounds checking in blend, so it shouldn't be more segfaulty than doing it for every byte (?))
<rwmjones> kig, your basic problem is with the function 'f'
<rwmjones> blend in OCaml is a higher-order function because you're passing in the closure (f) and calling it each time around the loop
<rwmjones> in the C version, use of macros means this is essentially inlined
<rwmjones> kig, try inlining in the OCaml version too (you can use the C preprocessor with OCaml if that helps - ocamlopt -pp cpp)
<rwmjones> kig, the other problem with the ocaml version is that you recalculate the string offset each time around the loop. gcc (for example) lets you get away with this because it does code motion, but ocamlopt does virtually no optimization despite its name.
<rwmjones> so you should move the calculation out, eg:
<rwmjones> let j = ref 0 in
<rwmjones> for i = 0 to pixels do
<rwmjones> j := !j + 4;
<rwmjones> (* etc using !j *)
<rwmjones> done
<flux> I tried a functorized version, but it was just slower :)
<flux> (I was hoping ocamlopt would have better chances of inlining)
<kig> using refs had no major difference (it might be 10% faster but too much noise in the numbers)
olleolleolle has joined #ocaml
olleolleolle has left #ocaml []
sergez_ has quit [No route to host]
* rwmjones recalls how horrible C macros are
<rwmjones> hmmm, inlining only made about a 30% difference too
<rwmjones> must still be a loop somewhere with a calculation in it ...
<kig> looking at the assembler, the caml code does array bounds checks
<rwmjones> kig, are you still using the *_safe_* functions?
<kig> yes
sergez_ has joined #ocaml
<kig> ahaaa, changing them to unsafe got the time down from 2.2 to 1.7
<kig> (i don't really know what i'm doing, total ocaml newbie)
<rwmjones> kig, I'm down to a factor of 3.5 slower than C++ (it should be within 20-30% of C++ so still miles off) ... I'd definitely urge you to post this on caml-list mailing list, because it's a very interesting problem
<rwmjones> in particularly, very long basic block & using byte operations make this quite different from ordinary optimisation problems I've seen
<kig> compiling the C version with -O2 -march=nocona makes it 3x faster by the way
sergez__ has joined #ocaml
<rwmjones> kig, this helps a lot:
<rwmjones> let max (a : int) b = if a > b then a else b
<rwmjones> let min (a : int) b = if a < b then a else b
sergez_ has quit [Read error: 104 (Connection reset by peer)]
<rwmjones> for some reason the calls to max & min weren't being inlined, but if you define them explicitly then they are
<kig> wow
<rwmjones> kig, I'm within 70% of C now
<petchema> kig: read_bitmap is not a function
<rwmjones> kig, you need to compile that with 'ocamlopt -pp cpp -inline 100 ...'
pango has quit [Remote closed the connection]
<petchema> a1 == a2 because read_bitmap is still not a function
<rwmjones> kig, also note that I increased the loop from 20 to 100 because otherwise it was too quick on my machine
<flux> the cpp macros aren't really pretty, though :)
pango has joined #ocaml
<kig> petchema: aaah, thank you, that's why the outputs didn't match between the caml version and c version
<petchema> btw String.unsafe_[sg]et are exported in String module interface, so you don't need the 'external' workaround (let gb = String.unsafe_get should do just as fine)
pango has quit [Remote closed the connection]
pango has joined #ocaml
robyonrails has joined #ocaml
<rwmjones> kig http://pastie.caboo.se/148253 which is about 70% slower. Note main loop in this is 100 not 20. I think the problem lies in byte addressing the string; looking at the asm seems it's doing lots of extra shifts. *really* post this on caml-list, it'll be interesting to have the experts look at it.
robyonrails has quit ["Leaving"]
gim has quit []
gim has joined #ocaml
sergez__ has quit [Read error: 113 (No route to host)]
marmottine has joined #ocaml
olleolleolle has joined #ocaml
<flux> hm, debian sure does have a fine amount of ocaml packages
olleolleolle has quit []
<letrec> Is the labltk.cma file part of ocaml installation? (Ocaml 3.10)?
<petchema> yup, in `ocamlc -where`/labltk/
<petchema> so you're probably missing -I +labltk, at least
* petchema suggest looking at ocamlfind
filp has quit ["Bye"]
<letrec> ocamlfind not found :)
<letrec> I've built ocaml from the sources
<letrec> Looks like I miss some stuff
<petchema> ocamlfind is not part of standard distribution, but it's really handy
<letrec> Ok, where can I get it?
<letrec> I'll google it
OChameau has quit ["Leaving"]
ttamttam has left #ocaml []
<flux> letrec, if you're building from source, perhaps godi is useful
* flux has lately installed godi on two hosts; it has its problems but in general it's nice
postalchris has joined #ocaml
magnus_ has joined #ocaml
<magnus_> Hi, I am considering an F#/C++ job and I'm wondering how Ocaml and F# compare. Any pointers?
<jonafan> i wouldn't say ocaml has pointers
<jonafan> har har har
<rwmjones> they're different languages
<magnus_> I sensed that was coming :)
<magnus_> what is the most striking difference?
ygrek has joined #ocaml
<ikatz> i don't think F# has functors
<flux> object system is different
ygrek_ has joined #ocaml
bluestorm has joined #ocaml
middayc has joined #ocaml
<hcarty> letrec: I would recommend godi as well for a source install of OCaml
<hcarty> It makes it much easier to get up and running
rwmjones has left #ocaml []
<middayc> hi, which linux distro do you recomment if I also want to do ocaml development?
<smimou> Debian
<middayc> aha good .. I am most used to debian also... does ubuntu have any positives maybe?
Yoric[DT] has joined #ocaml
<smimou> from what I heard ubuntu tends to have more frequently broken ocaml packages
<middayc> aha
<middayc> ok I will rather go with debian then , thanks for the advice
drams has joined #ocaml
<bluestorm> with godi you can basically have a good ocaml support on any linux distribution
<flux> I think debian has even more ocaml-packages than godi..
olleolleolle has joined #ocaml
ttamttam has joined #ocaml
ygrek has quit [Remote closed the connection]
dramsay has quit [Read error: 110 (Connection timed out)]
olleolleolle has left #ocaml []
middayc has quit [Connection timed out]
thelema|away has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
pango has quit ["I shouldn't really be here - dircproxy 1.0.5"]
pango has joined #ocaml
Tetsuo has joined #ocaml
mfp has joined #ocaml
drams has quit [Read error: 110 (Connection timed out)]
jderque has joined #ocaml
jstanley has joined #ocaml
dramsay has joined #ocaml
ita has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
mwc has joined #ocaml
p3l has joined #ocaml
marmottine has quit [Remote closed the connection]
<jstanley> So I have a C shared library that uses an OCaml lib via the FFI. I'd like to use *that* C shared lib from another FFI (in this case, Poly/ML), but don't have the CAMLparam0 (etc.) macros available. Anyone have any suggestions for me?
<jstanley> I was thinking I could either (a) have explicit memory management and marshalling from the ML side, using the global roots or (b) see if I could get the roots-manip macros to have analogues in ML.
<jstanley> Can someone please explain to me how the CAMLreturn() macro in caml/memory.h actually guarantees that the returned result won't be GC'd by OCaml?
olleolleolle has joined #ocaml
<jstanley> It seems like there is a window of vulnerability since the value is stored in a temporary and passed back on the call stack to the caller (who presumably copies said value into a local_roots-registered local, etc).
ygrek_ has quit [Remote closed the connection]
mwc has quit [Remote closed the connection]
thelema|away has joined #ocaml
pango has quit [Remote closed the connection]
ita has quit ["Hasta luego!"]
pango has joined #ocaml
olleolleolle has quit []
postalchris has quit [Read error: 110 (Connection timed out)]
olleolleolle has joined #ocaml
olleolleolle has quit [Client Quit]
<jstanley> Can I use caml_register_global_root() to hold onto any address of a value?
olleolleolle has joined #ocaml
<hcarty> jstanley: You may want to ask on the list - there is generally a better chance one of the INRIA folks will pipe in with help
thelema|away is now known as thelema
<jstanley> hcarty: alrighty, thanks.
love-pingoo has quit ["Connection reset by pear"]
thermoplyae has joined #ocaml
StoneNote has joined #ocaml
middayc has joined #ocaml
ttamttam has left #ocaml []
fradiavalo has quit [Remote closed the connection]
rieux_ has joined #ocaml
rieux__ has joined #ocaml
pango has quit [Remote closed the connection]
postalchris has joined #ocaml
rieux has quit [Read error: 110 (Connection timed out)]
jderque has quit [Read error: 113 (No route to host)]
rieux_ has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
middayc has quit [Connection timed out]
thermoplyae has quit ["daddy's in space"]
dramsay has left #ocaml []
postalchris has quit [Read error: 110 (Connection timed out)]
thermoplyae has joined #ocaml
blackdog_ is now known as blackdog
<jonafan> why is Graphics crazy?
<mbishop> it uses signals, I believe
<jonafan> is it messed up on windows?
<jonafan> it seems to draw quite inconsistently
p3l has left #ocaml []
mwc has joined #ocaml
postalchris has joined #ocaml
Tetsuo has quit ["Leaving"]
postalchris has quit ["Leaving."]
olleolleolle has quit []
rieux__ has quit ["leaving"]
hkBst has quit ["Konversation terminated!"]