SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
PL/PERL6
                  	
     	
  	
  @choplin


2010   7   31                               1
       	
  
            @choplin
            Bioinformatician	
  @Perl	
  -­‐>
            Web	
  &	
  DB	
  programmer@Server	
  Side	
  JavaScript
                         @
            okuno.a.aa             gmail.com



2010   7   31                                                            2
Perl

2010   7   31          3
LL   	
  Perl

2010   7   31                   4
2010   7   31   5
Usable	
  Perl6

                Rakudo	
  Star



2010   7   31                     6
?

                    7

2010   7   31           7
Perl6

                  •Smart	
  Match
                  •Junction
                  •etc.

2010   7   31                       8
!




2010   7   31       9
Cool!
2010   7    31                                                                                 10
2010   7   31   11
2010   7   31   12
10




2010   7   31   13
Perl7?

2010   7   31            14
2010   7   31   15
2010   7   31   16
17

2010   7   31        17
 =	
  


                     PL/Perl6

2010   7   31                   18
PL/Perl6

•PL	
  =	
  Procedural	
  Language
•PostgreSQL

•PostgreSQL                 Perl6

2010   7   31                        19
PL/Perl6
                •PL/Parrot	
  (by	
  Jonathan	
  "Duke"	
  
                Leto	
  	
  	
  	
  	
  	
  	
  	
  )	
  


                                             PL/Perl6
                                             PL/Parrot

                                             PostgreSQL
2010   7   31                                                 20
PL/Perl6                  LL

                                                         !
 $psql	
  -­‐C	
  “CREATE	
  FUNCTION	
  hello()	
  
 RETURNS	
  text	
  AS	
  $$	
  return	
  ‘hello’	
  $$	
  
 LANGUAGE	
  plperl6;	
  SELECT	
  hello();”
                        hello()
                        -­‐-­‐-­‐-­‐-­‐-­‐-­‐
                        hello
                                                         21

2010   7   31                                                 21
PL/Perl6

                Perl6	
  :	
  Object	
  Oriented
                                 +
       SQL	
  :	
  Functional	
  Oriented	
  ( )


2010   7   31                                      22
2010   7   31   23
 


2010   7   31          24
SQL


                      25

2010   7   31              25
Map



