Pelle Månsson Wrote: > On 11/09/2010 06:12 PM, Andrei Alexandrescu wrote: > > On 11/7/10 9:12 PM, Eric Poggel wrote: > >> On 11/7/2010 8:49 PM, Andrei Alexandrescu wrote: > >>> On 11/7/10 5:34 PM, Jesse Phillips wrote: > >>>> Tomek Sowiñski Wrote: > >>>> > >>>>> This wraps up a thread from a few days ago. Pascal featured my D > >>>>> examples > >>>>> on his Scriptometer site. > >>>>> > >>>>> http://rigaux.org/language-study/scripting-language/ > >>>>> > >>>>> D comes 17th out of 28, so it's so-so for scripting. > >>>>> > >>>>> -- > >>>>> Tomek > >>>> > >>>> When I looked over his scoring from the original post, it seemed> 100 > >>>> was a great choice for a scripting language and everything below > >>>> wasn't. D hit where I expected, just good enough to use for scripting. > >>> > >>> Perhaps a module std.scripting could help quite a lot, too. > >>> > >>> Andrei > >> > >> I'm having trouble thinking of something that would go in this module > >> that wouldn't be a better fit somewhere else. What do you envision? > > > > I thought of it for a bit, but couldn't come up with anything :o). I > > think you're right! > > > > Someone proposed to add something like > > http://docs.python.org/library/fileinput.html to Phobos. I think it's a > > good idea. We have all mechanics in place (byLine/byChunk, chain). So it > > should be easy to define byLine to accept an array of filenames: > > > > import std.stdio; > > void main(string args[]) { > > getopt(args, ...); > > foreach (line; File.byLine(args[1 .. $]) { > > ... > > } > > } > > > > I hypothetically made byLine a static method inside File to avoid > > confusing beginners (one might think on first read that byLine goes line > > by line through an array of strings). > > > > > > Andrei > > module std.script; > > public import std.stdio, std.file, std.process, std.algorithm, ... etc > > I use at least some of these for most of my programs/scripts. And > std.all is probably a bit too heavy. > > std.script could basically fetch us enough stuff to be on par with > importless python.
I think optimizing this particular test is important for the publicity of D. Once the scripting community acknowledges D, we could redesign it. We should make all current test cases one liners, if possible. I'm dreaming of a Linux system (Ubuntu) which uses dmd instead of bash to compile all init scripts. The system would boot in just a few seconds.