SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
Web development with Lua
Programming Language
Introducing Sailor, a web MVC framework in Lua
Etiene Dalcol
@etiene_d
@etiene_d
Sailor!

http://sailorproject.org
Web development with Lua @ GeeCON 2015 @etiene_d
Lua Ladies

http://lualadies.org
Web development with Lua @ GeeCON 2015 @etiene_d
Google Summer of Code
LabLua
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
Advantages
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
better reasons
• It looks cool
(I heard you could make games with it)
Web development with Lua @ GeeCON 2015 @etiene_d
better reasons
• It looks cool
(I heard you could make games with it)
• It’s made in my home country
(In my university to be more precise)
Web development with Lua @ GeeCON 2015 @etiene_d
better reasons
• It looks cool
(I heard you could make games with it)
• It’s made in my home country
(In my university to be more precise)
• It’s easy to learn
Web development with Lua @ GeeCON 2015 @etiene_d
?
?
?
?
?
?Web development with Lua @ GeeCON 2015 @etiene_d
Lua on the web
• Early stage
• cgilua ~ 1995
• Kepler Project ~ 2003
Web development with Lua @ GeeCON 2015 @etiene_d
“ I have myself developed Web sites with pure C++, Java, C#, PHP, and
Python. The easiest way to go was definitely Python. If the libraries existed,
Lua would be not quite as easy to use as Python, but probably quite a bit more
efficient; I think it would become my first choice... if the libraries existed.”
Michael Gogins
“ Recently there was some discussion about mod_lua on the Apache
developers mailing list. I mentioned there that I feel Lua could replace PHP as
the number one web scripting language if mod_lua were stable (i.e. not still in
beta) and it were implemented well (not making some of PHP's mistakes such
as putting everything in the global scope with no consistent naming or
parameter schemes). I've wanted to use Lua for all the things I currently use
PHP for ever since I discovered it.” Rena
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
Why?
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
Servers
• Apache: mod_lua
• Nginx: OpenResty
Web development with Lua @ GeeCON 2015 @etiene_d
Servers
Web development with Lua @ GeeCON 2015 @etiene_d
• Apache: mod_lua
• Nginx: OpenResty
Servers
• Apache: mod_lua
• Nginx: OpenResty
• Xavante
• Others
Web development with Lua @ GeeCON 2015 @etiene_d
Frameworks
• Orbit (2007)
Least known
No significant updates since 2010
MVC
Web development with Lua @ GeeCON 2015 @etiene_d
Frameworks
• Orbit (2007)
Least known
No significant updates since 2010
MVC
• Luvit (2011)
Most popular
Intense development
node.js port 2-4x faster
Web development with Lua @ GeeCON 2015 @etiene_d
Frameworks
• Lapis (2012)
Intense development
Moonscript and Lua
Very well documented
Templater
OpenResty only
Not MVC
Web development with Lua @ GeeCON 2015 @etiene_d
Frameworks
• Lapis (2012)
Intense development
Moonscript and Lua
Very well documented
Templater
OpenResty only
Not MVC
• Others
Complicated, abandoned, poorly documented, license
issues or I never heard about it...
Web development with Lua @ GeeCON 2015 @etiene_d
Sailor!
Web development with Lua @ GeeCON 2015 @etiene_d
Sailor!
Web development with Lua @ GeeCON 2015 @etiene_d
Sailor!
Web development with Lua @ GeeCON 2015 @etiene_d
Sailor!
0.1
(Venus)
0.2
(Mars)
Web development with Lua @ GeeCON 2015 @etiene_d
What exactly is Sailor?
• It’s an MVC web framework
• Completely written in Lua
• Compatible with Apache (mod_lua), Nginx (OpenResty),
Mongoose, Xavante and Lwan
• Compatible with Linux, Windows and Mac
• Compatible with different databases
• MIT License
• Pre alpha v0.2 (Mars)
• 0.3 (Jupiter) will be released TODAY!
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
What (else) is cool about Sailor?
• Routing and friendly URLs
• Session, cookies, include, redirect…
• Lua Pages parsing
• Mail sending
• Simple Object Relational-Mapping
• Validation (valua)
• Basic login and authentication modules
• Form generation
• Themes (Bootstrap integration out of the box)
• App generator (Linux and Mac only)
• Model and CRUD generator
Web development with Lua @ GeeCON 2015 @etiene_d
• Routing and friendly URLs
• Session, cookies, include, redirect…
• Lua Pages parsing
• Mail sending
• Simple Object Relational-Mapping
• Validation (valua)
• Basic login and authentication modules
• Form generation
• Themes (Bootstrap integration out of the box)
• App generator (Linux and Mac only)
• Model and CRUD generator
• Lua at client
What (else) is cool about Sailor?
Web development with Lua @ GeeCON 2015 @etiene_d
Not so great things
• It’s still in early development
• Things are changing fast
• It lacks features
• Documentation
Web development with Lua @ GeeCON 2015 @etiene_d
How to get Sailor!
$ luarocks install sailor
$ sailor_create ‘My App’ /var/www
$ cd /var/www/my_app
$ lua start-server.lua
Web development with Lua @ GeeCON 2015 @etiene_d
Web development with Lua @ GeeCON 2015 @etiene_d
How to get Sailor!
$ luarocks install sailor
$ sailor_create ‘My App’ /var/www
$ cd /var/www/my_app
$ lua start-server.lua
$ luarocks install luasql-mysqlOptional
Web development with Lua @ GeeCON 2015 @etiene_d
/conf
/controllers
/models
/pub
/runtime
/themes
/views
App structure
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
-- /controllers/site.lua
local site = {}
function site.index(page)
local msg = “Hello World”
page:render(‘index’, { msg = msg } )
end
function site.notindex(page)
page:write(“I’m different!”)
end
return site
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
<!-- /views/site/index.lp -->
<p>
A message from the server:
<?lua page:print(msg) ?>
<br/>
The message again:
<%= msg %> <!-- same thing as above —>
</p>
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
<?lua@server -- Code here runs on the server ?>
<?lua -- Same as above ?>
<?lua@client -- Runs at the client ?>
<?lua@both -- Runs at the server and the client ?>
<?lua@both
another_msg = “Another message”
?>
<?lua page:print(another_msg) ?>
<?lua@client
js.window.alert(another_msg)
?>
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
local user = {}
local v = require “valua” -- validation module
user.attributes = {
{ id = “safe” },
{ name = v:new().not_empty() }
}
user.db = {
key = ‘id’,
table = ‘users’
}
user.relations = {
posts = { -- u.posts
relation = “HAS_MANY”, model = “post”, attribute = “author_id”
}
}
return user
Web development with Lua @ GeeCON 2015 @etiene_d
Example!
-- /controllers/site.lua
local site = {}
function site.index(page)
local User = sailor.model(‘user’)
local u = User:new()
u.name = ‘Arnold’
local msg
if u:save() then
msg = ‘Success’
else
msg = table.unpack(u.errors)
end
local users = User:find_all()
page:render(‘index’, { msg = msg, users = users } )
end
return site
Web development with Lua @ GeeCON 2015 @etiene_d
sailorproject.org
github.com/Etiene/sailor
dalcol@etiene.net
@etiene_d
Example!
Web development with Lua @ GeeCON 2015 @etiene_d
sailorproject.org
github.com/Etiene/sailor
dalcol@etiene.net
@etiene_d

