Enviar pesquisa
Carregar
Perl6 meets JVM
•
5 gostaram
•
5,066 visualizações
Tokuhiro Matsuno
Seguir
YAPC::Asia 2015
Leia menos
Leia mais
Engenharia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 89
Baixar agora
Baixar para ler offline
Recomendados
Test::Kantan - Perl and Testing
Test::Kantan - Perl and Testing
Tokuhiro Matsuno
Perl6 web-app
Perl6 web-app
Tokuhiro Matsuno
Server::Starter meets Java
Server::Starter meets Java
Tokuhiro Matsuno
Asynchronous I/O in Python 3
Asynchronous I/O in Python 3
Feihong Hsu
Paris Monitoring meetup #1 - Zabbix at BlaBlaCar
Paris Monitoring meetup #1 - Zabbix at BlaBlaCar
Jean Baptiste Favre
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
Junichi Ishida
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Tim Bunce
Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)
Tomer Gabel
Recomendados
Test::Kantan - Perl and Testing
Test::Kantan - Perl and Testing
Tokuhiro Matsuno
Perl6 web-app
Perl6 web-app
Tokuhiro Matsuno
Server::Starter meets Java
Server::Starter meets Java
Tokuhiro Matsuno
Asynchronous I/O in Python 3
Asynchronous I/O in Python 3
Feihong Hsu
Paris Monitoring meetup #1 - Zabbix at BlaBlaCar
Paris Monitoring meetup #1 - Zabbix at BlaBlaCar
Jean Baptiste Favre
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
Junichi Ishida
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Tim Bunce
Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)
Tomer Gabel
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011
Tim Bunce
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
Koichi Sakata
Nashorn
Nashorn
Everett Toews
Fluentd in Co-Work
Fluentd in Co-Work
Makoto Haruyama
Developing high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compiler
Vladimir Sedach
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
Xinchen Hui
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
Shengyou Fan
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
Hiroshi SHIBATA
Shall we play a game?
Shall we play a game?
Maciej Lasyk
The Integration of Laravel with Swoole
The Integration of Laravel with Swoole
Albert Chen
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
ColdFusionConference
zlm-cython
zlm-cython
Vladimir Ulogov
CPAN Training
CPAN Training
Pedro Figueiredo
ZLM-Cython Build you first module
ZLM-Cython Build you first module
Vladimir Ulogov
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀
Chen Cheng-Wei
Ruby 2.4 Internals
Ruby 2.4 Internals
Koichi Sasada
Middleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)
Charles Nutter
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
Alexandra Masterson
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
Mais conteúdo relacionado
Mais procurados
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011
Tim Bunce
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
Koichi Sakata
Nashorn
Nashorn
Everett Toews
Fluentd in Co-Work
Fluentd in Co-Work
Makoto Haruyama
Developing high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compiler
Vladimir Sedach
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
Xinchen Hui
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
Shengyou Fan
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
Hiroshi SHIBATA
Shall we play a game?
Shall we play a game?
Maciej Lasyk
The Integration of Laravel with Swoole
The Integration of Laravel with Swoole
Albert Chen
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
ColdFusionConference
zlm-cython
zlm-cython
Vladimir Ulogov
CPAN Training
CPAN Training
Pedro Figueiredo
ZLM-Cython Build you first module
ZLM-Cython Build you first module
Vladimir Ulogov
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀
Chen Cheng-Wei
Ruby 2.4 Internals
Ruby 2.4 Internals
Koichi Sasada
Middleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)
Charles Nutter
Mais procurados
(20)
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
Nashorn
Nashorn
Fluentd in Co-Work
Fluentd in Co-Work
Developing high-performance network servers in Lisp
Developing high-performance network servers in Lisp
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compiler
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
Shall we play a game?
Shall we play a game?
The Integration of Laravel with Swoole
The Integration of Laravel with Swoole
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
zlm-cython
zlm-cython
CPAN Training
CPAN Training
ZLM-Cython Build you first module
ZLM-Cython Build you first module
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀
Ruby 2.4 Internals
Ruby 2.4 Internals
Middleware as Code with mruby
Middleware as Code with mruby
JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)
Semelhante a Perl6 meets JVM
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
Alexandra Masterson
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
Functional Programming in Clojure
Functional Programming in Clojure
Troy Miles
Beyond JVM - YOW Melbourne 2013
Beyond JVM - YOW Melbourne 2013
Charles Nutter
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Nobuo Danjou
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
Keith Bennett
Plack on SL4A in Yokohama.pm #8
Plack on SL4A in Yokohama.pm #8
Yoshiki Kurihara
Leaner microservices with Java 10
Leaner microservices with Java 10
Arto Santala
Pugs: A Perl 6 Implementation
Pugs: A Perl 6 Implementation
Audrey Tang
De Java 8 ate Java 14
De Java 8 ate Java 14
Víctor Leonel Orozco López
Server Locality Using Razor and LLDP - PuppetConf 2014
Server Locality Using Razor and LLDP - PuppetConf 2014
Puppet
De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14
Víctor Leonel Orozco López
First Day With J Ruby
First Day With J Ruby
Praveen Kumar Sinha
HotSpotコトハジメ
HotSpotコトハジメ
Yasumasa Suenaga
DevOps in PHP environment
DevOps in PHP environment
Evaldo Felipe
Racing with Droids
Racing with Droids
Peter Hlavaty
Практики применения JRuby
Практики применения JRuby
.toster
The Enterprise Strikes Back
The Enterprise Strikes Back
Burke Libbey
Node.js und die Oracle-Datenbank
Node.js und die Oracle-Datenbank
Carsten Czarski
GlassFish can support multiple Ruby frameworks ... really ?
GlassFish can support multiple Ruby frameworks ... really ?
Arun Gupta
Semelhante a Perl6 meets JVM
(20)
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
Functional Programming in Clojure
Functional Programming in Clojure
Beyond JVM - YOW Melbourne 2013
Beyond JVM - YOW Melbourne 2013
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
Plack on SL4A in Yokohama.pm #8
Plack on SL4A in Yokohama.pm #8
Leaner microservices with Java 10
Leaner microservices with Java 10
Pugs: A Perl 6 Implementation
Pugs: A Perl 6 Implementation
De Java 8 ate Java 14
De Java 8 ate Java 14
Server Locality Using Razor and LLDP - PuppetConf 2014
Server Locality Using Razor and LLDP - PuppetConf 2014
De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14
First Day With J Ruby
First Day With J Ruby
HotSpotコトハジメ
HotSpotコトハジメ
DevOps in PHP environment
DevOps in PHP environment
Racing with Droids
Racing with Droids
Практики применения JRuby
Практики применения JRuby
The Enterprise Strikes Back
The Enterprise Strikes Back
Node.js und die Oracle-Datenbank
Node.js und die Oracle-Datenbank
GlassFish can support multiple Ruby frameworks ... really ?
GlassFish can support multiple Ruby frameworks ... really ?
Mais de Tokuhiro Matsuno
20190126 yapc tokyo keynote
20190126 yapc tokyo keynote
Tokuhiro Matsuno
最近のPerlバイナリマネージャー Perl 編
最近のPerlバイナリマネージャー Perl 編
Tokuhiro Matsuno
Plenv and perl build, and search.cpan.org
Plenv and perl build, and search.cpan.org
Tokuhiro Matsuno
MyBatis を利用した web application 開発についてのご紹介
MyBatis を利用した web application 開発についてのご紹介
Tokuhiro Matsuno
Yapc fukuoka crust
Yapc fukuoka crust
Tokuhiro Matsuno
Perl6 と web 開発と
Perl6 と web 開発と
Tokuhiro Matsuno
Lineにおけるspring frameworkの活用
Lineにおけるspring frameworkの活用
Tokuhiro Matsuno
Openjdk 入門してみた話
Openjdk 入門してみた話
Tokuhiro Matsuno
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
Tokuhiro Matsuno
Java web application testing
Java web application testing
Tokuhiro Matsuno
Javaで1から10まで書いた話(sanitized)
Javaで1から10まで書いた話(sanitized)
Tokuhiro Matsuno
[jjug] Java と Benchmark
[jjug] Java と Benchmark
Tokuhiro Matsuno
Devel::NYTProf::Apache
Devel::NYTProf::Apache
Tokuhiro Matsuno
MySQL のチューニングについて考えてみた
MySQL のチューニングについて考えてみた
Tokuhiro Matsuno
Archer
Archer
Tokuhiro Matsuno
MySQL::NameLocker
MySQL::NameLocker
Tokuhiro Matsuno
Inside MF
Inside MF
Tokuhiro Matsuno
Web Application FLow
Web Application FLow
Tokuhiro Matsuno
madeye agents
madeye agents
Tokuhiro Matsuno
madeye classes
madeye classes
Tokuhiro Matsuno
Mais de Tokuhiro Matsuno
(20)
20190126 yapc tokyo keynote
20190126 yapc tokyo keynote
最近のPerlバイナリマネージャー Perl 編
最近のPerlバイナリマネージャー Perl 編
Plenv and perl build, and search.cpan.org
Plenv and perl build, and search.cpan.org
MyBatis を利用した web application 開発についてのご紹介
MyBatis を利用した web application 開発についてのご紹介
Yapc fukuoka crust
Yapc fukuoka crust
Perl6 と web 開発と
Perl6 と web 開発と
Lineにおけるspring frameworkの活用
Lineにおけるspring frameworkの活用
Openjdk 入門してみた話
Openjdk 入門してみた話
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
Java web application testing
Java web application testing
Javaで1から10まで書いた話(sanitized)
Javaで1から10まで書いた話(sanitized)
[jjug] Java と Benchmark
[jjug] Java と Benchmark
Devel::NYTProf::Apache
Devel::NYTProf::Apache
MySQL のチューニングについて考えてみた
MySQL のチューニングについて考えてみた
Archer
Archer
MySQL::NameLocker
MySQL::NameLocker
Inside MF
Inside MF
Web Application FLow
Web Application FLow
madeye agents
madeye agents
madeye classes
madeye classes
Último
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
srsj9000
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting .
Satyam Kumar
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
VICTOR MAESTRE RAMIREZ
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
KartikeyaDwivedi3
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
Dr SOUNDIRARAJ N
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
PoojaBan
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
eptoze12
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
rehmti665
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
null - The Open Security Community
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Asst.prof M.Gokilavani
computer application and construction management
computer application and construction management
MariconPadriquez1
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
Alluxio, Inc.
Past, Present and Future of Generative AI
Past, Present and Future of Generative AI
abhishek36461
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
hassan khalil
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
Asst.prof M.Gokilavani
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
ShivangiSharma879191
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
DeepakSakkari2
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
me23b1001
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
ssuser7cb4ff
Último
(20)
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting .
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
computer application and construction management
computer application and construction management
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
Past, Present and Future of Generative AI
Past, Present and Future of Generative AI
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
Perl6 meets JVM
1.
Perl6 + JVM tokuhirom YAPC::Asia
2016
2.
Self Introduction
3.
Amon2,Harriet, Localizer, Minilla, Test::Requires, etc.
4.
Perl6?
5.
This is Rakudo
Star, a useful, usable Perl 6 distribution for "early adopters". 曰く、
6.
useful??
7.
BTW,
8.
Products • nqp: Perl6
subset, to write Perl6 interpreter • rakudo: One of Perl6 implementation
9.
VM Support • Parrot:
VM for… • MoarVM: VM for Perl6 • JVM: VM for Java ← Today’s topic
10.
Why?
11.
Because, I’m using Java
for $DAYJOB
12.
You can use
java libraries, instead of poor Perl6 libraries.
13.
perl6-j is probably
useful for Java developers
14.
で?
15.
How do I
install Perl6?
16.
wget http://rakudo.org/ downloads/star/rakudo- star-2015.07.tar.gz
17.
tar xzvf rakudo- star-2015.07.tar.gz
18.
perl Configure.pl —backends=jvm —gen-nqp --prefix=$HOME/perl6
19.
• make • make
install
20.
Easy
21.
brew install rakudo-star —with-jvm
22.
Then…
23.
Evaluation point as
a Web developer
24.
• Start-up speed •
File access • JSON processing • HTTP client • HTTP Server(Performance) • Access to mysql • use java libraries
25.
Start-up speed
26.
time ./install/bin/perl6-j -e
'say "Hello, YAPC”’ Hello, YAPC ./install/bin/perl6-j -e 'say "Hello, YAPC”' 17.32s user 0.51s system 254% cpu 6.995 total
27.
Slow!
28.
Is JVM slow?
29.
No!
30.
> javac Hello.java >
time java Hello Hello java Hello 0.12s user 0.03s system 116% cpu 0.130 total
31.
time perl -E
'say "Hello, YAPC"' Hello, YAPC perl -E 'say "Hello, YAPC"' 0.04s user 0.04s system 83% cpu 0.094 total
32.
433 times slower
33.
time /usr/local/bin/perl6-m -e
'say "hello"' hello /usr/local/bin/perl6-m -e 'say "hello"' 0.31s user 0.04s system 97% cpu 0.360 total
34.
2. File Access
35.
say slurp("/etc/ passwd")
36.
It works.
37.
3. JSON
38.
use JSON::Tiny; (bundled)
39.
> use JSON::Tiny; >
from-json(‘[1,2,true]').perl [1, 2, Bool::True]
40.
to-json( {“a"=>5.16,"b"=>false,"c"=>[1..5]} )
41.
4. HTTP Client
42.
use LWP::Simple; (Bundled)
43.
> use LWP::Simple >
LWP::Simple.get("http:// 64p.org") <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o$ g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
44.
useful!
45.
But there’s no
legacy encoding support.
46.
> LWP::Simple.get("http:// google.co.jp") Unknown encoding
'shift_jis'
47.
5. DB Access
48.
DB Access uses NativeCall
49.
NativeCall?
50.
FFI - Foreign
Function Interface
51.
Call C API
from Perl6
52.
JNA on JVM
53.
ちな Perl5 だと
54.
require DynaLoader; DynaLoader::dl_install_xsub( "myfork", DynaLoader::dl_find_symbol( DynaLoader::dl_load_file("libc.so"), 'fork' ), ); myfork();
55.
Joke…
56.
use FFI;
57.
そして Perl6 へ。。
58.
use DBDish;
59.
my $dbh = DBIish.connect('SQLite',
: database<thefile.sqlite3>);
60.
cp /usr/local/Cellar/sqlite/ 3.8.9/lib/libsqlite3.dylib ./
61.
Supported DB: PostgreSQL MySQL SQLite3
62.
use DBIish; my $dbh
= DBIish.connect('mysql', :host<127.0.0. 1>, :port(3306), :database<mysql>, :us er<root>, :password('')); my $sth = $dbh.prepare('SHOW TABLES'); $sth.execute(); my $arrayref = $sth.fetchall_arrayref(); $arrayref.perl.say;
63.
How do I
call JNI methods?
64.
sub mysql_affected_rows( OpaquePointer $mysql_client
) returns int32 is native('libmysqlclient') { ... }
65.
It’s easy!!!
66.
You can call
C APIs!
67.
6. HTTP Server
68.
HTTP::Easy::PSGI (bundled)
69.
use HTTP::Easy::PSGI; my $http
= HTTP::Easy::PSGI.new(:port(8080)); my $app = sub (%env) { my $name = %env<QUERY_STRING> || "World"; return [ 200, [ 'Content-Type' => 'text/plain' ], [ "Hello $name" ] ]; } $http.handle($app);
70.
with perl6-m • ab
-n 50 -c 1 http://127.0.0.1:8080/ • Requests per second: 5.95 [#/sec] (mean)
71.
with perl6-j • ab
-n 50 -c 1 http://127.0.0.1:8080/ • Requests per second: 10.60 [#/sec] (mean)
72.
10 threads +
perl6-j • ab -c 10 -n 1000 http://127.0.0.1:8080/ • Requests per second: 22.91 [#/sec] (mean)
73.
Single thread +
perl6-j • single thread • ab -c 10 -n 1000 http://127.0.0.1:8080/ • Requests per second: 17.84 [#/sec] (mean)
74.
ab -n 1000
-c 10 http://127.0.0.1:8080/
75.
Time per request: 550.895
[ms] (mean)
76.
(It doesn’t support concurrency)
77.
7. Call Java
methods
78.
use java::util::zip::CRC32:fro m< java>; my $crc =
CRC32.new();
79.
for 'Hello, Java'.encode('utf-8')
{ $crc.update($_) }
80.
$crc.getValue.say;
81.
it works.
82.
8. GUI
83.
my $frame = JFrame.new("Helloworl d"); $frame.setDefaultClose Operation(1);
84.
my $label =
JLabel.new("Hello, world"); $frame.getContentPane.add($labe l);
85.
$frame.pack(); $frame.setVisible(True)
86.
Demo
87.
use My::Own::Class:from< Java>:jar<hoge.jar>
88.
Conclusion
89.
There is some
issues. But practical than I thought
Baixar agora