<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
<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)]
<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)]
<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 :)