Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Perl in Japan

papix
August 07, 2019

Perl in Japan

papix

August 07, 2019
Tweet

More Decks by papix

Other Decks in Technology

Transcript

  1. Perl in Japan
    by papix (Shibuya.pm)
    PerlCon 2019 (7 August)

    View Slide

  2. Self Introduction
    • Takayuki Fukumoto a.k.a papix
    • https://papix.net
    • CPAN: https://metacpan.org/author/PAPIX
    • Board member of Japan Perl Association
    • Vice chairman of next YAPC::Japan
    • Attended YAPC::EU 2015 (Granada)

    View Slide

  3. Perl in Japan: Agenda
    • Introduce 2 topics about "Perl in Japan"
    • Web Service Development
    • Community

    View Slide

  4. Perl in Japan
    ~Web Service Development~

    View Slide

  5. Current status of Perl in Japan
    • About 10 years ago, Perl was very popular
    programming language in Japan
    • Some large SNS / portal service were using
    Perl: Livedoor, DeNA and mixi
    • Many study sessions were held
    • JPA established in 2008

    View Slide

  6. Current status of Perl in Japan
    • In 2019, Perl is not popular in Japan as a
    language for web service development
    • Around 2010, several WAF became popular
    in Japan
    • Rails 3, CakePHP 2.0, Symphony 2.0 etc.
    • Many engineer want to use these WAF

    View Slide

  7. Current status of Perl in Japan
    • Now, many engineers use Ruby (RoR), PHP,
    Go, Python, Scala etc.
    • Static typing language is very popular in
    Japan
    • And many Perl code was replaced other
    language

    View Slide

  8. But...
    • We are using Perl!
    • JPA is still active
    • My company is one of them
    • In this section, I'd like to talk about some
    techniques when we use Perl
    • Architecture, CPAN modules, tools...

    View Slide

  9. And...
    • I don't know much about the Perl outside
    Japan.
    • I want to discuss with you!
    • common / different point with us...

    View Slide

  10. View Slide

  11. Hatena Co., Ltd.
    • Founded in 2001
    • "Hatena" means "?" in Japanese
    • Located in Kyoto and Tokyo
    • Developing many web services using Perl
    and other languages
    • For example...

    View Slide

  12. Hatena Bookmark

    View Slide

  13. Hatena Bookmark
    • Social bookmarking platform in Japan
    • Similar to Reddit, Hacker News, delicious...
    • Replaced from Perl to hybrid of Scala & Perl
    • see also: How we replaced a 10-year-old
    Perl product using Scala

    https://speakerdeck.com/tanishiking/how-we-replaced-a-10-year-old-perl-product-using-scala

    View Slide

  14. Mackerel

    View Slide

  15. Mackerel
    • Server monitoring and management SaaS
    • https://mackerel.io
    • Replacement for Zabbix, Nagios...
    • Using Scala and Go

    View Slide

  16. View Slide

  17. Hatena Blog
    • Self-publishing blog service in Japan
    • Similar to WordPress, Tumblr, Medium...
    • Released in 2011
    • Small developer team
    • 5 engineers, 2 designers, 1 SRE

    View Slide

  18. Hatena Blog: Technology stack
    • Perl
    • (some subcomponents use Go/Scala)
    • JavaScript / TypeScript
    • React.js...
    • MySQL, Redis, Memcache / Nginx, Varnish
    • Some AWS's service
    • GitHub, Slack, Mackerel, Sentry, Jenkins, etc...

    View Slide

  19. Hatena Blog: Code
    • Perl ... About 130,000 lines
    • Test code ... 20,000 lines
    • JavaScript ... About 43,000 lines

    View Slide

  20. Hatena Blog: Our Philosophy of Code
    • "Minimize the code to read by developer"
    • So, we don't use existing WAF!
    • like Mojolicious, Amon2...
    • Build tiny WAF using several CPAN modules:
    • Plack + Router::Simple...
    • Text::Xslate, JSON::XS...

    View Slide

  21. Hatena Blog: Our Philosophy of Code
    • In addition, we don't use convenient ORM
    • like DBIx::Class, Class::DBI...
    • We use DBIx::Sunny (simple DBI wrapper)
    • see also: Strongest Web Service Framework I
    Thought

    https://www.slideshare.net/cho45/yapc-asia-2011 (Japanese)

    View Slide

  22. Useful Tools We Use

    View Slide

  23. Smart::Args
    • author: TOKUHIROM
    • Module for function's argument validation

    View Slide

  24. AWS X-Ray
    • Analyze and debug production
    • Tracing our web service and show details:
    • Time taken to process
    • Show external HTTP request
    • SQL query / fetched row

    View Slide

  25. Awesome!

    View Slide

  26. but...

    View Slide

  27. View Slide

  28. AWS doesn't provide
    X-Ray SDK for Perl!!!!!!!!!!!

    View Slide

  29. Don't worry!

    View Slide

  30. AWS X-Ray + Perl
    • FUJIWARA did it!!!!!!
    • Devel::KYTProf
    • Devel::KYTProf::Logger::XRay
    • AWS::XRay
    • Plack::Middleware::XRay

    View Slide

  31. Devel::KYTProf
    • Lightweight profiler for Perl
    • author: ONISHI
    • KYT means "Kyoto"
    • (because he lives in Kyoto)

    View Slide

  32. Devel::KYTProf
    • Usage is very simple!
    • Just use "Devel::KYTProf" on your code
    • Then...
    • ↑ Furl's profile by Devel::KYTProf

    View Slide

  33. Devel::KYTProf
    • Devel::KYTProf supports for...
    • Cache::Memcached::Fast
    • DBI
    • LWP::UserAgent
    • Furl::HTTP
    • MogileFS::Client
    • Redis::Fast
    • Fluent::Logger
    • AWS::CLIWrapper

    View Slide

  34. AWS::XRay
    • AWS::XRay is AWS X-Ray SDK for Perl
    • author: FUJIWARA
    • Simple SDK, don't profiling

    View Slide

  35. Devel::KYTProf::Logger::XRay
    • Connect Devel::KYTProf and AWS::XRay
    • author: FUJIWARA

    View Slide

  36. Plack::Middleware::XRay
    • Plack Middleware for using these modules
    • author: FUJIWARA

    View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. Cool!!!

    View Slide

  41. App::PRT
    • Command line Perl Refactoring Tool
    • author: HITODE
    • Replace any package, subroutine, variable
    name
    • using PPI

    View Slide

  42. App::PRT
    • For example...
    • I want to replace "Message.pm" to
    "SampleMessage.pm"

    View Slide

  43. App::PRT
    • Message.pm is...

    View Slide

  44. App::PRT
    • and Sample.pm is...

    View Slide

  45. App::PRT
    • execute prt command
    • then...

    View Slide

  46. App::PRT
    • Completed!!!
    • All "Message" was replaced to
    "SampleMessage"

    View Slide

  47. CPANܑ͞Μ
    • ňCPANܑ͞Μʼn means "Super CPAN Bros."
    • Display CPAN modules needing update
    • Implemented by Ruby

    View Slide

  48. CPANܑ͞Μ

    View Slide

  49. App::ccu
    • ccu = cpanfile-check-updates

    https://github.com/akiym/cpanfile-check-updates
    • Display renewable modules and those
    changes by parsing cpanfile / snapshot

    View Slide

  50. And Others...
    • We use many CPAN modules...
    • Sentry::Raven
    • Class::Accessor::Lite::Lazy
    • LWPx::ParanoidHandler
    • Class::Enumemon

    View Slide

  51. Perl in Japan
    ~Community~

    View Slide

  52. Perl Community in Japan
    • As above, Perl is not popular language in
    Japan
    • However, some people still use and enjoy
    using Perl!
    • I'd like to talk about approach to support Perl
    Mongers in Japan

    View Slide

  53. Japan Perl Association (JPA)
    • JPA is a Perl user group in Japan
    • Some companies are participating in JPA
    • And they are nominates board member
    • Board member operate JPA
    • Funds are supported from sponsors

    View Slide

  54. Japan Perl Association (JPA)
    • Our mission is...
    • Operate YAPC::Japan (Conference)
    • Support local communities

    View Slide

  55. YAPC::Japan
    • Conference on Perl in Japan
    • Until 2015, JPA operated YAPC::Asia
    • In 2016, rebooted as YAPC::Japan
    • YAPC::Japan is operated by JPA and some
    volunteer staff

    View Slide

  56. YAPC::Japan
    • Held in some cities:
    • YAPC::Hokkaido 2016 Sapporo
    • YAPC::Kansai 2017 Osaka
    • YAPC::Fukuoka 2017 Hakata
    • YAPC::Okinawa 2017 Onnason
    • YAPC::Tokyo 2018

    View Slide

  57. YAPC::Japan
    • YAPC::Japan is small conference
    • 1-2 times in a year, 1 conference = 1.5 days
    • About 150-200 attendees, 20-30 speakers

    View Slide

  58. YAPC::Japan
    • JPA and sponsors support students
    • We provide some costs of attending
    • We want them to know Perl and learn a lot!!!

    View Slide

  59. YAPC::Japan
    • In YAPC::Japan, we talk about various topics
    • YAPC::Japan is conference of Perl and
    some topics related to Perl
    • For example, infrastructure, team
    management, security, education...

    View Slide

  60. YAPC::Japan
    • Of course, there are many advanced talks
    about Perl!!!
    • Takahiro Shimizu's "How to build
    traditional Perl interpreters" is one of them
    • This is spoken at YAPC::Tokyo 2019

    View Slide

  61. YAPC::Japan
    • Next YAPC::Japan is...

    View Slide

  62. YAPC::Japan
    • Next YAPC::Japan is...
    • YAPC::Kyoto 2020 !!!!!!!!!!!!
    • in 27-28 March

    View Slide

  63. Local Communities
    • There are some pm in Japan
    • Hokkaido.pm, Shibuya.pm, Kichijoji.pm,
    Kansai.pm, Fukuoka.pm, Okinawa.pm...
    • JPA supports these communities
    • Detach a famous Perl Monger to study session
    • Support operational cost

    View Slide

  64. Perl Entrance
    • Introductory class for Perl
    • Teach Perl to inexperienced people
    • JPA supports this community
    • I spoke in YAPC::EU 2015

    https://speakerdeck.com/papix/teaching-and-learning-perl

    View Slide

  65. Conclusion

    View Slide

  66. Conclusion
    • I talked about current status of Perl in Japan
    • Web service developing and Community
    • I'm grad if our knowledge is helpful for you
    • I think we have many things in common and
    differences
    • I'd like to interact with you about them!

    View Slide

  67. Thank you for listening!

    View Slide