Advertisement

perlbrew yapcasia 2010

flatlander at g0v.tw
Oct. 15, 2010
Advertisement

More Related Content

Advertisement
Advertisement

perlbrew yapcasia 2010

  1. Perl Kang-min Liu @gugod
  2. .meta • twitter.com/gugod • Perl / Javascript / Ruby programmer • CPAN Author for ~100 distributions • perlbrew
  3. perlbrew
  4. perlbrew • A tool to install tons of perls • switch between them • build with customized options (-D -A -U) • build from tarball or git
  5. Usage perlbrew install perl-5.12.2 perlbrew install perl-5.13.5 * Internet connection is required
  6. Usage perlbrew install perl-5.10.1 perlbrew install perl-5.8.8 * Internet connection is required
  7. Usage # git checkout cd ~/src/perl perlbrew install . * Internet connection is not required
  8. Usage perlbrew installed
  9. > perlbrew installed perl-5.10.0 perl-5.10.1 perl-5.11.1 perl-5.11.5 perl-5.12.0 perl-5.12.0-RC0 perl-5.12.0-RC3 perl-5.12.1 perl-5.12.2(*) perl-5.13.0 perl-5.13.2 perl-5.13.4 perl-v5.11.5-15-gd3b0eb1 /Users/gugod/perl5/perlbrew/bin/perl /Users/gugod/perl5/perlbrew/perls/current/ bin/perl /usr/bin/perl
  10. Usage perlbrew switch perl-5.12.2 # Disable perlbrew perlbrew off
  11. Installation curl −LO http://xrl.us/perlbrew chmod +x perlbrew ./perlbrew install
  12. Installation new curl -L http://xrl.us/perlbrewinstall | bash
  13. Installation cpan -i App::perlbrew * Not recommended
  14. Properties • does not require sudo • perl installation are isolated • site_lib, bin, lib • install a new version ≠ upgrade • @INC does not include old site_lib
  15. Benefits • Easier-to-clean perl environments • Nuke the whole thing to clean the mess • Old @INC does not accumulate with old perls
  16. Benefits • per-app isolated perl environments setup. • avoid, in advance, any possible incompatible issues with other apps. • know your site_libs • ‘sudo cpan’ is no more.
  17. Why? • Don’t mess up vendor perl too much. • Learn new stuffs in the dev version of perl. • keep up with the fashion
  18. Why? • Test modules or apps • ... with newer perl • ... with older perl
  19. Why? • Test perl itself • Threaded perl • 64bit perl • performance • smokebrew
  20. Why? • Play dark magic kitchen fire • Devel::Declare, B::*, XS • Better with a perl built with DEBUGING
  21. development • github.com/gugod/App-perlbrew • so many pull requests • 20 contributors • send me pull requests any time!
  22. development • better bash integration / experiments • easy site_lib management (clone / bundle / nuke) • Steal some goodies from Devel::PPPort
  23. ← perlbrew • /usr/local/bin/perl /opt/local/bin/perl /home/gugod/local/bin/perl • site_lib is preserved after upgrade
  24. ← perlbrew • perl is so backward compatible • Ideal for developing and production • keep upgrading perl is generally OK
  25. ← perlbrew • Upgrading CPAN modules isn’t necessarily OK. • Errors happens at runtime, when it’s not binary-compatible. • Developers must correctly specify module dependencies.
  26. ← perlbrew • In CPAN Distribution you do that in Makefile.PL / META.yml • Same tool for App
  27. Simple is Hard • support for legacy code and decisions. • perl, cpan • cpanm, perlbrew: new tools for the current fashion
  28. Thoughts perlbrew « cpanm, rvm
  29. Thoughts • Standalone program • embed non-core modules • very easy distribution • runs a tiny bit faster
  30. Thoughts • « rvm • bash programming master-piece • developer-friendly experiences • production server
  31. Further Thoughts • Test::Continuous • perlbrew • local::lib • App::local::lib::helper • cpanm • cpan-outdated • cpansearch
  32. rapidly improves something a little bit better
  33. rapidly improves something a little bit better ❤
  34. Hates
  35. Hates • CPAN dependency list for $framework is too long • CPAN $modules takes too long to install / tests takes very long time to finish • $software is too fat (eats too much memory space) and slow
  36. Less Hateful • bundle cpan dists with your distribution • PAR / Shipwright / %INC hack • Avoid long dependency list
  37. Less Hateful • smaller, single-purpose • less memory consumption • less sub-commands to be memorized • less memory consumption in your brain • easier to maintain / be faster
  38. cpan install can run 90% faster...
  39. By skiping all tests, cpan install can run 90% faster...
  40. Less Hateful • To skip for tests safely, consult cpantester.org first • A cpan/cpanm plugin shall be written to automates that.
  41. Less Hateful • Solving long dependency list problem is a no-op • if cpan installation is super fast • like < 1 second / module
  42. Fast fists cannot be broken
  43. side projects
  44. cpan-sets • cpan-sets: local::lib switcher wrote in • « rvm gemset, bundler • App::local::lib::helper • experimental project • per-app bundle
  45. cpanfile # Install with: cpanm < cpanfile http://github.com/bestpractical/jifty-dbi/tarball/master http://github.com/bestpractical/jifty/tarball/master http://github.com/bestpractical/jifty-plugin-openid B::Hooks::EndOfScope DateTime Digest::SHA1 Email::Address Exporter::Lite HTML::Entities JiftyX::Markapl JiftyX::ModelHelpers Markapl Regexp::Common Regexp::Common::Email::Address String::BufferStack Sub::Install Text::Markdown::Discount Text::MultiMarkdown UNIVERSAL::require common::sense
  46. perlrocks • rubygems counter-part. • multi-version module install • use perlrocks; # perl5 syntax of ‘use’ use Foo-1.3; • site_lib/rocks/Foo-1.3/lib/Foo.pm • Installation tool (rock)
  47. side projects • github.com/gugod/App-perlbrew • github.com/gugod/cpan-sets • github.com/gugod/perlrocks
  48. Conclusion • github social coding actually works! • Easy distributing is important. • Simple is hard. • Fast is better then slow.
  49. ∞ • Good + Simple + Easy toolkit • Keep new-comers by not frustrating them • Grow the community
  50. Thank You
Advertisement