2010   7   31         26
CREATE	
  FUNCTION	
  perl_array()	
  RETURNS	
  text	
  AS	
  $$
 	
  	
  	
  	
  	
  	
  	
  	
  my	
  $ary	
  =	
  "1t2t3t4";
 	
  	
  	
  	
  	
  	
  	
  	
  return	
  $ary.join('t');
 $$	
  LANGUAGE	
  plperl6;

 CREATE	
  FUNCTION	
  perl_factorial(integer)	
  RETURNS	
  integer	
  AS	
  
 $$
 	
  	
  	
  	
  	
  	
  	
  	
  my	
  $ret	
  =	
  1;
 	
  	
  	
  	
  	
  	
  	
  	
  for	
  1..@_[0]	
  {	
  $ret	
  *=	
  $_	
  }
 	
  	
  	
  	
  	
  	
  	
  	
  return	
  $ret;
 $$	
  LANGUAGE	
  plperl6;

 SELECT
 	
  perl_factorial(elem)
 FROM
 (
 	
  	
  	
  	
  	
  	
  	
  	
  SELECT	
  CAST(unnest(string_to_array(perl_array(),	
  
 't'))	
  AS	
  integer	
  AS	
  elem
 )array
 ;
2010   7   31                                                                              27
Reduce



2010   7   31            28
CREATE	
  FUNCTION	
  perl_array()	
  RETURNS	
  text	
  AS	
  $$
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $ary	
  =	
  "1t2t3t4";
	
  	
  	
  	
  	
  	
  	
  	
  return	
  $ary.join('t');
$$	
  LANGUAGE	
  plperl6;

SELECT
	
  CASE	
  mod(col,	
  2)	
  WHEN	
  0	
  THEN	
  'odd'	
  WHEN	
  1	
  THEN	
  'even'	
  END	
  AS	
  
mod
	
  ,count(col)
FROM
(
	
  	
  	
  	
  	
  	
  	
  	
  SELECT	
  CAST(unnest(string_to_array(perl_array(),	
  
't'))	
  AS	
  integer)	
  AS	
  elem
)array
GROUP	
  BY	
  mod


2010   7   31                                                                                        29
2010   7   31   30
Perl6
           map	
  {factorial($_)},	
  @array;



           my	
  @tmp	
  =	
  map	
  {%count{$_}++},	
  (map	
  {($_	
  %	
  2)	
  ??	
  
           'even'	
  !!	
  'odd'},	
  @ary);
2010   7   31                                                                           31
32

2010   7   31        32
Rakudo	
  Star
                LWP::Simple
                  JSON::Tiny

                                 33

2010   7   31                         33
CREATE	
  FUNCTION	
  twitter_public_timeline()	
  RETURNS	
  text	
  AS	
  $$
	
  	
  	
  	
  	
  	
  	
  	
  use	
  LWP::Simple;
	
  	
  	
  	
  	
  	
  	
  	
  use	
  JSON::Tiny;
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $url	
  =	
  'http://api.twitter.com/1/statuses/
public_timeline.json';
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $lwp	
  =	
  LWP::Simple.new;
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $content	
  =	
  $lwp.get($url);
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $json	
  =	
  from-­‐json($content);
	
  	
  	
  	
  	
  	
  	
  	
  my	
  @ary;
	
  	
  	
  	
  	
  	
  	
  	
  for	
  $json.values	
  -­‐>	
  $post{	
  @ary.push($post<text>)	
  }
	
  	
  	
  	
  	
  	
  	
  	
  return	
  @ary.join("t");
$$	
  LANGUAGE	
  plperl6;

SELECT	
  twitter_public_timeline();



2010   7   31                                                                                          34
psql:twitter.sql:31:	
  server	
  closed	
  the	
  connection	
  
                unexpectedly
                	
  This	
  probably	
  means	
  he	
  server	
  terminated	
  abnormally
                	
  before	
  of	
  while	
  processing	
  the	
  request.
                psql:twiter.sql:31:	
  connection	
  to	
  server	
  was	
  lost



                                                                          ?
                                                                                            35

2010   7   31                                                                                    35
2010   7   31   36
Perl5
CREATE	
  FUNCTION	
  twitter_public_timeline()	
  RETURNS	
  text	
  AS	
  $$
	
  	
  	
  	
  	
  	
  	
  	
  use	
  LWP::Simple;
	
  	
  	
  	
  	
  	
  	
  	
  use	
  JSON;
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $url	
  =	
  'http://api.twitter.com/1/statuses/
public_timeline.json';
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $content	
  =	
  get($url);
	
  	
  	
  	
  	
  	
  	
  	
  my	
  $json	
  =	
  decode_json($content);
	
  	
  	
  	
  	
  	
  	
  	
  my	
  @ary;
	
  	
  	
  	
  	
  	
  	
  	
  for	
  my	
  $post	
  (@{	
  $json	
  }){push(@ary,	
  $post-­‐>{text})}
	
  	
  	
  	
  	
  	
  	
  	
  return	
  join	
  "t",	
  @ary;
$$	
  LANGUAGE	
  plperlu;

SELECT	
  twitter_public_timeline;



2010   7   31                                                                                              37
$psql -f twitter_perl5.sql
                                     twitter_public_timeline
                                                                                                                                                        !
   --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   putzz pensei qe era minaa :X (@piconn live on http://twitcam.com/1ezjg)
    Ok el #TL esta demasiado X.. chao pescao!
                                        (/_;)
   Royal Links in Vegas Simulates British Open Venues http://bit.ly/bBJcIT
   Calling my sister & i'm scared.
   "a necessidade de se manter um histórico é a de poder reler, ver
   erros e corrigi-los...e pq é engraçado reler as lezeras de sempre ^^"
   será que isso é a esperança do meu curso de fotografia indo embora? ):
   alhamdulillah uang 50 rb dr gd. Q gue yg ilang entah berantah,skr d
   ganti berkali lipat dr gd. Q jg,terima kasih Allah :)

   RT @amochoco:
   Jahatttt gak boleh ijin...hikss
   How To Make Money Blogging... Big Money http://bit.ly/aIkMuu
          3
                                                            !!!
                                                                                                            ♪                                                   RT @9_kumi_3:
   @NaluHawaii                                                                                                                                                             ♪
    kasih gue kelinci dong..
    sinceramente, eu acho que eu vou chorar quando Hannah Montana
   acabar... eu sou muuuuuito apaixonada por essa série...
    Photo: manhattan skyline http://tumblr.com/xxwel6auo
    Shit playin cards drinkin what's up???!!




                          Perl5                                                                                                                                                                   !
    mission accomplished.!!
   (20 rows)




                                                                                                                                                                                                                           38

2010   7   31                                                                                                                                                                                                                      38
 


2010   7   31          39
!!?


                http://leto.net/dukeleto.pl/2010/06/rakudo-­‐perl-­‐6-­‐in-­‐your-­‐postgresql-­‐database.html

2010   7   31                                                                                                    40
Leto	
  ++,	
  Moritz	
  Lenz++




           http://groups.google.com/group/plparrot/browse_thread/thread/7aebe2e5a043e175



2010   7   31                                                                              41
    	
  

                PL/Perl6

2010   7   31                  42
SQL
2010   7   31   43
See	
  more	
  about	
  PL/Parrot	
  and	
  PL/Perl6
                     http://pl.parrot.org/
                     http://github.com/leto/plparrot
                     http://groups.google.com/group/plparrot



2010   7   31                                                          44

Mais conteúdo relacionado

Mais procurados

PHP Performance SfLive 2010
PHP Performance SfLive 2010PHP Performance SfLive 2010
PHP Performance SfLive 2010De Cock Xavier
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlNova Patch
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPAdam Englander
 
Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Workhorse Computing
 
On UnQLite
On UnQLiteOn UnQLite
On UnQLitecharsbar
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략Jeen Lee
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.Workhorse Computing
 
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationBASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationWorkhorse Computing
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101bokonen
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationWorkhorse Computing
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門lestrrat
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEThiago Rondon
 

Mais procurados (20)

PHP Performance SfLive 2010
PHP Performance SfLive 2010PHP Performance SfLive 2010
PHP Performance SfLive 2010
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in Perl
 
Perl6 grammars
Perl6 grammarsPerl6 grammars
Perl6 grammars
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
Findbin libs
Findbin libsFindbin libs
Findbin libs
 
Metadata-driven Testing
Metadata-driven TestingMetadata-driven Testing
Metadata-driven Testing
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHP
 
Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!
 
On UnQLite
On UnQLiteOn UnQLite
On UnQLite
 
Perl6 in-production
Perl6 in-productionPerl6 in-production
Perl6 in-production
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
 
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationBASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic Interpolation
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
 
Short Introduction To "perl -d"
Short Introduction To "perl -d"Short Introduction To "perl -d"
Short Introduction To "perl -d"
 

Semelhante a 2010/7/31 LTの虎@LL Tiger

PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges✅ William Pinaud
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tourSimon Proctor
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tourSimon Proctor
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Paulo Morgado
 
Massively Parallel Processing with Procedural Python (PyData London 2014)
Massively Parallel Processing with Procedural Python (PyData London 2014)Massively Parallel Processing with Procedural Python (PyData London 2014)
Massively Parallel Processing with Procedural Python (PyData London 2014)Ian Huston
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016Raimon Ràfols
 
