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!)
qwwqe has joined #ocaml
qwwqe_ has joined #ocaml
qwwqe has quit [Read error: 104 (Connection reset by peer)]
qwwqe_ has quit [Remote closed the connection]
zmdkrbou has quit [Read error: 113 (No route to host)]
psnively has quit []
zarul has quit [Read error: 110 (Connection timed out)]
beschmi has quit ["Leaving"]
zmdkrbou has joined #ocaml
joshcryer has quit [Read error: 104 (Connection reset by peer)]
G has quit [Connection timed out]
joshcryer has joined #ocaml
zarul has joined #ocaml
seafoodX has joined #ocaml
zarul has quit [Read error: 104 (Connection reset by peer)]
zarul has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
G has joined #ocaml
zarul has quit [Read error: 113 (No route to host)]
zarul has joined #ocaml
Submarine has quit [Remote closed the connection]
smimou has joined #ocaml
chs_ has quit [Read error: 110 (Connection timed out)]
zarul has quit [Read error: 113 (No route to host)]
chs_ has joined #ocaml
zarul has joined #ocaml
pants1 has joined #ocaml
zarul has quit [Client Quit]
zarul has joined #ocaml
zarul has quit ["Leaving"]
zarul has joined #ocaml
pants2 has quit [Read error: 110 (Connection timed out)]
eumenides has quit [Read error: 113 (No route to host)]
bluestorm_ has joined #ocaml
smimou has quit ["bli"]
seafoodX has quit [Read error: 110 (Connection timed out)]
seafoodX has joined #ocaml
Mr_Awesome has quit ["...and the Awesome level drops"]
chs_ has quit []
seafoodX has quit []
zarul has quit [No route to host]
zarul has joined #ocaml
zarul has quit [Read error: 113 (No route to host)]
zarul has joined #ocaml
zarul has quit [Remote closed the connection]
<rwmjones> G ping
<flux> if ocaml were to target a new platform, llvm would be interesting..
<rwmjones> llvm?
<flux> ah, maybe I thought of that because I read it off the internet :)
<flux> huh, a real-life developer not aware of llvm? llvm.org :-)
<flux> apple has an objective c compiler for llvm.. or they're writing it
<flux> it's basically a new (..yet another..) vm, with a jit compiler
<rwmjones> it's not related to the internal changes in gcc?
<rwmjones> sasl or whatever it's called?
<flux> I don't know, I think it is somehow involved with gcc
<rwmjones> tree ssa I mean
<flux> I think that in itself has nothing to do with llvm
<flux> I don't know if llvm compiler framework can do that optimization, though
<flux> llvm now works as a gcc backend
<flux> this explains a few things: http://gcc.gnu.org/ml/gcc/2005-11/msg00888.html
<rwmjones> hmmm ... I think a lot of this stuff misses the point of ocamlopt. For me ocamlopt makes a very literal translation of the source into machine code.
<rwmjones> I can optimise the source in obvious ways
<rwmjones> and ocaml has a sensible runtime which is easy to understand
<rwmjones> and happens to run pretty fast
<flux> many believe (me including) that the task of optimizing code should be left to the compiler
<flux> many optimizations in the source level obscure it
<rwmjones> well sure, but I actually only optimise maybe 1% of the code I write
<rwmjones> but then I'm not working in numerical computing or anything like that
<rwmjones> it's mostly network stuff where the cost of going over the network dominates any other consideration
<flux> I've been toying with writing a distributed file storage system
<flux> the reed-solomon encoding can recover (if I recall correctly) about 2 megabytes per second
<flux> that's ok if we're going over the internet, but not ok on the local network - or worse, on localhost
<flux> and I'm quite certain it could be optimized to be a lot faster (writing the inner matrix multiplication loops in C being the "final level"), but at the cost of obscuring the code..
<flux> also it's not very nice when your CPU is 100% when doing that 2 MB/s..
<G> rwmjones: pong
<rwmjones> G, did you see that the OCaml guidelines for Fedora are now approved?
<G> yep
<rwmjones> so basically I'm looking for someone to review & sponsor my packages now
tty56 has joined #ocaml
tty56_ has quit [Read error: 110 (Connection timed out)]
eumenides has joined #ocaml
setog3 has joined #ocaml
<setog3> hi all
<setog3> can someone explain me how caml do recurence .. and the cost of it ?
<setog3> for example what is the best to define the sum of the first n integer ? a sum with rec : sum = n+ sum(n-1) ? or the sum with n/2 * n+1 ?
<lde> setog3: The latter is faster, of course.
<lde> And uses less memory.
<setog3> lde: true..
<setog3> so why using recurence in function ?
<flux> you mean recursion
<flux> right?
<setog3> yes
<flux> recursion is suitable for situations where you need to loop
<flux> like if you needed to sum the integers of a list
<setog3> hmm .. I think that we can't get a formula for all function ..
<flux> or perform newton method of square root
<setog3> flux: so for all maths function we can get a fonctionnal expression .. and we must use it ?
<flux> maths functions are usually expressed in form of, well, functions.. I'd thin it's natural to use functional form in those cases.
<flux> in certain languages the only way to perform an evaluation repeatedly is recursion
<rwmjones> setog3, the compiler doesn't do magic ... if you do the recursive definition of sum, then the compiler implements what you asked for
<setog3> now the question is .. can we define all recurent function with a fonctionnal expression ? ..
<lde> What's a fonctionnal expression?
<rwmjones> setog3, are these exam questions?
<setog3> rwmjones: no only a little question
<lde> You mean an algebraic expression?
<setog3> lde: an expression without recursion
<setog3> yes.. if you can provide a "contre" example .. would be helpfull
<bluestorm_> let rec fac = function 0 -> 1 | n -> n * fac (n - 1)
<bluestorm_> actually, a "without recursion" expression may exist
<setog3> bluestorm_: factorial can be define with a function if I remember my 1 maths year
<setog3> bluestorm_: may ? or may not ?
<lde> It does.
<bluestorm_> i remember of an awful sqrt(2pi)n^n... equivalence
<haelix> the "function" might not be very practical one, though
<haelix> Stirling formula is the equivalent you have in mind
<bluestorm_> thanks
<flux> what was the function with extremely steep rise?
<flux> based on recursion
<haelix> Ackerman ?
<flux> yes, that
<flux> I don't think it can be expressed without recursion?
<setog3> haelix: yes stirling
<setog3> yes.. ackerman ..
<setog3> but ackerman.. is particular ..
<bluestorm_> "is particular" ?
<bluestorm_> what does particular mean ?
<bluestorm_> hum setog3, how do you define * without recursion ?
<bluestorm_> (i mean the nonnegative integers + )
<bluestorm_> hm
<bluestorm_> *
<lde> With iteration?
<bluestorm_> iteration ?
<bluestorm_> what does that mean ? :-°
<lde> bluestorm_: Don't you have some dictionary?
<bluestorm_> hmm
<bluestorm_> i think we're here in a mathematical context
<flux> recursion and iteration are the same thing.
<bluestorm_> my question actually was "how do you mathematically define iteration ?"
<lde> Sum(1,a) b
<setog3> I think that all u-recursive function that arent primite recursive .. can't be defined without recursion : ackerman is one of them
<lde> flux: Not exactly.
<flux> lde, well, are you referring to side effects then?
<lde> flux: Well, mathematically they are.
<flux> lde, what do you exactly mean by iteration? for and while-loops?
<flux> which can be seen to be just another form of writing recursion
<lde> flux: I mean an iterative process, as opposed to a recursive process.
<lde> You can create both kinds with recursion.
<lde> Hm, or do I? :-)
<lde> Ah, yes, and I think not all recursive processes can be created using iteration.
<lde> Therefore recursion and iteration are not exactly the same thing.
<flux> unless you have a stack
<flux> which essentially simulates recursion
<flux> you can run a turing machine without recursion, no?-)
<lde> Ok, you're right.
<setog3> flux: .. I suspect I am right .. the u-recursive function which arent primitive recursive can't be define with a non-recursive fonction.. because they will become primitive recursive ..
<setog3> but can we get a non-recursive fonction for all primitive function ?
<flux> setog3, did you consider the problem about multiplying numbers? you have two sequences of digits, representing two numbers..
<flux> or is that not a primitive function
eumenides has quit [Read error: 110 (Connection timed out)]
<setog3> flux: don't know..
<setog3> I will search a little see you tomorow
<flux> have run researching
<flux> fun even :-)
magius_pendragon has joined #ocaml
visage has joined #ocaml
visage has quit []
magius_p|work has joined #ocaml
DirkT has joined #ocaml
lde` has joined #ocaml
ygrek has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
lde has quit [Success]
lde has joined #ocaml
<bluestorm_> do you know an Ocaml IRC library ?
lde` has quit [Connection timed out]
<bluestorm_> hm
<bluestorm_> savonet seems to have one, actually
noteventime has joined #ocaml
setog3 has quit ["WeeChat 0.2.4"]
chs_ has joined #ocaml
chs_ has quit [Client Quit]
noteventime has quit [Remote closed the connection]
noteventime has joined #ocaml
descender has quit ["Elegance has the disadvantage that hard work is needed to achieve it and a good education to appreciate it. - E. W. Dijkstra"]
chs_ has joined #ocaml
magius_p|work has left #ocaml []
pattern has quit [Read error: 145 (Connection timed out)]
Lena has joined #ocaml
chs_ has quit []
visage has joined #ocaml
pattern has joined #ocaml
pango_- has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_- is now known as pango_
kelaouchi has quit [Remote closed the connection]
kelaouchi has joined #ocaml
visage has quit []
screwt8 has quit [Read error: 104 (Connection reset by peer)]
schme has quit [Remote closed the connection]
schme has joined #ocaml
visage has joined #ocaml
W4Lt3R has joined #ocaml
DirkT has left #ocaml []
W4Lt3R has left #ocaml []
psnively has joined #ocaml
screwt8 has joined #ocaml
mikeX has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
smimou has joined #ocaml
Submarine has joined #ocaml
love-pingoo has joined #ocaml
gunark has joined #ocaml
pants1 has quit [Read error: 110 (Connection timed out)]
pango_ has quit [Remote closed the connection]
pattern has quit [Read error: 104 (Connection reset by peer)]
mikeX_ has joined #ocaml
pattern has joined #ocaml
noteventime has quit [Remote closed the connection]
chs_ has joined #ocaml
mikeX__ has joined #ocaml
mikeX has quit [Read error: 101 (Network is unreachable)]
noteventime has joined #ocaml
magius_p1ndragon has joined #ocaml
mikeX has joined #ocaml
mikeX___ has joined #ocaml
pango_ has joined #ocaml
magius_pendragon has quit [Read error: 110 (Connection timed out)]
BlatioS has joined #ocaml
mikeX_ has quit [Read error: 110 (Connection timed out)]
mikeX__ has quit [Read error: 110 (Connection timed out)]
pants1 has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
visage has quit [Connection timed out]
mikeX___ is now known as mikeX
visage has joined #ocaml
slacker403 is now known as Payo305
zarvok has joined #ocaml
ygrek has quit []
visage has quit []
levi_home has quit [Read error: 110 (Connection timed out)]
Submarine has quit ["in Soviet Russia, Céline Dion owns you"]
pants1 has quit [Read error: 110 (Connection timed out)]
pants1 has joined #ocaml
joshcryer has quit [Read error: 104 (Connection reset by peer)]
joshcryer has joined #ocaml
noteventime has quit [Remote closed the connection]
noteventime has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
magius_p1ndragon is now known as magius_pendragon
setooo has joined #ocaml
<setooo> hi
<setooo> does someone has the log of my conversation today ? about recusion and function ?
<setooo> I don't remember the definition that someone use : something like algebraical function isn't it ?
<psnively> What was the original question?
smimou has quit ["bli"]
<setooo> zmdkrbou ok thanks
<psnively> What was the question again? :-)
magius_pendragon has left #ocaml []
benny has joined #ocaml
<setooo> psnively can we get an algebrical definition for all primitive recusive function
<setooo> like (n * n + 1)/2 for sum(1..n)
<setooo> I search a contre example
<psnively> In other words, can all primitive recursive functions be defined by induction?
<setooo> induction ? not sure .. I want to say without any recursion .. seem to be induction ?
<setooo> psnively but I search a little today .. and the problem with different definitino that I found use reel and limit .. so difficult to use in computer works ..
<setooo> stirling and binnet function for example
<setooo> but would be great if the response is true .. and if we find an algo to transform a primitive recusive functino in something without recursion .. to optimize
<psnively> Oh, can primitive recursion always be replaced with iteration?
<setooo> not exactly iteration
<psnively> Well, you could replace primitive recursion with tail recursion.
<setooo> by a maths function
<psnively> Well, how would you replace the factorial function, for example?
<setooo> psnively yes I know that .. and for factorial we get something like : fonction fac2(n, res):integer{
<setooo> si n <= 1 alors
<setooo> retourne res
<setooo> sinon
<setooo> retourne fac2(n-1,n*res);
<setooo> fin si;
<setooo> }
<setooo> for tail recusive (sorry french)
<psnively> That's fine, yes.
<setooo> but the maths function can be stirling function
benny_ has quit [Read error: 110 (Connection timed out)]
<psnively> Ah, I see.
<zmdkrbou> setooo: that's ugly : you don't want to use stirling function in order to compute factorial
<zmdkrbou> it would be crazy
<psnively> For starters, you only get an approximation to a function that's defined on nat.
<zmdkrbou> (plus stirling doesn't give you exactly the factorial iirc, more like limits stuff)
<psnively> Which strikes me as bizarre.
<setooo> zmdkrbou and to do the sum of the n first number is it ugly to use (n * n+1)/2 .. I know that can be ugly .. and taht it's not a good idea to use limit .. but it's only a question
<setooo> zmdkrbou yes but at the limit you have the good result .. yes you need to use limit .. .. but ... suppose we can
<setooo> sorry for my bad english
<zmdkrbou> setooo: no, (n * n + 1) / 2 for sum(1,n) is ok (it would be stupid to do another way)
pants1 has quit [Read error: 110 (Connection timed out)]
<zmdkrbou> setooo: the ordered list of vertices met in a dfs can probably be obtained by a primitive recursive function
<zmdkrbou> i don't see how you can make an algebraic definition out of that :)
<setooo> zmdkrbou dfs ???
<zmdkrbou> depth-first search
<zmdkrbou> in a graph
<zmdkrbou> anyway, why were you having such a question ?
<zmdkrbou> even if it's possible, the problem of making an algebraical definition for any primitive recursive function is probably undecidable :)
<setooo> zmdkrbou .. yes
<setooo> zmdkrbou yes yes .. but you understand my question thanks.. and if it's not undecidable would be great !!!!
<setooo> sorry I must quit my work .. and go home see you in 1 hour..
setooo has quit []
<psnively> Seems like it'd be harder to compute the function to replace the recursion than just to do the recursion, but whatever.
* zmdkrbou doesn't understand someone leaving work at 1 AM (especially while he was connected from a personal dsl connection)
<psnively> Heh.
<zmdkrbou> psnively: it would be much harder but you would do only once (at "compile time"). anyway this is a dead-end problem, undecidable if not just impossible :)
<psnively> That's my sense too.
BlatioS has quit ["- nbs-irc 2.1 - www.nbs-irc.net -"]
noteventime has quit ["Leaving"]
visage has joined #ocaml
visage has quit [Remote closed the connection]