SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
Web development with
Lua Programming
Language
Introducing Sailor, an MVC
web framework in Lua

Etiene Dalcol
@etiene_d
@etiene_dBulgaria Web Summit 2016
@etiene_d
@etiene_dBulgaria Web Summit 2016
Sailor!

sailorproject.org
@etiene_dBulgaria Web Summit 2016
Google Summer of Code
LabLua
@etiene_dBulgaria Web Summit 2016
Lua Ladies

lualadies.org
@etiene_dBulgaria Web Summit 2016
Lua Space
lua.space
@space_lua
@etiene_dBulgaria Web Summit 2016
Lua overview
The state of web dev
Sailor
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
• Script Language
• Duck-typed
• Multi-paradigm
• procedural, OO, functional,

data-description
• Garbage collection
• Coroutines
• First-class functions
• Lexical scoping
• Proper tail calls
• MIT License
What is Lua?
@etiene_dBulgaria Web Summit 2016
Advantages
Powerful.
@etiene_dBulgaria Web Summit 2016
Why Lua?
Size
(docs included)
First-class functions

+
Lexical scoping
+
Metatables
Native C API
276 Kb
Object Orientation
Ada, Fortran, Java,
Smalltalk, C#, Perl,
Ruby etc.
+
@etiene_dBulgaria Web Summit 2016
Advantages
Simple.Powerful.
@etiene_dBulgaria Web Summit 2016
_G
_VERSION
assert
collectgarbage
dofile
error
getmetatable
ipairs
load
loadfile
next
pairs
pcall
print
rawequal
rawget
rawlen
rawset
require
select
setmetatable
tonumber
tostring
type
xpcall
bit32.arshift
bit32.band
bit32.bnot
bit32.bor
bit32.btest
bit32.bxor
bit32.extract
bit32.lrotate
bit32.lshift
bit32.replace
bit32.rrotate
bit32.rshift
coroutine.create
coroutine.resume
coroutine.running
coroutine.status
coroutine.wrap
coroutine.yield
debug.debug
debug.getuservalue
debug.gethook
debug.getinfo
debug.getlocal
debug.getmetatable
debug.getregistry
debug.getupvalue
debug.setuservalue
debug.sethook
debug.setlocal
debug.setmetatable
debug.setupvalue
debug.traceback
debug.upvalueid
debug.upvaluejoin
io.close
io.flush
io.input
io.lines
io.open
io.output
io.popen
io.read
io.stderr
io.stdin
io.stdout
io.tmpfile
io.type
io.write
file:close
file:flush
file:lines
file:read
file:seek
file:setvbuf
file:write
math.abs
math.acos
math.asin
math.atan
math.atan2
math.ceil
math.cos
math.cosh
math.deg
math.exp
math.floor
math.fmod
math.frexp
math.huge
math.ldexp
math.log
math.max
math.min
math.modf
math.pi
math.pow
math.rad
math.random
math.randomseed
math.sin
math.sinh
math.sqrt
math.tan
math.tanh
os.clock
os.date
os.difftime
os.execute
os.exit
os.getenv
os.remove
os.rename
os.setlocale
os.time
os.tmpname
package
package.config
package.cpath
package.loaded
package.loadlib
package.path
package.preload
package.searchers
package.searchpath
string.byte
string.char
string.dump
string.find
string.format
string.gmatch
string.gsub
string.len
string.lower
string.match
string.rep
string.reverse
string.sub
string.upper
table.concat
table.insert
table.pack
table.remove
table.sort
table.unpack
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
"Since Lua itself is so
simple, it tends to
encourage you to solve
problems simply."
Ragnar Svensson - Lead Developer at King
(Lua Workshop Oct 15 2015)
@etiene_dBulgaria Web Summit 2016
Advantages
Fast.Simple.Powerful.
@etiene_dBulgaria Web Summit 2016
http://www.humbedooh.com/presentations/ACNA%20-%20mod_lua.odp Introducing mod_lua by Daniel Gruno
@etiene_dBulgaria Web Summit 2016
Better Reasons
• It looks cool
(I heard you could make games with it)
My
@etiene_dBulgaria Web Summit 2016
Better Reasons
• It looks cool
(I heard you could make games with it)
@etiene_dBulgaria Web Summit 2016
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)
@etiene_dBulgaria Web Summit 2016
• 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
Better Reasons
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
private
public
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
@etiene_dBulgaria Web Summit 2016
-- Cipher module
--[[ Based on algorithms/caesar_cipher.lua
by Roland Yonaba ]]
local cipher = {}
local function ascii_base(s)
return s:lower() == s and ('a'):byte() or ('A'):byte()
end
function cipher.caesar( str, key )
return str:gsub('%a', function(s)
local base = ascii_base(s)
return string.char(((s:byte() - base + key) % 26) + base)
end)
end
return cipher
One slide crash course: cipher module
@etiene_dBulgaria Web Summit 2016
?
?
Learning Lua
?
? ?
@etiene_dBulgaria Web Summit 2016
Lua on the web
• Early stage
• cgilua ~ 1995
• Kepler Project ~ 2003
@etiene_dBulgaria Web Summit 2016
“ 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
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
9423
words
http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
@etiene_dBulgaria Web Summit 2016
http://w3techs.com/technologies/history_overview/programming_language/ms/y
@etiene_dBulgaria Web Summit 2016
Why?
@etiene_dBulgaria Web Summit 2016
Why?
http://blog.codinghorror.com/php-sucks-but-it-doesnt-matter/
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
Servers
• Apache: mod_lua
• Nginx: OpenResty
@etiene_dBulgaria Web Summit 2016
Servers
• Apache: mod_lua
• Nginx: OpenResty







