|
#46
|
|
|
|
|
Xah Lee wrote:
>> Java being a pain in the ass in so many ways, doesn't have complex >> numbers as a native datatype. Arne Vajhj wrote: > Scientific computing has never been a high priority for Java. Besides, even if we grant "Java being a pain in the ass in so many ways", unsubstantiated as that toss-off is, it remains to establish that Java is any more a "pain in the ass" than any other computer language, or in any way not inherent to computer languages generally |
|
|
|
#47
|
|
|
|
|
Arne Vajhj wrote:
> Jon Harrop wrote: >> Today != 1999 > > Today is very close to 99 when we talk about the C standard. > > Lot of compiler have not even implemented all of C99. > > Other priorities. Other languages more like. :-) |
|
#48
|
|
|
|
|
Xah Lee wrote:
> Also, please avoid the term “tail call” or “tail recursion”. Instead, > when referring to compiler implementation that optimize recursion code > that is a algorithmically flat iteration, use terms like “optimized > linear recursion implementation” or something similar. Tail recursion is only one special case of tail calls. I was deliberately referring to all tail calls. |
|
#49
|
|
|
|
|
Jon Harrop wrote:
> Arne Vajhj wrote: >> Jon Harrop wrote: >>> Today != 1999 >> Today is very close to 99 when we talk about the C standard. >> >> Lot of compiler have not even implemented all of C99. >> >> Other priorities. > > Other languages more like. :-) Yes. Arne |
|
#50
|
|
|
|
|
Xah Lee <xahlee> writes:
Hi, >> If the recursive call is somewhere in the middle of a function, then >> it cannot be done, because then the caller's state is still needed >> after the call. The "it" in the above sentence is not the recursive call itself, but the tail call optimization cannot be done. > here's a actual elisp code to demonstrate a recursive code that > expresses linear algorithm but the self-reference does not happen at > the end (aka “tail”) the the source code. Yes, recursion works no matter where the recursive call is in the function. But the call stack grows at least linear then, and if it gets too deep, it'll abort. If the last expression in the control flow graph of a function is a recursive call, then the stacking isn't needed and a jump operation can be used instead. So the space complexity shrinks from O(n) where n is the recursion depth to O(x) for some constant x. So if it didn't get clear with my last posting: Sure, recursion always works, but without tail call optimization you need to use a call stack which grows linear to the depth of the function calls. With tail call optimization, which requires that the recursive call is the last thing in a function's control flow, then you can shrink the needed space for the calculation to a constant value. > Therefore, it contradict your claim that the self-call must be at the > end for recursive code to express iteration. I didn't claim that! I claim that it must be at the end of control flow to enable the compiler to do tail call optimization and reduce the space complexity from linear to constant. > if you try not to begin to be a moron, i foresee we could have > fruitful conversation, where i teach you computer science and > mathematical thinking, Thanks, I already have a diploma in computer science. ;-) > To reduce back n forth posts, let me just say here first that you need > to pay attention to distinguish the source code, the algorithm, and > the algorithm produced by the compiler code. With clear awareness of > these distinctions, then we can have better communication. Yes. So what I say is that making a clever source code version of some iterative algorithm where the recursive call is the last thing in a function, can enable the compiler to make machine code that has constant space requirements. Bye, Tassilo [..] |
|
#51
|
|
|
|
|
On Nov 27, 5:59 pm, Jon Harrop <j> wrote:
> XahLee wrote: > > Also, please avoid the term “tailcall” or “tailrecursion”. Instead, > > when referring to compiler implementation that optimize recursion code > > that is a algorithmically flat iteration, use terms like “optimized > > linear recursion implementation” or something similar. > > Tailrecursion is only one special case oftailcalls. I was deliberately > referring to all tail calls. Good point. Xah ∑ http://xahlee.org/ ☄ |
|
#52
|
|
|
|
|
Thank you!
It looks like there are still some cool stuff coming from there! (Hugues Hoppe is my favourite MS research scientist btw): http://research.microsoft.com/~hoppe/ Jon Harrop wrote: [..] |
|
|
|
|
| Similar Threads | |
| comparison of CL and Clojure Can anyone who has had experience with Common Lisp and Clojure be willing to give an even-handed and non-prejudicial comparison of them: similarities and differences,... |
|
| Clojure It is my sad duty to report here that some of the core clojure maintainers, and the clojure Google Group, are experiencing ... difficulties. These difficulties appear to... |
|
| ABCL and Clojure A couple of people wrote to me about porting Qi II to Clojure. What are the specific gains/losses in using ABCL versus Clojure? We've had several goes with ABCL without... |
|
| Have you already switched to Clojure? Have you already switched from CL or Scheme to Clojure? If you did, why? If not, why not? |
|
| CL Community on Clojure I just finished watching Rich Hickey's presentation on his new Lisp dialect and it provoked some thought in me. Being new to Lisp, I'm not fully aware of all the choices that... |
|
|
All times are GMT. The time now is 07:12 PM. | Privacy Policy
|