From: Ant Sims Date: 2005-04-05T05:14:42+09:00 Subject: Re: Ruby optimization - re-implement in compiled language? On Mon, 04 Apr 2005 07:55:05 +0900, Nikolai Weibull wrote: > Ant Sims, April 4: > >> The algorithms involve quite deep recursive calls (by necessity) > > Are you sure? Perhaps you need to rethink your algorithm. Before you > go rewriting your application in another language, a simpler solution is > to rethink your problem/implementation. > > Other than that, recursion can be sort of expensive, as Ruby doesn't do > tail-call optimizations (yet), Recursion is kinda implicit in the task - one step requires another be performed as part of it's task. The problem is you don't know what a build step will require till it is performed. Sure, you can manually save all state during a process and restore it later, but it's hassle. One thing I'm thinking of adding is a means of guessing what steps another will require based on it's past history. Then prepare them up front so no recursive build process occurs. That gets hard if the step is being rebuilt because the user has corrected an error resulting in an un-buildable dependency, but it presents a nice challenge ... :-) Incidentally, by deep I mean 10 levels max. -- Ant Sims antsims9999@yahoo.co.uk