Quick jump:  What's new

 
Go to:
 
Weblog: algorithms 
in Perl 6
Fibonacci Sequence

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

      • TODO ***

Benchmarks

      • TODO ***

Comparisons against Perl 5, etc

References

permalink
What can I do with Perl 6 today?


What can YOU do with Perl 6 Now, Today, This minute?

Introduction

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

permalink
Tower of Hanoi

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

permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: