Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

24 uses for perl6

286 views

Published on

Slides from my talk at London Perl Workshop 2018 covering a number of Perl6 modules

Published in: Technology
  • Be the first to comment

24 uses for perl6

  1. 1. 24 Uses for Perl6 Adventures in Module Land
  2. 2. Who? ● Simon Proctor ● Senior Developer at Zoopla ● Known as Scimon in most places ● Likes to talk about Perl6 people keep letting me
  3. 3. Why? There are over 1200 modules in the Perl6 ecosystem as of November 2018* I thought it would be nice to highlight some. * There are some duplicates due to modules existing in both Git and CPAN
  4. 4. Disclaimer(s) ● This is not a list of “best” modules merely ones I thought interesting ● Modules are listed alphabetically not ranked (with one exception). ● I picked 24 so I have 2 minutes to talk about each. ● Modules with documentation generally got preference. ● I wrote at least 1 of these.
  5. 5. NativeCall : From the Docs “Call into dynamic libraries that follow the C calling convention”
  6. 6. NativeCall ● In core but has to be specifically imported ● Set of interfaces to work with dynamic libraries ● Allows for using existing compiled libraries easily in Perl6 code ● https://docs.perl6.org/language/nativecall.html
  7. 7. App::GPTrixie : From the Docs “A tool to generate NativeCall code from C headers”
  8. 8. App::GPTrixie ● Give it a C headers file and a selection of options and it will create a basic Native Call wrapper ● The final result will probably need a bit of work to get working but is a good base point ● Allows for faster creation of higher level interfaces to shared libraries ● C++ support on the way.
  9. 9. App::Mi6 : From the Docs “App::Mi6 - minimal authoring tool for Perl6”
  10. 10. App::Mi6 ● Module development tool covers : ○ New Module creation ○ Testing ○ Documentation creation ○ Deployment to CPAN ● Highly recommended if you’re doing any module development even just internally
  11. 11. Bailador : From the Docs “Bailador is a light-weight route-based web application framework for Perl 6”
  12. 12. Bailador ● A web application framework similar in usage to Dancer or Mojolicious ● Templating using Template::Mojo or Template::Mustache ● Features include : ○ Routing ○ Logging ○ Sitemap creation ○ Sessions ○ Configuration
  13. 13. BioPerl6 : From the Docs “Collection of Bioinformatics classes, roles, and modules”
  14. 14. BioPerl6 ● Attempting to redo the BioPerl code in Perl6 ● Currently has the following models implemented : ○ Bio::PrimarySeq ○ Bio::Range ○ Bio::Root ● Looking for people to help ● See also BioInfo
  15. 15. Cairo : From the Docs “Cairo 2D Graphics library binding for Perl 6”
  16. 16. Cairo ● Nice to use wrapper around the Cairo image library ● Creates files in a number of formats including ○ PNG ○ SVG ○ PDF
  17. 17. Color : From the Docs “Format conversion, manipulation, and math operations on colors”
  18. 18. Color ● Color object with operators to manipulate colours ● Handles different colour formats rgb, rgba, cmyk, hsl, hsv ● Manipulation options includes : ○ darken / lighten ○ desaturate / saturate ○ invert ○ rotate (around HSL colour wheel) ● Include custom operators for Color object manipulation
  19. 19. Config : From the Docs “A perl 6 library for reading and writing configuration files”
  20. 20. Config ● Extensible Config file reader and writer ● Available parsers include: ○ JSON ○ TOML ○ YAML
  21. 21. Cro : From the Docs “Cro is a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all Perl 6 has to offer.”
  22. 22. Cro ● Uses Perl6 supplies to manage network requests and responses ● Fully threaded, no need for process management ● Handles out of the box : ○ HTTP/1.1 ○ HTTP/2 ○ HTTPS ○ Websockets ○ ZeroMQ ○ OpenApi 3 ○ Various Authentication schemes including JWT ● For more information check out https://cro.services/docs
  23. 23. Data::Dump : From the Docs “that's right folks, here's a quicky for your data dump needs. if you have Terminal::ANSIColor installed then the output will be so colorful your eyes might bleed.”
  24. 24. Data::Dump ● For when just say $_.perl isn’t enough ● Configurable options for : ○ Indentation ○ Colorisation ○ Recursion ○ Skipping Methods in Object ● Will give a dump of the input. ● Objects will dump the methods with signatures as well as attributes.
  25. 25. DDT : From the Docs “Distribution Development Tool”
  26. 26. DDT ● Tool for creating modules ● Includes build, test and release stages ● Includes auto-generators for: ○ Classes ○ Roles ○ Package ○ Grammars ○ Modules ○ Tests ● Includes a watch option which can execute a given command
  27. 27. Desktop::Notify : From the Docs “a set of simple bindings to libnotify using NativeCall”
  28. 28. Desktop::Notify ● Integrates with the Desktop Notification spec ● Simple interface to allow creating notifications
  29. 29. Jupyter::Kernel : From the Docs “This is a pure-Perl 6 implementation of a Perl 6 kernel for Jupyter notebooks.”
  30. 30. Jupyter::Kernel ● A Pure Perl6 implementation of a Jupyter binder ● Allows running Perl6 in a browser and Jupyter binder ● See also Net::Jupyter and iperl6kernel
  31. 31. Math::Constants : From the Docs A few constants defined in Perl6
  32. 32. Math::Constants ● A selection of mathematical and physics constants including : ○ Gravitational constant as G ○ Speed of light as c, can also be used as a suffix (eg 3c) ○ Golden Ratio as either phi or φ ● And many more
  33. 33. Math::Matrix : From the Docs “Create, compare, compute and measure 2D matrices”
  34. 34. Math::Matrix ● Matrix Mathematics system including: ○ transpose ○ invert ○ negate ○ add ○ multiply ○ dot product ○ tensor product ○ 22 ops ○ 16 boolean properties ○ And more ● In active development
  35. 35. Object::Delayed : From the Docs “Export subs for lazy object creation”
  36. 36. Object::Delayed ● Adds two new keywords ● slack ○ Blocks defined with slack are evaluated when required. ○ Useful for lazy attribute / variable creation ● catchup ○ Blocks defined with catchup are evaluated asynchronously ○ If the block hasn’t finished evaluating when it’s required the code will block until it’s ready
  37. 37. OO::Monitors : From the Docs “A monitor provides per-instance mutual exclusion for objects”
  38. 38. OO::Monitors ● Adds a new class keyword monitor ● A monitor has locking in place the ensures for a given instance only 1 thread can be in it’s method at a time ● Simplifies thread safe coding practices
  39. 39. P5built-ins : From the Docs “Implement Perl 5's built-in functions”
  40. 40. P5built-ins : From the Docs ● Meta module to import Perl6 implementations of Perl5 builtin functions like : ○ abs ○ fc ○ getgrpgid ○ log ○ -e ○ -z ○ __FILE__ ○ __LINE__ ● And many many more 89 functions, 9 file tests and 10 specific terms ● Very handy if you are porting Perl5 code to Perl6
  41. 41. Red : From the Docs “Red - A WiP ORM for raku”
  42. 42. Red ● Perl6 ORM that leverages the Perl6 OO system ● Use traits to define relationships between objects and tables ● Currently Work In Progress looking for contributors ● https://github.com/FCO/Red : More info here
  43. 43. Sparrowdo : From the Docs “Configuration management tool based on sparrow plugins system.”
  44. 44. Sparrowdo ● DSL based system configuration tool for managing servers ● 28 Plugins currently available in the Perl6 Modules list ● Also includes Sparky a CI system
  45. 45. Stats : From the Docs “Perl6 statistics modules. Currently has some basic statistics functions revolving around averages.”
  46. 46. Stats ● Set of functions for doing stats on lists of numbers ○ mean ○ median ○ mode ○ quartiles ○ standard deviation ○ combined summary
  47. 47. SVG::Plot : From the Docs “a simple 2D chart plotter for Perl 6.”
  48. 48. SVG::Plot ● Create SVG graphs including : ○ bars ○ stacked bars ○ lines ○ points ○ bubbles ○ pie charts ● Currently looking for documentation
  49. 49. Terminal::Print : From the Docs “Terminal::Print intends to provide the essential underpinnings of command-line printing, to be the fuel for the fire, so to speak, for libraries which might aim towards 'command-line user interfaces' (CUI), asynchronous monitoring, rogue-like adventures, screensavers, video art, etc.”
  50. 50. Terminal::Print ● Library for printing to a terminal ● Geared towards fast updating terminal apps ● Looks really good for terminal based games ● Includes a selection of examples demonstrating its capabilities.
  51. 51. Trait::Env : From the Docs “Trait to set an attribute from an environment variable.”
  52. 52. Trait::Env ● Allows for simple parsing of Environment variables into Object Attributes or Variables ● Handles: ○ Booleans ○ Ints ○ Strings ○ Defaults ○ Arrays (JSON or separated strings) ○ Hashes (JSON or separated string) ● Simple mapping between variable name and Environment variable name
  53. 53. Uzu : From the Docs “static site generator with built-in web server, file modification watcher, live reload, i18n, themes, and multi-page support”
  54. 54. Uzu ● Static site builder with local web server for development ● Multiple templating options ○ Template6 (based on Template::Toolkit) ○ Mustache ○ Markdown (planned not) ● Internationalization built in ● Under development
  55. 55. Thoughts ● There’s a lot of modules available for Perl6 ● But there’s lots of areas that are ripe for people to write modules for ● A lot of the modules could do with some more people involved ● And some of them could do with a bit more documentation ● NativeCall makes using system libraries really really easy

×