Drupal 8 multilingual APIs
Drupal 8 multilingual APIsDrupal 8 multilingual APIs
Drupal 8 multilingual APIsGábor Hojtsy
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()daewon jeong
 
The bytecode mumbo-jumbo
The bytecode mumbo-jumboThe bytecode mumbo-jumbo
The bytecode mumbo-jumboRaimon Ràfols
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from insidejulien pauli
 
Python and rust 2018 pythonkorea jihun
Python and rust 2018 pythonkorea jihunPython and rust 2018 pythonkorea jihun
Python and rust 2018 pythonkorea jihunJIHUN KIM
 
Old Oracle Versions
Old Oracle VersionsOld Oracle Versions
Old Oracle VersionsJeffrey Kemp
 

Semelhante a 2010/7/31 LTの虎@LL Tiger (20)

Introducing perl6
Introducing perl6Introducing perl6
Introducing perl6
 
Php 7 evolution
Php 7 evolutionPhp 7 evolution
Php 7 evolution
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Apache pig
Apache pigApache pig
Apache pig
 
Plpgsql internals
Plpgsql internalsPlpgsql internals
Plpgsql internals
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#
 
Massively Parallel Processing with Procedural Python (PyData London 2014)
Massively Parallel Processing with Procedural Python (PyData London 2014)Massively Parallel Processing with Procedural Python (PyData London 2014)
Massively Parallel Processing with Procedural Python (PyData London 2014)
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016
 
Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 
Full Stack Clojure
Full Stack ClojureFull Stack Clojure
Full Stack Clojure
 
Drupal 8 multilingual APIs
Drupal 8 multilingual APIsDrupal 8 multilingual APIs
Drupal 8 multilingual APIs
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
 
The bytecode mumbo-jumbo
The bytecode mumbo-jumboThe bytecode mumbo-jumbo
The bytecode mumbo-jumbo
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from inside
 
Python and rust 2018 pythonkorea jihun
Python and rust 2018 pythonkorea jihunPython and rust 2018 pythonkorea jihun
Python and rust 2018 pythonkorea jihun
 
Perl 101
Perl 101Perl 101
Perl 101
 
Old Oracle Versions
Old Oracle VersionsOld Oracle Versions
Old Oracle Versions
 

Mais de Akihiro Okuno

qpstudy 2013.07 NoSQL
qpstudy 2013.07 NoSQLqpstudy 2013.07 NoSQL
qpstudy 2013.07 NoSQLAkihiro Okuno
 
カジュアルにソースコードリーディング
カジュアルにソースコードリーディングカジュアルにソースコードリーディング
カジュアルにソースコードリーディングAkihiro Okuno
 
Write parser with fun!
Write parser with fun!Write parser with fun!
Write parser with fun!Akihiro Okuno
 
groonga with PostgreSQL
groonga with PostgreSQLgroonga with PostgreSQL
groonga with PostgreSQLAkihiro Okuno
 
Start Vim script @Ujihisa.vim 2011/11/19
Start Vim script @Ujihisa.vim 2011/11/19Start Vim script @Ujihisa.vim 2011/11/19
Start Vim script @Ujihisa.vim 2011/11/19Akihiro Okuno
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730Akihiro Okuno
 
第一回Mongo dbソースコードリーディング 20110628
第一回Mongo dbソースコードリーディング 20110628第一回Mongo dbソースコードリーディング 20110628
第一回Mongo dbソースコードリーディング 20110628Akihiro Okuno
 

Mais de Akihiro Okuno (8)

qpstudy 2013.07 NoSQL
qpstudy 2013.07 NoSQLqpstudy 2013.07 NoSQL
qpstudy 2013.07 NoSQL
 
カジュアルにソースコードリーディング
カジュアルにソースコードリーディングカジュアルにソースコードリーディング
カジュアルにソースコードリーディング
 
SQLの話
SQLの話SQLの話
SQLの話
 
Write parser with fun!
Write parser with fun!Write parser with fun!
Write parser with fun!
 
