Weblog: algorithms
in Perl 6
|
|
Description
"Originally designed as an exercise in addition for students, the Fibonacci Sequence has some really interesting mathematical properties. While completely ignoring its unexpected niftiness (and explicit formula), this miraculous sequence is still used as busy work for poor creatures."
Solutions
Status with current release of perl 6 / parrot
Benchmarks
Comparisons against Perl 5, etc
References
Updated by Herbert Breunung on Feb 27 5:02pm
Posted by Aaron TEEJAY Trevena on Jan 18 6:42am
What can I do with Perl 6 today?
What can YOU do with Perl 6 Now, Today, This minute?
Introduction
- Add tasks, exercises, and projects that can be done today with perl 6.
- Include brief explanations:
- How to run?
- What is required?
- Cite benchmarks (e.g. vs Perl 5, Python, Ruby, etc.), if possible.
- Each item should link to a page that gives a summary of its status (possible, buggy, depends on X) and includes or links to examples, benchmarks, articles, code, etc.
- Some places to check for potential content ideas:
Run Some Code
- Get and make Rakudo:
- Get and Make parrot
- svn co https://svn.perl.org/parrot/trunk parrot
- perl ./Configure.pl
- make
- use parrot languages/perl6/perl6.pbc some_code.p6
- Try make perl6 and then you can use ./perl6 some_code.p6
- Download some perl6 examples (from the github perl6-examples repo)
- git clone git://github.com/eric256/perl6-examples.git
- Download more perl6 examples (from the pugs repo)
- svn co http://svn.pugscode.org/pugs/examples/
Solve Mathematical / Computer Science Problems and Exercises
File/Directory Access
- Random Access
- Streams
- Find
- Rsynch
Networking / IPC
- CGI (see November wiki below)
- NMS scripts
- Servers
- Forking
- IPC
- Apache Modules
Database Access
Parsing
- ini files (simple task, just do it!)
- Apache logs
- Aeronautical / Weather Data Feeds
-
Graphics
- Pie chart
- Fractals
- Render Vector / Bitmap Images
- Ascii Art
- 3D Graphics
User Interface
- WIMP GUI
- Curses
- Command line arguments/options
Web Applications
- November - wiki engine (simple CGI, HTML::Template and URI ports live in repo)
Use (Some) Perl 5 Modules from Perl 6
Use Other Languages from Perl 6
See Also
Updated by Herbert Breunung on Jan 31 5:42am
Posted by Aaron TEEJAY Trevena on Dec 29 8:12am
Description
Invented by the French mathematician Édouard Lucas in 1883, this is a mathematical game/puzzle about moving a set of disks between a set of pegs, limited by the following rules :
- Only one disk may be moved at a time.
- Each move consists of taking the upper disk from one of the pegs and sliding it onto another peg, on top of the other disks that may already be present on that peg.
- No disk may be placed on top of a smaller disk.
Solutions
http://svn.pugscode.org/pugs/examples/algorithms/hanoi.pl
Status with current release of perl 6 / parrot
- Parrot 0.5.1 December 2007 : compiler errors - subs and argv not implemented
- Parrot SVN Revision 24336 20 December 2007 : works without // and argv syntax (http://nopaste.snit.ch:8001/11939)
- Parrot SVN Revision 24478 3 January 2008 : works as is
- Pugs SVN revision 18224 : works as is
Benchmarks
1000 iterations with 6 disks - skip output ( or comment on output to file, etc : http://sial.org/pbot/29516 thanks to Stephen Weeks / Tene on #perl6 )
- Pugs revision 18224 ( 1ghz, 640M ram )
- (100 iterations with 1 say per iteration) : real 0m22.611s, user 0m22.384s, sys 0m0.101s
- Parrot revision 24336 ( 1.6ghz, 2G ram )
- (1000 iterations no printing ) : real 0m3.577s, user 0m3.119s, 0m0.452s
- (100 iterations with 1 say per iteration) : real 0m0.841s, user 0m0.694s, sys 0m0.141s
Comparisons against Perl 5, etc
References
Updated by Aaron TEEJAY Trevena on Jan 3 2:31am
Posted by Aaron TEEJAY Trevena on Dec 29 8:46am
|
Weblog Navigation
Loading...
|