Perl in Japan
by papix (Shibuya.pm)
PerlCon 2019 (7 August)
Slide 2
Slide 2 text
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)
Slide 3
Slide 3 text
Perl in Japan: Agenda
• Introduce 2 topics about "Perl in Japan"
• Web Service Development
• Community
Slide 4
Slide 4 text
Perl in Japan
~Web Service Development~
Slide 5
Slide 5 text
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
Slide 6
Slide 6 text
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
Slide 7
Slide 7 text
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
Slide 8
Slide 8 text
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...
Slide 9
Slide 9 text
And...
• I don't know much about the Perl outside
Japan.
• I want to discuss with you!
• common / different point with us...
Slide 10
Slide 10 text
No content
Slide 11
Slide 11 text
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...
Slide 12
Slide 12 text
Hatena Bookmark
Slide 13
Slide 13 text
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
Slide 14
Slide 14 text
Mackerel
Slide 15
Slide 15 text
Mackerel
• Server monitoring and management SaaS
• https://mackerel.io
• Replacement for Zabbix, Nagios...
• Using Scala and Go
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
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
Hatena Blog: Code
• Perl ... About 130,000 lines
• Test code ... 20,000 lines
• JavaScript ... About 43,000 lines
Slide 20
Slide 20 text
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...
Slide 21
Slide 21 text
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)
Slide 22
Slide 22 text
Useful Tools We Use
Slide 23
Slide 23 text
Smart::Args
• author: TOKUHIROM
• Module for function's argument validation
Slide 24
Slide 24 text
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
AWS::XRay
• AWS::XRay is AWS X-Ray SDK for Perl
• author: FUJIWARA
• Simple SDK, don't profiling
Slide 35
Slide 35 text
Devel::KYTProf::Logger::XRay
• Connect Devel::KYTProf and AWS::XRay
• author: FUJIWARA
Slide 36
Slide 36 text
Plack::Middleware::XRay
• Plack Middleware for using these modules
• author: FUJIWARA
Slide 37
Slide 37 text
No content
Slide 38
Slide 38 text
No content
Slide 39
Slide 39 text
No content
Slide 40
Slide 40 text
Cool!!!
Slide 41
Slide 41 text
App::PRT
• Command line Perl Refactoring Tool
• author: HITODE
• Replace any package, subroutine, variable
name
• using PPI
Slide 42
Slide 42 text
App::PRT
• For example...
• I want to replace "Message.pm" to
"SampleMessage.pm"
Slide 43
Slide 43 text
App::PRT
• Message.pm is...
Slide 44
Slide 44 text
App::PRT
• and Sample.pm is...
Slide 45
Slide 45 text
App::PRT
• execute prt command
• then...
Slide 46
Slide 46 text
App::PRT
• Completed!!!
• All "Message" was replaced to
"SampleMessage"
Slide 47
Slide 47 text
CPANܑ͞Μ
• ňCPANܑ͞Μʼn means "Super CPAN Bros."
• Display CPAN modules needing update
• Implemented by Ruby
Slide 48
Slide 48 text
CPANܑ͞Μ
Slide 49
Slide 49 text
App::ccu
• ccu = cpanfile-check-updates
https://github.com/akiym/cpanfile-check-updates
• Display renewable modules and those
changes by parsing cpanfile / snapshot
Slide 50
Slide 50 text
And Others...
• We use many CPAN modules...
• Sentry::Raven
• Class::Accessor::Lite::Lazy
• LWPx::ParanoidHandler
• Class::Enumemon
Slide 51
Slide 51 text
Perl in Japan
~Community~
Slide 52
Slide 52 text
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
Slide 53
Slide 53 text
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
Slide 54
Slide 54 text
Japan Perl Association (JPA)
• Our mission is...
• Operate YAPC::Japan (Conference)
• Support local communities
Slide 55
Slide 55 text
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
Slide 56
Slide 56 text
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
Slide 57
Slide 57 text
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
Slide 58
Slide 58 text
YAPC::Japan
• JPA and sponsors support students
• We provide some costs of attending
• We want them to know Perl and learn a lot!!!
Slide 59
Slide 59 text
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...
Slide 60
Slide 60 text
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
Slide 61
Slide 61 text
YAPC::Japan
• Next YAPC::Japan is...
Slide 62
Slide 62 text
YAPC::Japan
• Next YAPC::Japan is...
• YAPC::Kyoto 2020 !!!!!!!!!!!!
• in 27-28 March
Slide 63
Slide 63 text
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
Slide 64
Slide 64 text
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
Slide 65
Slide 65 text
Conclusion
Slide 66
Slide 66 text
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!