mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
ita|zzz has quit [Read error: 104 (Connection reset by peer)]
jlouis has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
bzzbzz has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
det has joined #ocaml
jburd has joined #ocaml
filp has joined #ocaml
gim has joined #ocaml
malc_ has joined #ocaml
nuncanada has quit ["Leaving"]
bhall has quit [Read error: 110 (Connection timed out)]
seafood__ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
rwmjones has joined #ocaml
seafood__ has quit []
schme` has joined #ocaml
schme has quit [Connection timed out]
jlouis_ has joined #ocaml
<flux> good morning
jlouis has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
malc__ has joined #ocaml
tiglionabbit has joined #ocaml
malc_ has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
schme` has quit [Connection timed out]
clalfa has joined #ocaml
<clalfa> hello, I'd like to do a nested pattern matching, but I'm encountering some problem
<clalfa> here's my snippet
<clalfa> (a dummy one)
<Yoric[DT]> a few syntax errors
hkBst has joined #ocaml
<Yoric[DT]> clalfa: http://pastie.caboo.se/121165
<clalfa> ok great yoric tu !
screwt8 has quit [Remote closed the connection]
Abo-Marwan has quit [Remote closed the connection]
<clalfa> the real problem was that I didn't use parentheses to distinguish beween the two pattern matching, I suppose
ikaros_ has joined #ocaml
<Yoric[DT]> That's the main problem, yes.
<Yoric[DT]> And that's something the revised syntax fixes.
<Yoric[DT]> (I believe the reloaded syntax also fixes that)
<clalfa> well I'm not really aware of either ocaml syntax revisions or ocaml versions
<flux> hm, so there's a revised syntax of the revised syntax?
<clalfa> I'm just using it in a programming languages course to implement an interpreter for a dummy language
<flux> or revised syntax 2 of the normal syntax?-o
<Yoric[DT]> flux: no, the reloaded syntax seems to be slightly customized version of the normal syntax.
<Yoric[DT]> Essentially, it adds "end" at the end of pattern-matchings, iirc.
<flux> yoric[dt], url?
<Yoric[DT]> I haven't found any documentation, only the module & source code in Camlp4 3.10.
<flux> oh, 3.10 has it
<Yoric[DT]> clalfa: well, one of the niceties of OCaml is that you can customized (or altogether replace) the syntax.
<Yoric[DT]> the "revised syntax" is a more robust syntax, which I personally prefer
<Yoric[DT]> to use it, instead of invoking "ocamlc", invoke "ocamlc -pp camlp4r"
Abo-Marwan has joined #ocaml
<JohnnyL> why would funcitonal programming be slower than their imperative equivilent?
<flux> some fundamental reasons might be that functional programming doesn't allow destructive array updating
<JohnnyL> yeah
<flux> a reason that merely affects it (but can be avoided with a sufficiently smart compiler) is that cpu's are fundamentally imperative, and converting functional code into imperative has something I think could be called impedance mismatch
<JohnnyL> thats what I was thinking too.
<JohnnyL> (at least , looking at OpenGL under ocaml.
<flux> the little opengl coding I've done, those don't look like a bad pair
<JohnnyL> the thought of destructive array updating hadn't crossed my mind though.
<flux> atleast higher order functions are nice
<JohnnyL> i think i may use ocmal as a scripter in my projects. but i'm not sure where it would go.
ikaros has quit [Read error: 110 (Connection timed out)]
<JohnnyL> because everything is in 3d.
<flux> how does that matter?
<JohnnyL> (gl)
<JohnnyL> well, i'm shooting for fps.
<flux> and ocaml is the bottleneck?
<JohnnyL> it may be. i'm far from that point though.
<flux> if you keep pushing same geometries to the gpu, there are ways in opengl to do that efficiently
<JohnnyL> yeah like display lists, etc.
<flux> the most I've done, though, have been perhaps less than 100 surfaces per frame, barely with texture mapping :)
<JohnnyL> the higher you go, the less structure there is.
<JohnnyL> i haven't even done a cube by myself yet (but I am hopefuly).
<flux> coding opengl-stuff could be fun - now only if there weren't only 24 hours in a day..
clalfa has quit ["leafChat IRC client: http://www.leafdigital.com/Software/leafChat/"]
<Yoric[DT]> Last year, to teach myself some OpenGL, I wrote an OpenGL displayer for solutions of the n queens problem.
<JohnnyL> well, i'm out of work. looking to get into some industry. and web programming doesn't appeal to me so...
<Yoric[DT]> It was fun.
<Yoric[DT]> The same code in C was way uglier.
<Yoric[DT]> And I'm relatively convinced that OCaml wasn't any bottleneck there.
<JohnnyL> there is less math in gl programming than i though. it' s mostly logic in games.
<JohnnyL> thought
<Yoric[DT]> Well, the only math I saw in OpenGL was for moving the camera or objects without actually changing their coordinates.
<Yoric[DT]> (i.e. you need to provide the 4d transformation matrix)
<JohnnyL> yeah rotating with sin and cos.
<JohnnyL> funny how it took me a day to learn trigonometry.
<Yoric[DT]> Well, trigonometry doesn't quite stop there :)
<JohnnyL> ok, useful trigonomoetry.
<JohnnyL> :)
ertai has joined #ocaml
ertai has quit [Read error: 110 (Connection timed out)]
jburd has quit [Connection timed out]
Smerdyakov has quit ["vacation"]
Snark has joined #ocaml
seafood_ has joined #ocaml
d2bg has joined #ocaml
ser_ has joined #ocaml
ser_ has quit [Read error: 104 (Connection reset by peer)]
ser_ has joined #ocaml
ser_ has quit [Read error: 104 (Connection reset by peer)]
ser_ has joined #ocaml
ser_ has quit [Read error: 104 (Connection reset by peer)]
sergez has joined #ocaml
sergez has quit [Read error: 104 (Connection reset by peer)]
ertai has joined #ocaml
Tetsuo has quit ["Leaving"]
ttamttam has joined #ocaml
screwt8 has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
filp has quit ["Bye"]
ttamttam has quit ["Leaving."]
Jedai has joined #ocaml
_Jedai_ has joined #ocaml
Torment has quit [Read error: 110 (Connection timed out)]
Jedai has quit [Read error: 110 (Connection timed out)]
seafood_ has quit []
bhall has joined #ocaml
malc_ has joined #ocaml
filp has joined #ocaml
malc__ has quit [Read error: 110 (Connection timed out)]
bluestorm_ has joined #ocaml
ertai has quit [Read error: 110 (Connection timed out)]
_Jedai_ is now known as Jedai
mbishop_ has joined #ocaml
mbishop has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
jlouis has joined #ocaml
ttamttam has joined #ocaml
jlouis_ has quit [Connection timed out]
Snark has quit ["Quitte"]
<det> I don't understand this..
<det> if status=0 then
<det> callback ()
<det> else
<det> Printf.printf "BAD STATUS: %d\n" status
<bluestorm_> what's the problem with this code ?
<det> and it is printing:
<bluestorm_> (printf ?)
<det> "BAD STATUS: 0"
<det> how is that possible?
<bluestorm_> hum
<bluestorm_> does not looks like possible
<bluestorm_> isn't the flaw in another part of the code ? (another BAD STATUS somewhere ?)
<det> No
<bluestorm_> do you know if the callback get called ?
<det> I have isolated this
<det> It does not
<zvrba> if status == 0 .. ?
<zvrba> (should not matter, but)
<bluestorm_> does not matter
<det> I tried that as well
tld3 has joined #ocaml
<zvrba> what is the code in the larger context?
<bluestorm_> are you sure the code you're showing there is actually the one being executed ?
<tld3> Curious: Can I use ocaml, and compile ocaml code into a shared object, which I can load and use from a C application?
<bluestorm_> (is your compilation/execution okay ?)
<zvrba> did you try to run it in debugger?
<tld3> I am curious I mean
<bluestorm_> tld3: yes you can
<tld3> Thanks. :)
<zvrba> det: are you running the correct version of the executable?
<det> Yes
<bluestorm_> away
<det> I'll try debugger
ttamttam has left #ocaml []
<pango> maybe you simplified the code, and in the real code the 'else' doen't match this 'if'... Could you show the whole function in some nopaste service ?
<det> Meh, I fixed it :-)
<zvrba> what was the error?
<det> returning Int_val(status) from C stub code instead of Val_int(status)
<Yoric[DT]> tld3: iirc, it's somewhat undocumented.
<Yoric[DT]> But yes, it's possible.
<det> I am guessing it was lacking the tag bit
<det> So printing it was still 0
<pango> the code you pasted looks correct
<det> yeah
<det> it's not that code
<det> I didn't correctly convert it to a caml value from the C stub code
sergez has joined #ocaml
<pango> det: instead, the gc could have generated a segfault at some later time ;)
<det> :-)
jlouis_ has joined #ocaml
sergez has quit [Connection timed out]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
Abo-Marwan has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
Abo-Marwan has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
<flux> is *.reddit.com down for you?
<flux> (actually, some dns-related problem)
<flux> the main site itself works for me, for some definition of "works"
tiglionabbit has quit ["Lost terminal"]
richardw has joined #ocaml
mbishop_ is now known as mbishop
<flux> never mind, wrong dns server apparently refused to answer to third-level-domain queries :)
pants2 has joined #ocaml
ygrek has quit [Remote closed the connection]
pants2 has quit [Remote closed the connection]
pants2 has joined #ocaml
pants2 has quit [Remote closed the connection]
Zola has quit [Read error: 110 (Connection timed out)]
david_koontz has joined #ocaml
d2bg has left #ocaml []
darinm has joined #ocaml
darinm has quit []
darinm has joined #ocaml
malc_ has quit ["leaving"]
Zola has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
filp has quit ["Bye"]
Yoric[DT] has quit [Read error: 113 (No route to host)]
seafood_ has joined #ocaml
olleolleolle has joined #ocaml
<olleolleolle> A beginner question: Where can I read about how OCaml performs in terms of memory consumption (I want to run it on a wireless access point, think Linksys routers) and other resources?
<olleolleolle> (And hi, by the by.)
hkBst has quit ["Konversation terminated!"]
<olleolleolle> tld3: Thanks. We were kinda looking for that.
<tld3> :)
<tld3> np
<olleolleolle> I'm trying hello world out, compiled with -compact (Optimize code size rather than speed), and trying to inspect the mem consumption.
<olleolleolle> (Next to me is a C hacker, so he's got some perspective on things. Me, a Ruby kid, no sense of proportions.)
<olleolleolle> I need a System.sleep() - any hints?
tld2 has joined #ocaml
<ulfdoz> It is unlikely, that any program more complex than hello world comes near to C in terms of memory consumption.
<darinm> olleolleolle: did you check the reference manual?
<darinm> you can search for sleep there
<olleolleolle> darinm: Excellent. Thanks a lot. I only had Mr Jason Hickey's PDF book until now.
<darinm> np
<olleolleolle> Thanks for not telling me right away how to do it, I was much more helped by getting to read the refman.
<darinm> well, I don't know right away how to do it anyway :)