1Subject: Re: What language would you use? 2From: Tom Christiansen <tchrist@mox.perl.com> 3Date: 6 Nov 1994 15:14:51 GMT 4Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc,comp.lang.perl 5Message-Id: <39irtb$3t4@csnews.cs.Colorado.EDU> 6References: <39b7ha$j9v@zeno.nscf.org> <39hhjp$lgn@csnews.cs.Colorado.EDU> <39hvsu$dus@mathserv.mps.ohio-state.edu> 7 8[...] 9If you're really into benchmarks, I'd love it if someone were to code up 10the following problems in tcl, python, and scheme (and whatever else you'd 11like). Separate versions (one optimized for speed, one for beauty :-) are 12ok. Post your code so we can time it on our own systems. 13 140) Factorial Test (numerics and function calls) 15 16 (we did this already) 17 181) Regular Expressions Test 19 20 Read a file of (extended per egrep) regular expressions (one per line), 21 and apply those to all files whose names are listed on the command line. 22 Basically, an 'egrep -f' simulator. Test it with 20 "vt100" patterns 23 against a five /etc/termcap files. Tests using more elaborate patters 24 would also be interesting. Your code should not break if given hundreds 25 of regular expressions or binary files to scan. 26 272) Sorting Test 28 29 Sort an input file that consists of lines like this 30 31 var1=23 other=14 ditto=23 fred=2 32 33 such that each output line is sorted WRT to the number. Order 34 of output lines does not change. Resolve collisions using the 35 variable name. e.g. 36 37 fred=2 other=14 ditto=23 var1=23 38 39 Lines may be up to several kilobytes in length and contain 40 zillions of variables. 41 423) System Test 43 44 Given a list of directories, report any bogus symbolic links contained 45 anywhere in those subtrees. A bogus symbolic link is one that cannot 46 be resolved because it points to a nonexistent or otherwise 47 unresolvable file. Do *not* use an external find executable. 48 Directories may be very very deep. Print a warning immediately if the 49 system you're running on doesn't support symbolic links. 50 51 52I'll post perl solutions if people post the others. 53 54 55--tom 56-- 57Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com 58 59 "But Billy! A *small* allowance prepares you for a lifetime of small 60 salaries and for your Social Security payments." --Family Circus 61