@etiene_dBulgaria Web Summit 2016
Servers
• Apache: mod_lua
• Nginx: OpenResty
• Xavante
• Others: Lighttpd, Lwan, Pegasus, Mongoose
@etiene_dBulgaria Web Summit 2016
Frameworks
Orbit (2007)
Least known
No significant updates since 2010
MVC
@etiene_dBulgaria Web Summit 2016
Frameworks
Orbit (2007)
Least known
No significant updates since 2010
MVC
Luvit (2011)
Most popular
Intense development
node.js port 2-4x faster
Needs a better documentation
@etiene_dBulgaria Web Summit 2016
Frameworks
Lapis (2012)
Intense development
Moonscript and Lua
Very well documented
Templater
OpenResty only
Not MVC
@etiene_dBulgaria Web Summit 2016
Frameworks
Lapis (2012)
Intense development
Moonscript and Lua
Very well documented
Templater
OpenResty only
Not MVC
Others
Very early development, complicated, abandoned,
poorly documented, license issues or I never heard
about it...
lua.space/webdev/the-best-lua-web-frameworks
@etiene_dBulgaria Web Summit 2016
Sailor!
sailorproject.org
@etiene_dBulgaria Web Summit 2016
Sailor!
@etiene_dBulgaria Web Summit 2016
Sailor!
0.1
(Venus)
@etiene_dBulgaria Web Summit 2016
Sailor!
0.1
(Venus)
0.2
(Mars)
@etiene_dBulgaria Web Summit 2016
What exactly is
Sailor?
• It’s an MVC web framework
• Completely written in Lua
• Compatible with Apache (mod_lua), Nginx (OpenResty),
Xavante, Mongoose, Lighttpd and Lwan
• Compatible with Linux, Windows and Mac
• Compatible with different databases
• MIT License
• Pre alpha v0.5 (Pluto)
• Planning next release to be a 1.0!
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
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
• Automated tests
@etiene_dBulgaria Web Summit 2016
• 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
• Automated tests
• Lua at client
What (else) is cool about
Sailor?
@etiene_dBulgaria Web Summit 2016
Not so great things
• It’s still in early development
• Things are changing fast
• It lacks features
• Documentation
@etiene_dBulgaria Web Summit 2016
How to get Sailor!
$ luarocks install sailor

$ sailor create ‘My App’ /var/www

$ cd /var/www/my_app