Contenu connexe

Tendances

Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexRyan Weaver
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger
 
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...Matt Gauger
 
React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN StackTroy Miles
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatGrand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatRyan Weaver
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground UpJoe Ferguson
 
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itDrupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itRyan Weaver
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIsmdawaffe
 
Life Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsLife Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsTristan Gomez
 
Wieldy remote apis with Kekkonen - ClojureD 2016
Wieldy remote apis with Kekkonen - ClojureD 2016Wieldy remote apis with Kekkonen - ClojureD 2016
Wieldy remote apis with Kekkonen - ClojureD 2016Metosin Oy
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
Creating a modern web application using Symfony API Platform Atlanta
Creating a modern web application using  Symfony API Platform AtlantaCreating a modern web application using  Symfony API Platform Atlanta
Creating a modern web application using Symfony API Platform AtlantaJesus Manuel Olivas
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016Metosin Oy
 
Gotta Persist 'Em All: Realm as Replacement for SQLite
Gotta Persist 'Em All: Realm as Replacement for SQLiteGotta Persist 'Em All: Realm as Replacement for SQLite
Gotta Persist 'Em All: Realm as Replacement for SQLiteSiena Aguayo
 

Tendances (20)

Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and Silex
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
 
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
What's new and great in Rails 3 - Matt Gauger - Milwaukee Ruby Users Group De...
 
