SlideShare a Scribd company logo
Developing Rich Internet
Applications with Perl and JavaScript
           San Diego.pm talk
             Apr 19 2012
Web application evolution
• Once upon a time, there was a static
  page
• Then came CGI scripts
• Then came client side scripting
• Then came AJAX and asynchronous calls
• What next?
Introducing RIA
•   One possible answer: RIAs
•   Stands for: Rich Internet Applications
•   Many ways to develop, many frameworks
•   I have been exploring Ext JS framework
    for JavaScript
How does it work?
• No (or minimal) HTML/JavaScript
  generation on server side
• All client interaction is done in JavaScript
• All middleware/database stuff is done on
  the server side (platform agnostic)
• Communication is done AJAX style, using
  Ext.Direct RPC protocol
Ext JS Advantages
• Cross browser compatibility (even IE6)
• Really good code and issue separation
• Very low overhead on server side
• Very low traffic (only data goes on wire)
• Clean MVC architecture – easier to
  develop
• But wait, where’s Perl?
Perl shines through
•   Perl can be used to develop server side
•   Does things it does best
•   Works anywhere
•   Really easy to plug in existing code
•   Uses RPC::ExtDirect as the glue
Introducing RPC::ExtDirect
• Abstract module that implements
  Ext.Direct protocol
• Has gateways for CGI, Plack (maybe
  mod_perl in future)
• Compatible down to 5.6.0
• Only one non-core dependency:
  JSON.pm (can be pure Perl)
Using RPC::ExtDirect
1. Declare Action (Class, Namespace):
package Foo::Bar;

use RPC::ExtDirect Action => 'Fubar';

sub foo : ExtDirect(2) {
  my ($class, $arg1, $arg2) = @_;

    # do something, store results in scalar
    my $result = ...;

    return $result;
}
Using RPC::ExtDirect, cont.
2. CGI example part 1, API publisher (api.cgi):

use CGI::ExtDirect;

use My::ExtDirect::Published::Module::Foo;
use My::ExtDirect::Published::Module::Bar;

my $direct = CGI::ExtDirect−>new();

print $direct−>api();   # Prints full HTTP response
Using RPC::ExtDirect, cont.
1. CGI example part 2: request router
use CGI::ExtDirect;

use RPC::ExtDirect::API api_path    => '/extdirect_api',
                        router_path => '/extdirect_router’;

use My::ExtDirect::Published::Module::Foo;
use My::ExtDirect::Published::Module::Bar;

my $direct = CGI::ExtDirect−>new({ debug => 1 });
print $direct−>route(); # Prints full HTTP response
Possible applications
• New stuff from scratch, easy and fast
• Retrofit old applications with shiny Web
  interface
• Convert terminal apps to Web apps (screen
  scraping?)
• Easily hack together Web admin apps using
  proven command line tools
• Gluing together heterogeneous applications
  (Web interface for ancient COBOL app?)
• More and more…
Conclusion
• CMS Webdash live demo (if any)
• Questions? Drop me an email:
Alex Tokarev <tokarev@cpan.org>

More Related Content

PPTX
Proxying DBI with DBD::Gofer and App::Staticperl
PPTX
Automating JavaScript testing with Jasmine and Perl
PDF
Why use Go for web development?
PDF
Asynchronous Programming in Kotlin with Coroutines
PPTX
.Net Core - not your daddy's dotnet
PPTX
.Net Core
PDF
YAPC::EU 2015 - Perl Conferences
PDF
Scala vs ruby
Proxying DBI with DBD::Gofer and App::Staticperl
Automating JavaScript testing with Jasmine and Perl
Why use Go for web development?
Asynchronous Programming in Kotlin with Coroutines
.Net Core - not your daddy's dotnet
.Net Core
YAPC::EU 2015 - Perl Conferences
Scala vs ruby

What's hot (20)

PPTX
Functional Programming in PHP
KEY
About Clack
PPTX
Ruby, the language of devops
PDF
Crystal
PPTX
Migrating .NET Application to .NET Core
PDF
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
PDF
Python to go
PPTX
C#: Past, Present and Future
PPTX
Getting Started with ASP.net Core 1.0
PDF
meet.php #11 - Huston, we have an airbrake
PDF
The New Frontend Toolchain
PDF
Scaling up development of a modular code base
PPTX
PHP and node.js Together
PPTX
Rust kafka-5-2019-unskip
PPT
Next generation frontend tooling
PPTX
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
PDF
Riak at Posterous
PDF
Ruby performance - The low hanging fruit
PPTX
Node.js
PDF
Dev objective2015 lets git together
Functional Programming in PHP
About Clack
Ruby, the language of devops
Crystal
Migrating .NET Application to .NET Core
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Python to go
C#: Past, Present and Future
Getting Started with ASP.net Core 1.0
meet.php #11 - Huston, we have an airbrake
The New Frontend Toolchain
Scaling up development of a modular code base
PHP and node.js Together
Rust kafka-5-2019-unskip
Next generation frontend tooling
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Riak at Posterous
Ruby performance - The low hanging fruit
Node.js
Dev objective2015 lets git together
Ad