$ lua start-server.lua
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
/conf
/controllers
/models
/pub
/runtime
/tests
/themes
/views
App structure
@etiene_dBulgaria Web Summit 2016
/conf
/controllers
/models
/pub
/runtime
/tests
/themes
/views
App structure
Lua files

Stuff! 

JS libraries, images…

Temp files
Lua Pages
@etiene_dBulgaria Web Summit 2016
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.theme = nil

page:write(“I’m different!”)

end



return site
@etiene_dBulgaria Web Summit 2016
<!-- /views/site/index.lp —>





<p> 

A message from the server:

<?lua page:print(msg) ?>

<br/>

The message again:

<%= msg %> <!-- syntactic sugar: same thing as above —>

</p>

Example!
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
<?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

window:alert(another_msg) 

?>
Example!
@etiene_dBulgaria Web Summit 2016
@etiene_dBulgaria Web Summit 2016
local user = {}

local v = require “valua” -- validation module



user.attributes = {

{ id = “safe” },

{ name = v:new().not_empty().len(6,50) }

}

user.db = {

key = ‘id’,

table = ‘users’

}

user.relations = {

posts = { -- u.posts

relation = “HAS_MANY”, model = “post”, attribute = “author_id”

}

}

return user
Example!
@etiene_dBulgaria Web Summit 2016
local user = {}

local v = require “valua” -- validation module



user.attributes = {

{ id = “safe” },

{ name = v:new().not_empty().len(6,50) }

}

user.db = {

key = ‘id’,

table = ‘users’

}

user.relations = {

posts = { -- u.posts

relation = “HAS_MANY”, model = “post”, attribute = “author_id”

}

}

return user
Example!
@etiene_dBulgaria Web Summit 2016
bit.ly/luawebdev
@etiene_dBulgaria Web Summit 2016
Rails Girls
Summer of Code

railsgirlssummerofcode.org
sailorproject.org
github.com/sailorproject
dalcol@etiene.net
@etiene_d
sailorproject.org
github.com/sailorproject
dalcol@etiene.net
@etiene_d
gitter.im/sailorproject/sailor
@sailor_lua
Thank you!
sailorproject.org
github.com/sailorproject
dalcol@etiene.net
@etiene_d

Weitere ähnliche Inhalte

Was ist angesagt?

20150627 bigdatala
20150627 bigdatala20150627 bigdatala
20150627 bigdatalagethue
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHPHari K T
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...Big Data Spain
 
クリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawa
クリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawaクリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawa
クリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawaShohei Okada
 
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
 
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
 
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...Ron Reiter
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScriptTroy Miles
 
Swaggered web apis in Clojure
Swaggered web apis in ClojureSwaggered web apis in Clojure
Swaggered web apis in ClojureMetosin Oy
 
Symfony bundle fo asynchronous job processing
Symfony bundle fo asynchronous job processingSymfony bundle fo asynchronous job processing
Symfony bundle fo asynchronous job processingWojciech Ciołko
 
Intro to React
Intro to ReactIntro to React
Intro to ReactTroy Miles
 
LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017Matthew Beale
 

Was ist angesagt? (19)

20150627 bigdatala
20150627 bigdatala20150627 bigdatala
20150627 bigdatala
 
Mini Rails Framework
Mini Rails FrameworkMini Rails Framework
Mini Rails Framework
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 
クリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawa
クリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawaクリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawa
クリーンアーキテクチャの考え方にもとづく Laravel との付き合い方 #phpconokinawa
 
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
 
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
 
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
 
Plone api
Plone apiPlone api
Plone api
 
Pydata2014
Pydata2014Pydata2014
Pydata2014
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScript
 
Swaggered web apis in Clojure
Swaggered web apis in ClojureSwaggered web apis in Clojure
Swaggered web apis in Clojure
 
Trucker
TruckerTrucker
Trucker
 
Symfony bundle fo asynchronous job processing
Symfony bundle fo asynchronous job processingSymfony bundle fo asynchronous job processing
Symfony bundle fo asynchronous job processing
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Draw More, Work Less
Draw More, Work LessDraw More, Work Less
Draw More, Work Less
 
LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 

Ähnlich wie Web development with Lua @ Bulgaria Web Summit 2016

Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...Etiene Dalcol
 
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
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Etiene Dalcol
 
CoffeeScript: The Good Parts
CoffeeScript: The Good PartsCoffeeScript: The Good Parts
CoffeeScript: The Good PartsC4Media
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Michael Rys
 
How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...Katia Aresti
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tServerless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tToshiaki Maki
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSébastien Levert
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
Everything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der PraxisEverything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der PraxisQAware GmbH
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark ApplicationsTzach Zohar
 
AFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreEngineor
 
Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.Mario-Leander Reimer
 
Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.QAware GmbH
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Rodolfo Finochietti
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)Geekstone
 
Spark + AI Summit 2020 イベント概要
Spark + AI Summit 2020 イベント概要Spark + AI Summit 2020 イベント概要
Spark + AI Summit 2020 イベント概要Paulo Gutierrez
 

Ähnlich wie Web development with Lua @ Bulgaria Web Summit 2016 (20)

Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
 
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
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016
 
CoffeeScript: The Good Parts
CoffeeScript: The Good PartsCoffeeScript: The Good Parts
CoffeeScript: The Good Parts
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)
 
How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tServerless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Everything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der PraxisEverything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der Praxis
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Monitoring Spark Applications
Monitoring Spark ApplicationsMonitoring Spark Applications
Monitoring Spark Applications
 
AFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack Encore
 
Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.
 
Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
Spark + AI Summit 2020 イベント概要
Spark + AI Summit 2020 イベント概要Spark + AI Summit 2020 イベント概要
Spark + AI Summit 2020 イベント概要
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 

Mehr von 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
 
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
 
Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)
Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)
Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)Etiene Dalcol
 

Mehr von 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
 
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
 
Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)
Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)
Sailor - A web MVC framework in Lua by Etiene Dalcol (Lua Workshop 2014)
 

Kürzlich hochgeladen

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
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
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 