React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN Stack
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Azkaban
AzkabanAzkaban
Azkaban
 
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatGrand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itDrupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Life Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsLife Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby Apps
 
Wieldy remote apis with Kekkonen - ClojureD 2016
Wieldy remote apis with Kekkonen - ClojureD 2016Wieldy remote apis with Kekkonen - ClojureD 2016
Wieldy remote apis with Kekkonen - ClojureD 2016
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
Creating a modern web application using Symfony API Platform Atlanta
Creating a modern web application using  Symfony API Platform AtlantaCreating a modern web application using  Symfony API Platform Atlanta
Creating a modern web application using Symfony API Platform Atlanta
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
 
Gotta Persist 'Em All: Realm as Replacement for SQLite
Gotta Persist 'Em All: Realm as Replacement for SQLiteGotta Persist 'Em All: Realm as Replacement for SQLite
Gotta Persist 'Em All: Realm as Replacement for SQLite
 

En vedette

Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Etiene Dalcol
 
Lua as a business logic language in high load application
Lua as a business logic language in high load applicationLua as a business logic language in high load application
Lua as a business logic language in high load applicationIlya Martynov
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating languagejgrahamc
 
The basics and design of lua table
The basics and design of lua tableThe basics and design of lua table
The basics and design of lua tableShuai Yuan
 
LuaConf 2016 - Becoming a Lua Powered Super Hero
LuaConf 2016 - Becoming a Lua Powered Super HeroLuaConf 2016 - Becoming a Lua Powered Super Hero
LuaConf 2016 - Becoming a Lua Powered Super HeroCharles McKeever
 

En vedette (10)

What's wrong with web
What's wrong with webWhat's wrong with web
What's wrong with web
 
Lua first steps
Lua first stepsLua first steps
Lua first steps
 
Lua and its Ecosystem
Lua and its EcosystemLua and its Ecosystem
Lua and its Ecosystem
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016
 
Lua as a business logic language in high load application
Lua as a business logic language in high load applicationLua as a business logic language in high load application
Lua as a business logic language in high load application
 
Hands on lua
Hands on luaHands on lua
Hands on lua
 
Lua vs python
Lua vs pythonLua vs python
Lua vs python
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating language
 
The basics and design of lua table
The basics and design of lua tableThe basics and design of lua table
The basics and design of lua table
 
LuaConf 2016 - Becoming a Lua Powered Super Hero
LuaConf 2016 - Becoming a Lua Powered Super HeroLuaConf 2016 - Becoming a Lua Powered Super Hero
LuaConf 2016 - Becoming a Lua Powered Super Hero
 

Similaire à Web development with Lua and Sailor @ GeeCon 2015

Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015AboutYouGmbH
 
Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJSdanpastori
 
Docs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondDocs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondLuke Marsden
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedsparkfabrik
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum SlidesAbhishek Gupta
 
Web development in Lua @ FOSDEM 2016
Web development in Lua @ FOSDEM 2016Web development in Lua @ FOSDEM 2016
Web development in Lua @ FOSDEM 2016Etiene Dalcol
 
Everything about flutter web development
Everything about flutter web developmentEverything about flutter web development
Everything about flutter web developmentKaty Slemon
 
Oracle JET and React Frontends.pptx
Oracle JET and React Frontends.pptxOracle JET and React Frontends.pptx
Oracle JET and React Frontends.pptxDan Curtis
 