groonga with PostgreSQL
groonga with PostgreSQLgroonga with PostgreSQL
groonga with PostgreSQL
 
Start Vim script @Ujihisa.vim 2011/11/19
Start Vim script @Ujihisa.vim 2011/11/19Start Vim script @Ujihisa.vim 2011/11/19
Start Vim script @Ujihisa.vim 2011/11/19
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
 
第一回Mongo dbソースコードリーディング 20110628
第一回Mongo dbソースコードリーディング 20110628第一回Mongo dbソースコードリーディング 20110628
第一回Mongo dbソースコードリーディング 20110628
 

Último

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

2010/7/31 LTの虎@LL Tiger

  • 1. PL/PERL6      @choplin 2010 7 31 1
  • 2.    @choplin  Bioinformatician  @Perl  -­‐>  Web  &  DB  programmer@Server  Side  JavaScript  @  okuno.a.aa gmail.com 2010 7 31 2
  • 3. Perl 2010 7 31 3
  • 4. LL  Perl 2010 7 31 4
  • 5. 2010 7 31 5
  • 6. Usable  Perl6 Rakudo  Star 2010 7 31 6
  • 7. ? 7 2010 7 31 7
  • 8. Perl6 •Smart  Match •Junction •etc. 2010 7 31 8
  • 9. ! 2010 7 31 9
  • 10. Cool! 2010 7 31 10
  • 11. 2010 7 31 11
  • 12. 2010 7 31 12
  • 13. 10 2010 7 31 13
  • 14. Perl7? 2010 7 31 14
  • 15. 2010 7 31 15
  • 16. 2010 7 31 16
  • 17. 17 2010 7 31 17
  • 18.  =   PL/Perl6 2010 7 31 18
  • 19. PL/Perl6 •PL  =  Procedural  Language •PostgreSQL •PostgreSQL Perl6 2010 7 31 19
  • 20. PL/Perl6 •PL/Parrot  (by  Jonathan  "Duke"   Leto                )   PL/Perl6 PL/Parrot PostgreSQL 2010 7 31 20
  • 21. PL/Perl6 LL ! $psql  -­‐C  “CREATE  FUNCTION  hello()   RETURNS  text  AS  $$  return  ‘hello’  $$   LANGUAGE  plperl6;  SELECT  hello();” hello() -­‐-­‐-­‐-­‐-­‐-­‐-­‐ hello 21 2010 7 31 21
  • 22. PL/Perl6 Perl6  :  Object  Oriented + SQL  :  Functional  Oriented  ( ) 2010 7 31 22
  • 23. 2010 7 31 23
  • 24.   2010 7 31 24
  • 25. SQL 25 2010 7 31 25
  • 26. Map 2010 7 31 26
  • 27. CREATE  FUNCTION  perl_array()  RETURNS  text  AS  $$                my  $ary  =  "1t2t3t4";                return  $ary.join('t'); $$  LANGUAGE  plperl6; CREATE  FUNCTION  perl_factorial(integer)  RETURNS  integer  AS   $$                my  $ret  =  1;                for  1..@_[0]  {  $ret  *=  $_  }                return  $ret; $$  LANGUAGE  plperl6; SELECT  perl_factorial(elem) FROM (                SELECT  CAST(unnest(string_to_array(perl_array(),   't'))  AS  integer  AS  elem )array ; 2010 7 31 27
  • 28. Reduce 2010 7 31 28
  • 29. CREATE  FUNCTION  perl_array()  RETURNS  text  AS  $$                my  $ary  =  "1t2t3t4";                return  $ary.join('t'); $$  LANGUAGE  plperl6; SELECT  CASE  mod(col,  2)  WHEN  0  THEN  'odd'  WHEN  1  THEN  'even'  END  AS   mod  ,count(col) FROM (                SELECT  CAST(unnest(string_to_array(perl_array(),   't'))  AS  integer)  AS  elem )array GROUP  BY  mod 2010 7 31 29
  • 30. 2010 7 31 30
  • 31. Perl6 map  {factorial($_)},  @array; my  @tmp  =  map  {%count{$_}++},  (map  {($_  %  2)  ??   'even'  !!  'odd'},  @ary); 2010 7 31 31
  • 32. 32 2010 7 31 32
  • 33. Rakudo  Star LWP::Simple JSON::Tiny 33 2010 7 31 33
  • 34. CREATE  FUNCTION  twitter_public_timeline()  RETURNS  text  AS  $$                use  LWP::Simple;                use  JSON::Tiny;                my  $url  =  'http://api.twitter.com/1/statuses/ public_timeline.json';                my  $lwp  =  LWP::Simple.new;                my  $content  =  $lwp.get($url);                my  $json  =  from-­‐json($content);                my  @ary;                for  $json.values  -­‐>  $post{  @ary.push($post<text>)  }                return  @ary.join("t"); $$  LANGUAGE  plperl6; SELECT  twitter_public_timeline(); 2010 7 31 34
  • 35. psql:twitter.sql:31:  server  closed  the  connection   unexpectedly  This  probably  means  he  server  terminated  abnormally  before  of  while  processing  the  request. psql:twiter.sql:31:  connection  to  server  was  lost ? 35 2010 7 31 35
  • 36. 2010 7 31 36
  • 37. Perl5 CREATE  FUNCTION  twitter_public_timeline()  RETURNS  text  AS  $$                use  LWP::Simple;                use  JSON;                my  $url  =  'http://api.twitter.com/1/statuses/ public_timeline.json';                my  $content  =  get($url);                my  $json  =  decode_json($content);                my  @ary;                for  my  $post  (@{  $json  }){push(@ary,  $post-­‐>{text})}                return  join  "t",  @ary; $$  LANGUAGE  plperlu; SELECT  twitter_public_timeline; 2010 7 31 37
  • 38. $psql -f twitter_perl5.sql twitter_public_timeline ! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- putzz pensei qe era minaa :X (@piconn live on http://twitcam.com/1ezjg) Ok el #TL esta demasiado X.. chao pescao! (/_;) Royal Links in Vegas Simulates British Open Venues http://bit.ly/bBJcIT Calling my sister & i'm scared. "a necessidade de se manter um histórico é a de poder reler, ver erros e corrigi-los...e pq é engraçado reler as lezeras de sempre ^^" será que isso é a esperança do meu curso de fotografia indo embora? ): alhamdulillah uang 50 rb dr gd. Q gue yg ilang entah berantah,skr d ganti berkali lipat dr gd. Q jg,terima kasih Allah :) RT @amochoco: Jahatttt gak boleh ijin...hikss How To Make Money Blogging... Big Money http://bit.ly/aIkMuu 3 !!! ♪ RT @9_kumi_3: @NaluHawaii ♪ kasih gue kelinci dong.. sinceramente, eu acho que eu vou chorar quando Hannah Montana acabar... eu sou muuuuuito apaixonada por essa série... Photo: manhattan skyline http://tumblr.com/xxwel6auo Shit playin cards drinkin what's up???!! Perl5 ! mission accomplished.!! (20 rows) 38 2010 7 31 38
  • 39.   2010 7 31 39
  • 40. !!? http://leto.net/dukeleto.pl/2010/06/rakudo-­‐perl-­‐6-­‐in-­‐your-­‐postgresql-­‐database.html 2010 7 31 40
  • 41. Leto  ++,  Moritz  Lenz++ http://groups.google.com/group/plparrot/browse_thread/thread/7aebe2e5a043e175 2010 7 31 41
  • 42.     PL/Perl6 2010 7 31 42
  • 43. SQL 2010 7 31 43
  • 44. See  more  about  PL/Parrot  and  PL/Perl6 http://pl.parrot.org/ http://github.com/leto/plparrot http://groups.google.com/group/plparrot 2010 7 31 44