Kürzlich hochgeladen (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
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...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 

Web development with Lua @ Bulgaria Web Summit 2016

  • 1. Web development with Lua Programming Language Introducing Sailor, an MVC web framework in Lua
 Etiene Dalcol @etiene_d
  • 3. @etiene_dBulgaria Web Summit 2016 Sailor!
 sailorproject.org
  • 4. @etiene_dBulgaria Web Summit 2016 Google Summer of Code LabLua
  • 5. @etiene_dBulgaria Web Summit 2016 Lua Ladies
 lualadies.org
  • 6. @etiene_dBulgaria Web Summit 2016 Lua Space lua.space @space_lua
  • 7. @etiene_dBulgaria Web Summit 2016 Lua overview The state of web dev Sailor
  • 9. @etiene_dBulgaria Web Summit 2016 • Script Language • Duck-typed • Multi-paradigm • procedural, OO, functional,
 data-description • Garbage collection • Coroutines • First-class functions • Lexical scoping • Proper tail calls • MIT License What is Lua?
  • 10. @etiene_dBulgaria Web Summit 2016 Advantages Powerful.
  • 11. @etiene_dBulgaria Web Summit 2016 Why Lua? Size (docs included) First-class functions
 + Lexical scoping + Metatables Native C API 276 Kb Object Orientation Ada, Fortran, Java, Smalltalk, C#, Perl, Ruby etc. +
  • 12. @etiene_dBulgaria Web Summit 2016 Advantages Simple.Powerful.
  • 13. @etiene_dBulgaria Web Summit 2016 _G _VERSION assert collectgarbage dofile error getmetatable ipairs load loadfile next pairs pcall print rawequal rawget rawlen rawset require select setmetatable tonumber tostring type xpcall bit32.arshift bit32.band bit32.bnot bit32.bor bit32.btest bit32.bxor bit32.extract bit32.lrotate bit32.lshift bit32.replace bit32.rrotate bit32.rshift coroutine.create coroutine.resume coroutine.running coroutine.status coroutine.wrap coroutine.yield debug.debug debug.getuservalue debug.gethook debug.getinfo debug.getlocal debug.getmetatable debug.getregistry debug.getupvalue debug.setuservalue debug.sethook debug.setlocal debug.setmetatable debug.setupvalue debug.traceback debug.upvalueid debug.upvaluejoin io.close io.flush io.input io.lines io.open io.output io.popen io.read io.stderr io.stdin io.stdout io.tmpfile io.type io.write file:close file:flush file:lines file:read file:seek file:setvbuf file:write math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.cosh math.deg math.exp math.floor math.fmod math.frexp math.huge math.ldexp math.log math.max math.min math.modf math.pi math.pow math.rad math.random math.randomseed math.sin math.sinh math.sqrt math.tan math.tanh os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename os.setlocale os.time os.tmpname package package.config package.cpath package.loaded package.loadlib package.path package.preload package.searchers package.searchpath string.byte string.char string.dump string.find string.format string.gmatch string.gsub string.len string.lower string.match string.rep string.reverse string.sub string.upper table.concat table.insert table.pack table.remove table.sort table.unpack
  • 15. @etiene_dBulgaria Web Summit 2016 "Since Lua itself is so simple, it tends to encourage you to solve problems simply." Ragnar Svensson - Lead Developer at King (Lua Workshop Oct 15 2015)
  • 16. @etiene_dBulgaria Web Summit 2016 Advantages Fast.Simple.Powerful.
  • 17. @etiene_dBulgaria Web Summit 2016 http://www.humbedooh.com/presentations/ACNA%20-%20mod_lua.odp Introducing mod_lua by Daniel Gruno
  • 18. @etiene_dBulgaria Web Summit 2016 Better Reasons • It looks cool (I heard you could make games with it) My
  • 19. @etiene_dBulgaria Web Summit 2016 Better Reasons • It looks cool (I heard you could make games with it)
  • 20. @etiene_dBulgaria Web Summit 2016 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)
  • 21. @etiene_dBulgaria Web Summit 2016 • 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 Better Reasons
  • 22. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module
  • 23. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module
  • 24. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module private public
  • 25. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module
  • 26. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module
  • 27. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module
  • 28. @etiene_dBulgaria Web Summit 2016 -- Cipher module --[[ Based on algorithms/caesar_cipher.lua by Roland Yonaba ]] local cipher = {} local function ascii_base(s) return s:lower() == s and ('a'):byte() or ('A'):byte() end function cipher.caesar( str, key ) return str:gsub('%a', function(s) local base = ascii_base(s) return string.char(((s:byte() - base + key) % 26) + base) end) end return cipher One slide crash course: cipher module
  • 29. @etiene_dBulgaria Web Summit 2016 ? ? Learning Lua ? ? ?
  • 30. @etiene_dBulgaria Web Summit 2016 Lua on the web • Early stage • cgilua ~ 1995 • Kepler Project ~ 2003
  • 31. @etiene_dBulgaria Web Summit 2016 “ 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
  • 33. @etiene_dBulgaria Web Summit 2016 9423 words http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
  • 34.
  • 35.
  • 36. @etiene_dBulgaria Web Summit 2016 http://w3techs.com/technologies/history_overview/programming_language/ms/y
  • 38. @etiene_dBulgaria Web Summit 2016 Why? http://blog.codinghorror.com/php-sucks-but-it-doesnt-matter/
  • 41. @etiene_dBulgaria Web Summit 2016 Servers • Apache: mod_lua • Nginx: OpenResty
  • 42. @etiene_dBulgaria Web Summit 2016 Servers • Apache: mod_lua • Nginx: OpenResty
 
 
 

  • 43. @etiene_dBulgaria Web Summit 2016 Servers • Apache: mod_lua • Nginx: OpenResty • Xavante • Others: Lighttpd, Lwan, Pegasus, Mongoose
  • 44. @etiene_dBulgaria Web Summit 2016 Frameworks Orbit (2007) Least known No significant updates since 2010 MVC
  • 45. @etiene_dBulgaria Web Summit 2016 Frameworks Orbit (2007) Least known No significant updates since 2010 MVC Luvit (2011) Most popular Intense development node.js port 2-4x faster Needs a better documentation
  • 46. @etiene_dBulgaria Web Summit 2016 Frameworks Lapis (2012) Intense development Moonscript and Lua Very well documented Templater OpenResty only Not MVC
  • 47. @etiene_dBulgaria Web Summit 2016 Frameworks Lapis (2012) Intense development Moonscript and Lua Very well documented Templater OpenResty only Not MVC Others Very early development, complicated, abandoned, poorly documented, license issues or I never heard about it... lua.space/webdev/the-best-lua-web-frameworks
  • 48. @etiene_dBulgaria Web Summit 2016 Sailor! sailorproject.org
  • 50. @etiene_dBulgaria Web Summit 2016 Sailor! 0.1 (Venus)
  • 51. @etiene_dBulgaria Web Summit 2016 Sailor! 0.1 (Venus) 0.2 (Mars)
  • 52. @etiene_dBulgaria Web Summit 2016 What exactly is Sailor? • It’s an MVC web framework • Completely written in Lua • Compatible with Apache (mod_lua), Nginx (OpenResty), Xavante, Mongoose, Lighttpd and Lwan • Compatible with Linux, Windows and Mac • Compatible with different databases • MIT License • Pre alpha v0.5 (Pluto) • Planning next release to be a 1.0!
  • 54. @etiene_dBulgaria Web Summit 2016 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 • Automated tests
  • 55. @etiene_dBulgaria Web Summit 2016 • 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 • Automated tests • Lua at client What (else) is cool about Sailor?
  • 56. @etiene_dBulgaria Web Summit 2016 Not so great things • It’s still in early development • Things are changing fast • It lacks features • Documentation
  • 57. @etiene_dBulgaria Web Summit 2016 How to get Sailor! $ luarocks install sailor
 $ sailor create ‘My App’ /var/www
 $ cd /var/www/my_app
 $ lua start-server.lua
  • 59. @etiene_dBulgaria Web Summit 2016 /conf /controllers /models /pub /runtime /tests /themes /views App structure
  • 60. @etiene_dBulgaria Web Summit 2016 /conf /controllers /models /pub /runtime /tests /themes /views App structure Lua files
 Stuff! 
 JS libraries, images…
 Temp files Lua Pages
  • 61. @etiene_dBulgaria Web Summit 2016 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.theme = nil
 page:write(“I’m different!”)
 end
 
 return site
  • 62. @etiene_dBulgaria Web Summit 2016 <!-- /views/site/index.lp —>
 
 
 <p> 
 A message from the server:
 <?lua page:print(msg) ?>
 <br/>
 The message again:
 <%= msg %> <!-- syntactic sugar: same thing as above —>
 </p>
 Example!
  • 64. @etiene_dBulgaria Web Summit 2016 <?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
 window:alert(another_msg) 
 ?> Example!
  • 66. @etiene_dBulgaria Web Summit 2016 local user = {}
 local v = require “valua” -- validation module
 
 user.attributes = {
 { id = “safe” },
 { name = v:new().not_empty().len(6,50) }
 }
 user.db = {
 key = ‘id’,
 table = ‘users’
 }
 user.relations = {
 posts = { -- u.posts
 relation = “HAS_MANY”, model = “post”, attribute = “author_id”
 }
 }
 return user Example!
  • 67. @etiene_dBulgaria Web Summit 2016 local user = {}
 local v = require “valua” -- validation module
 
 user.attributes = {
 { id = “safe” },
 { name = v:new().not_empty().len(6,50) }
 }
 user.db = {
 key = ‘id’,
 table = ‘users’
 }
 user.relations = {
 posts = { -- u.posts
 relation = “HAS_MANY”, model = “post”, attribute = “author_id”
 }
 }
 return user Example!
  • 68. @etiene_dBulgaria Web Summit 2016 bit.ly/luawebdev
  • 69. @etiene_dBulgaria Web Summit 2016 Rails Girls Summer of Code
 railsgirlssummerofcode.org
  • 72.