Go for Operations
Go for OperationsGo for Operations
Go for OperationsQAware GmbH
 
playwrightmeetup-14jan2021-210114173639.pdf
playwrightmeetup-14jan2021-210114173639.pdfplaywrightmeetup-14jan2021-210114173639.pdf
playwrightmeetup-14jan2021-210114173639.pdfManjuBiradar6
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent Biret
 
Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)Vincent Biret
 
Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Florent BENOIT
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017Matt Raible
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015Shahed Chowdhuri
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMShahed Chowdhuri
 

Similaire à Web development with Lua and Sailor @ GeeCon 2015 (20)

Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
 
Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJS
 
Docs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondDocs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyond
 
Flutter for web
Flutter for webFlutter for web
Flutter for web
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
 
Web development in Lua @ FOSDEM 2016
Web development in Lua @ FOSDEM 2016Web development in Lua @ FOSDEM 2016
Web development in Lua @ FOSDEM 2016
 
Everything about flutter web development
Everything about flutter web developmentEverything about flutter web development
Everything about flutter web development
 
Oracle JET and React Frontends.pptx
Oracle JET and React Frontends.pptxOracle JET and React Frontends.pptx
Oracle JET and React Frontends.pptx
 
Kendo ui web
Kendo ui webKendo ui web
Kendo ui web
 
Go for Operations
Go for OperationsGo for Operations
Go for Operations
 
playwrightmeetup-14jan2021-210114173639.pdf
playwrightmeetup-14jan2021-210114173639.pdfplaywrightmeetup-14jan2021-210114173639.pdf
playwrightmeetup-14jan2021-210114173639.pdf
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)
 
Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)
 
Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014Introduction to Eclipse Che / EclipseCon 2014
Introduction to Eclipse Che / EclipseCon 2014
 
ASP.NET 5 Overview
ASP.NET 5 OverviewASP.NET 5 Overview
ASP.NET 5 Overview
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015
 
Bringing swift to cloud
Bringing swift to cloudBringing swift to cloud
Bringing swift to cloud
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTM
 

Plus de Etiene Dalcol

Making wearables with NodeMCU - FOSDEM 2017
Making wearables with NodeMCU - FOSDEM 2017Making wearables with NodeMCU - FOSDEM 2017
Making wearables with NodeMCU - FOSDEM 2017Etiene Dalcol
 
Crescendo com Software livre e Lua
Crescendo com Software livre e LuaCrescendo com Software livre e Lua
Crescendo com Software livre e LuaEtiene Dalcol
 
Get started with Lua programming
Get started with Lua programmingGet started with Lua programming
Get started with Lua programmingEtiene Dalcol
 
What I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersWhat I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersEtiene Dalcol
 
What I learned teaching programming to ~150 young women
What I learned teaching programming to ~150 young womenWhat I learned teaching programming to ~150 young women
What I learned teaching programming to ~150 young womenEtiene Dalcol
 
Humblelotto @HackJSY
Humblelotto @HackJSYHumblelotto @HackJSY
Humblelotto @HackJSYEtiene Dalcol
 
Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015Etiene Dalcol
 

Plus de Etiene Dalcol (7)

Making wearables with NodeMCU - FOSDEM 2017
Making wearables with NodeMCU - FOSDEM 2017Making wearables with NodeMCU - FOSDEM 2017
Making wearables with NodeMCU - FOSDEM 2017
 
Crescendo com Software livre e Lua
Crescendo com Software livre e LuaCrescendo com Software livre e Lua
Crescendo com Software livre e Lua
 
Get started with Lua programming
Get started with Lua programmingGet started with Lua programming
Get started with Lua programming
 
What I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersWhat I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginners
 
What I learned teaching programming to ~150 young women
What I learned teaching programming to ~150 young womenWhat I learned teaching programming to ~150 young women
What I learned teaching programming to ~150 young women
 
Humblelotto @HackJSY
Humblelotto @HackJSYHumblelotto @HackJSY
Humblelotto @HackJSY
 
Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015
 