Similar to Developing Rich Internet Applications with Perl and JavaScript (20)

PDF
JSON-RPC Proxy Generation with PHP 5
PPTX
Common Gateway Interface ppt
PDF
SERVER SIDE SCRIPTING
ODP
Exploiting the newer perl to improve your plugins
PDF
6. The grid-COMPUTING OGSA and WSRF
KEY
Psgi Plack Sfpm
KEY
Psgi Plack Sfpm
KEY
Plack - LPW 2009
PDF
Json Rpc Proxy Generation With Php
DOC
Perl web programming
PDF
PHP And Web Services: Perfect Partners
KEY
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
PDF
RESTful Services and Distributed OSGi - 04/2009
KEY
Intro to PSGI and Plack
PDF
Slides serverside main
PDF
Php and-web-services-24402
PDF
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
PPT
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
JSON-RPC Proxy Generation with PHP 5
Common Gateway Interface ppt
SERVER SIDE SCRIPTING
Exploiting the newer perl to improve your plugins
6. The grid-COMPUTING OGSA and WSRF
Psgi Plack Sfpm
Psgi Plack Sfpm
Plack - LPW 2009
Json Rpc Proxy Generation With Php
Perl web programming
PHP And Web Services: Perfect Partners
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
RESTful Services and Distributed OSGi - 04/2009
Intro to PSGI and Plack
Slides serverside main
Php and-web-services-24402
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
Ad

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PDF
Modernizing your data center with Dell and AMD
PDF
Empathic Computing: Creating Shared Understanding
PDF
Sensors and Actuators in IoT Systems using pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Modernizing your data center with Dell and AMD
Empathic Computing: Creating Shared Understanding
Sensors and Actuators in IoT Systems using pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Spectroscopy.pptx food analysis technology
Advanced Soft Computing BINUS July 2025.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I

Developing Rich Internet Applications with Perl and JavaScript

  • 1. Developing Rich Internet Applications with Perl and JavaScript San Diego.pm talk Apr 19 2012
  • 2. Web application evolution • Once upon a time, there was a static page • Then came CGI scripts • Then came client side scripting • Then came AJAX and asynchronous calls • What next?
  • 3. Introducing RIA • One possible answer: RIAs • Stands for: Rich Internet Applications • Many ways to develop, many frameworks • I have been exploring Ext JS framework for JavaScript
  • 4. How does it work? • No (or minimal) HTML/JavaScript generation on server side • All client interaction is done in JavaScript • All middleware/database stuff is done on the server side (platform agnostic) • Communication is done AJAX style, using Ext.Direct RPC protocol
  • 5. Ext JS Advantages • Cross browser compatibility (even IE6) • Really good code and issue separation • Very low overhead on server side • Very low traffic (only data goes on wire) • Clean MVC architecture – easier to develop • But wait, where’s Perl?
  • 6. Perl shines through • Perl can be used to develop server side • Does things it does best • Works anywhere • Really easy to plug in existing code • Uses RPC::ExtDirect as the glue
  • 7. Introducing RPC::ExtDirect • Abstract module that implements Ext.Direct protocol • Has gateways for CGI, Plack (maybe mod_perl in future) • Compatible down to 5.6.0 • Only one non-core dependency: JSON.pm (can be pure Perl)
  • 8. Using RPC::ExtDirect 1. Declare Action (Class, Namespace): package Foo::Bar; use RPC::ExtDirect Action => 'Fubar'; sub foo : ExtDirect(2) { my ($class, $arg1, $arg2) = @_; # do something, store results in scalar my $result = ...; return $result; }
  • 9. Using RPC::ExtDirect, cont. 2. CGI example part 1, API publisher (api.cgi): use CGI::ExtDirect; use My::ExtDirect::Published::Module::Foo; use My::ExtDirect::Published::Module::Bar; my $direct = CGI::ExtDirect−>new(); print $direct−>api(); # Prints full HTTP response
  • 10. Using RPC::ExtDirect, cont. 1. CGI example part 2: request router use CGI::ExtDirect; use RPC::ExtDirect::API api_path => '/extdirect_api', router_path => '/extdirect_router’; use My::ExtDirect::Published::Module::Foo; use My::ExtDirect::Published::Module::Bar; my $direct = CGI::ExtDirect−>new({ debug => 1 }); print $direct−>route(); # Prints full HTTP response
  • 11. Possible applications • New stuff from scratch, easy and fast • Retrofit old applications with shiny Web interface • Convert terminal apps to Web apps (screen scraping?) • Easily hack together Web admin apps using proven command line tools • Gluing together heterogeneous applications (Web interface for ancient COBOL app?) • More and more…
  • 12. Conclusion • CMS Webdash live demo (if any) • Questions? Drop me an email: Alex Tokarev <[email protected]>