Dernier

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Dernier (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Web development with Lua and Sailor @ GeeCon 2015

  • 1. Web development with Lua Programming Language Introducing Sailor, a web MVC framework in Lua Etiene Dalcol @etiene_d
  • 4. Lua Ladies
 http://lualadies.org Web development with Lua @ GeeCON 2015 @etiene_d
  • 5. Google Summer of Code LabLua Web development with Lua @ GeeCON 2015 @etiene_d
  • 6. Web development with Lua @ GeeCON 2015 @etiene_d
  • 7. Advantages Web development with Lua @ GeeCON 2015 @etiene_d
  • 8. Web development with Lua @ GeeCON 2015 @etiene_d
  • 9. better reasons • It looks cool (I heard you could make games with it) Web development with Lua @ GeeCON 2015 @etiene_d
  • 10. better reasons • It looks cool (I heard you could make games with it) • It’s made in my home country (In my university to be more precise) Web development with Lua @ GeeCON 2015 @etiene_d
  • 11. better reasons • It looks cool (I heard you could make games with it) • It’s made in my home country (In my university to be more precise) • It’s easy to learn Web development with Lua @ GeeCON 2015 @etiene_d
  • 12. ? ? ? ? ? ?Web development with Lua @ GeeCON 2015 @etiene_d
  • 13. Lua on the web • Early stage • cgilua ~ 1995 • Kepler Project ~ 2003 Web development with Lua @ GeeCON 2015 @etiene_d
  • 14. “ I have myself developed Web sites with pure C++, Java, C#, PHP, and Python. The easiest way to go was definitely Python. If the libraries existed, Lua would be not quite as easy to use as Python, but probably quite a bit more efficient; I think it would become my first choice... if the libraries existed.” Michael Gogins “ Recently there was some discussion about mod_lua on the Apache developers mailing list. I mentioned there that I feel Lua could replace PHP as the number one web scripting language if mod_lua were stable (i.e. not still in beta) and it were implemented well (not making some of PHP's mistakes such as putting everything in the global scope with no consistent naming or parameter schemes). I've wanted to use Lua for all the things I currently use PHP for ever since I discovered it.” Rena Web development with Lua @ GeeCON 2015 @etiene_d
  • 15. Web development with Lua @ GeeCON 2015 @etiene_d
  • 16. Web development with Lua @ GeeCON 2015 @etiene_d
  • 17. Web development with Lua @etiene_d
  • 18. Web development with Lua @ GeeCON 2015 @etiene_d
  • 19. Web development with Lua @ GeeCON 2015 @etiene_d
  • 20. Why? Web development with Lua @ GeeCON 2015 @etiene_d
  • 21. Web development with Lua @ GeeCON 2015 @etiene_d
  • 22. Servers • Apache: mod_lua • Nginx: OpenResty Web development with Lua @ GeeCON 2015 @etiene_d
  • 23. Servers Web development with Lua @ GeeCON 2015 @etiene_d • Apache: mod_lua • Nginx: OpenResty
  • 24. Servers • Apache: mod_lua • Nginx: OpenResty • Xavante • Others Web development with Lua @ GeeCON 2015 @etiene_d
  • 25. Frameworks • Orbit (2007) Least known No significant updates since 2010 MVC Web development with Lua @ GeeCON 2015 @etiene_d
  • 26. Frameworks • Orbit (2007) Least known No significant updates since 2010 MVC • Luvit (2011) Most popular Intense development node.js port 2-4x faster Web development with Lua @ GeeCON 2015 @etiene_d
  • 27. Frameworks • Lapis (2012) Intense development Moonscript and Lua Very well documented Templater OpenResty only Not MVC Web development with Lua @ GeeCON 2015 @etiene_d
  • 28. Frameworks • Lapis (2012) Intense development Moonscript and Lua Very well documented Templater OpenResty only Not MVC • Others Complicated, abandoned, poorly documented, license issues or I never heard about it... Web development with Lua @ GeeCON 2015 @etiene_d
  • 29. Sailor! Web development with Lua @ GeeCON 2015 @etiene_d
  • 30. Sailor! Web development with Lua @ GeeCON 2015 @etiene_d
  • 31. Sailor! Web development with Lua @ GeeCON 2015 @etiene_d
  • 33. What exactly is Sailor? • It’s an MVC web framework • Completely written in Lua • Compatible with Apache (mod_lua), Nginx (OpenResty), Mongoose, Xavante and Lwan • Compatible with Linux, Windows and Mac • Compatible with different databases • MIT License • Pre alpha v0.2 (Mars) • 0.3 (Jupiter) will be released TODAY! Web development with Lua @ GeeCON 2015 @etiene_d
  • 34. Web development with Lua @ GeeCON 2015 @etiene_d
  • 35. What (else) is cool about Sailor? • Routing and friendly URLs • Session, cookies, include, redirect… • Lua Pages parsing • Mail sending • Simple Object Relational-Mapping • Validation (valua) • Basic login and authentication modules • Form generation • Themes (Bootstrap integration out of the box) • App generator (Linux and Mac only) • Model and CRUD generator Web development with Lua @ GeeCON 2015 @etiene_d
  • 36. • Routing and friendly URLs • Session, cookies, include, redirect… • Lua Pages parsing • Mail sending • Simple Object Relational-Mapping • Validation (valua) • Basic login and authentication modules • Form generation • Themes (Bootstrap integration out of the box) • App generator (Linux and Mac only) • Model and CRUD generator • Lua at client What (else) is cool about Sailor? Web development with Lua @ GeeCON 2015 @etiene_d
  • 37. Not so great things • It’s still in early development • Things are changing fast • It lacks features • Documentation Web development with Lua @ GeeCON 2015 @etiene_d
  • 38. How to get Sailor! $ luarocks install sailor $ sailor_create ‘My App’ /var/www $ cd /var/www/my_app $ lua start-server.lua Web development with Lua @ GeeCON 2015 @etiene_d
  • 39. Web development with Lua @ GeeCON 2015 @etiene_d
  • 40. How to get Sailor! $ luarocks install sailor $ sailor_create ‘My App’ /var/www $ cd /var/www/my_app $ lua start-server.lua $ luarocks install luasql-mysqlOptional Web development with Lua @ GeeCON 2015 @etiene_d
  • 42. Example! -- /controllers/site.lua local site = {} function site.index(page) local msg = “Hello World” page:render(‘index’, { msg = msg } ) end function site.notindex(page) page:write(“I’m different!”) end return site Web development with Lua @ GeeCON 2015 @etiene_d
  • 43. Example! <!-- /views/site/index.lp --> <p> A message from the server: <?lua page:print(msg) ?> <br/> The message again: <%= msg %> <!-- same thing as above —> </p> Web development with Lua @ GeeCON 2015 @etiene_d
  • 44. Example! Web development with Lua @ GeeCON 2015 @etiene_d
  • 45. Example! <?lua@server -- Code here runs on the server ?> <?lua -- Same as above ?> <?lua@client -- Runs at the client ?> <?lua@both -- Runs at the server and the client ?> <?lua@both another_msg = “Another message” ?> <?lua page:print(another_msg) ?> <?lua@client js.window.alert(another_msg) ?> Web development with Lua @ GeeCON 2015 @etiene_d
  • 46. Example! Web development with Lua @ GeeCON 2015 @etiene_d
  • 47. Example! local user = {} local v = require “valua” -- validation module user.attributes = { { id = “safe” }, { name = v:new().not_empty() } } user.db = { key = ‘id’, table = ‘users’ } user.relations = { posts = { -- u.posts relation = “HAS_MANY”, model = “post”, attribute = “author_id” } } return user Web development with Lua @ GeeCON 2015 @etiene_d
  • 48. Example! -- /controllers/site.lua local site = {} function site.index(page) local User = sailor.model(‘user’) local u = User:new() u.name = ‘Arnold’ local msg if u:save() then msg = ‘Success’ else msg = table.unpack(u.errors) end local users = User:find_all() page:render(‘index’, { msg = msg, users = users } ) end return site Web development with Lua @ GeeCON 2015 @etiene_d
  • 50. Example! Web development with Lua @ GeeCON 2015 @etiene_d