SlideShare a Scribd company logo
P ytho n vs L ua




                   S K p la ne t
                       신호철
Background
Script for making Applications


 Background
 - The complexity of applications increased extremely.
 - Applications need to be applied large-scale refactoring.


 What can the script do ?
 - Can reduce code-size and increase maintainability.
 - Make it easy to append new applications.
 - When the middleware layer is modified, the modification doesn’t propagate to the
   application layer.
   It’s limited to the script-engine layer.


 Candidate script languages
 - Lua, Python
Lua porting
What’s Lua

      Lua is Implemented and maintained by Tecgraf*1.


      Lua has used in many industrial applications
       such as Adobe’s Photoshop Lightroom.


      Lua is the leading scripting language in games.


      Lua is Embedded in games ( e.g. World of Warcraft ) and Ginga*2.




 : Tecgraf - http://www.tecgraf.puc-rio.br/
*1

 : Ginga brasil – 브라질향 데이터방송 규격
*2
Why Lua

      Lua is small
      - The source contains around 17,000 Lines of C.
      - All standard libraries take just 144K Bytes.


      Lua is powerful
      - Lua provides meta-mechanisms for implementing classes and inheritance.
      - Lua provides garbage collection.


      Lua is fast
      - Several benchmarks show Lua as the one of the fastest languages.


      Lua is portable & embeddable
      - Lua is definitely easy to be embedded with small footprint.


      Lua is free : MIT License*1
 : MIT License - http://ko.wikipedia.org/wiki/MIT_%EB%9D%BC%EC%9D%B4%EC%84%A0%EC%8A%A4
*1
Lua-Application Prototyping - 1/2

  We ported mobile Calculator into Lua


   - We implemented UI Wrapper functions which are required in Calculator.
     - GTK-related functions and Softkey functions.


   - Calculator Logic is implemented by Lua script.
     - Main functions which is needed in 4 fundamental rules of Arithmetic are ported now.


   - The prototype of Lua-Calculator is successfully ported in our mobile platform.
Lua-Application Prototyping - 2/2

  GTK mapping
   - Wrapper functions are implemented.
     - makeWindow, makeButton, makeLabel,
       setLabel, makeSoftkey.


  Calculator Logic
   - 190 Lines of Lua code.


  Calculator UI
   - 54 Lines of Lua code.


  Wrapper Code & Lua script

       Main.c Calc.lua
Python porting
What’s Python

 Released first by Guido van Rossum in 1991.


 Now managed by Python Software Foundation*1


 Embedded as a scripting language in these S/W products. *2
  - GIMP, gedit, Vim, Maya etc
  - In mobile domain, Python for s60*3


 Features a fully dynamic type, automatic memory management.




 *1
   : Python Software Foundation – Wikipedia, http://en.wikipedia.org/wiki/Python_Software_Foundation
 *2
   : Python-embedded S/W – Wikipedia, http://en.wikipedia.org/wiki/Python_software
 *3
   : Python for s60 – nokia.com http://wiki.opensource.nokia.com/projects/Python_for_S60
Why Python

 Highly Readable
     - Python uses whitespace indentation to delimit statement blocks.


 Powerful Standard Library
     - Python has a very large standard library.


 Powerful Glue Language
     - Python has the ability to use a lower-level language such as C/C++.
     - Python can easily attach new modules by using ctypes*1 or swig*2, etc.


 Free
     - Python Software Foundation License*3
      : Allows modifications to the source code and derivative works.
*1
  : Ctypes – http://www.python.org/doc/2.5/lib/module-ctypes.html
*2
  : Swig – http://www.swig.org
*3
  : Python Software Foundation License – http://en.wikipedia.org/wiki/Python_Software_Foundation_License
Python-Application Prototyping : Calculator

 To wrap gtk layer, we try to use PyGTK*1.

 platform-dependent functions such as Softkeys
  are not yet implemented by hand.


 Calculator UI : 114 Lines of python code
     - Example UI code :
                                          Y:funcalc.py




 : PyGTK : GTK wrapper for python - http://www.pygtk.org/
*1
Lua vs Python
Lua vs Python


                                             Lua                            Python
Binary size                                  about 200KB                    About 2MB
                                             (Lua version 5.1)              (Python version 2.6)
Memory usage                                                     Lua is more compact
Speed                                                               Lua is faster*1
Multi-threading                              Thread-safe                    Poor-quality
Standard Library                             Small & compact                Rich & powerful
Glue ability                                 Easy                           Normal




*1
     : see also Lua vs Python : CPU+Memory
What is the most suitable for mobile applications

  Lua is more compact and faster than Python. But Python is further
   powerful.
   - Python has lots of build-in modules and many open-source wrapper modules such as
     pyGtk.


  In case of mobile application which has abundant resources,
   Python is the most suitable for applications.
Appendix
Lua vs Python : CPU+Memory

 CPU + Memory Usage + Lines of Code.
Ad

Recommended

PDF
LuaJIT
François Perrad
 
PDF
Lua as a business logic language in high load application
Ilya Martynov
 
PDF
Fluentd Hacking Guide at RubyKaigi 2014
Naotoshi Seo
 
PDF
IPv4aaS tutorial and hands-on
APNIC
 
PDF
p4alu: Arithmetic Logic Unit in P4
Kentaro Ebisawa
 
PDF
Debugging of (C)Python applications
Roman Podoliaka
 
PDF
Python for IoT, A return of experience
Alexandre Abadie
 
PDF
GPU Computing for Data Science
Domino Data Lab
 
PPTX
How fluentd fits into the modern software landscape
Phil Wilkins
 
PDF
OFI libfabric Tutorial
dgoodell
 
PPTX
FluentD for end to end monitoring
Phil Wilkins
 
PDF
OpenAPI and gRPC Side by-Side
Tim Burks
 
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
PDF
Minko - Scripting 3D apps with Lua and C++
Minko3D
 
PPTX
Jaoo irony
Nick Hodge
 
PDF
How to write a well-behaved Python command line application
gjcross
 
PDF
Network Test Automation - Net Ops Coding 2015
Hiroshi Ota
 
PPTX
An Introduction to ROS-Industrial
Clay Flannigan
 
PDF
ROS+GAZEBO
icmike
 
PDF
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Pôle Systematic Paris-Region
 
PDF
IronRuby for the Rubyist
Will Green
 
PDF
Ractor's speed is not light-speed
SATOSHI TAGOMORI
 
PDF
Netty - a pragmatic introduction
Raphael Stary
 
PPTX
Rust programming-language
Mujahid Malik Arain
 
PPTX
Pulumi. Modern Infrastructure as Code.
Yurii Bychenok
 
PDF
JRuby with Java Code in Data Processing World
SATOSHI TAGOMORI
 
PPTX
Wonders of Golang
Kartik Sura
 
PPTX
Node.js DBMS short summary
HoChul Shin
 
PPT
Python3 brief summary
HoChul Shin
 
PPTX
머신러닝 + 주식 삽질기
HoChul Shin
 

More Related Content

What's hot (19)

PPTX
How fluentd fits into the modern software landscape
Phil Wilkins
 
PDF
OFI libfabric Tutorial
dgoodell
 
PPTX
FluentD for end to end monitoring
Phil Wilkins
 
PDF
OpenAPI and gRPC Side by-Side
Tim Burks
 
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
PDF
Minko - Scripting 3D apps with Lua and C++
Minko3D
 
PPTX
Jaoo irony
Nick Hodge
 
PDF
How to write a well-behaved Python command line application
gjcross
 
PDF
Network Test Automation - Net Ops Coding 2015
Hiroshi Ota
 
PPTX
An Introduction to ROS-Industrial
Clay Flannigan
 
PDF
ROS+GAZEBO
icmike
 
PDF
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Pôle Systematic Paris-Region
 
PDF
IronRuby for the Rubyist
Will Green
 
PDF
Ractor's speed is not light-speed
SATOSHI TAGOMORI
 
PDF
Netty - a pragmatic introduction
Raphael Stary
 
PPTX
Rust programming-language
Mujahid Malik Arain
 
PPTX
Pulumi. Modern Infrastructure as Code.
Yurii Bychenok
 
PDF
JRuby with Java Code in Data Processing World
SATOSHI TAGOMORI
 
PPTX
Wonders of Golang
Kartik Sura
 
How fluentd fits into the modern software landscape
Phil Wilkins
 
OFI libfabric Tutorial
dgoodell
 
FluentD for end to end monitoring
Phil Wilkins
 
OpenAPI and gRPC Side by-Side
Tim Burks
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Minko - Scripting 3D apps with Lua and C++
Minko3D
 
Jaoo irony
Nick Hodge
 
How to write a well-behaved Python command line application
gjcross
 
Network Test Automation - Net Ops Coding 2015
Hiroshi Ota
 
An Introduction to ROS-Industrial
Clay Flannigan
 
ROS+GAZEBO
icmike
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Pôle Systematic Paris-Region
 
IronRuby for the Rubyist
Will Green
 
Ractor's speed is not light-speed
SATOSHI TAGOMORI
 
Netty - a pragmatic introduction
Raphael Stary
 
Rust programming-language
Mujahid Malik Arain
 
Pulumi. Modern Infrastructure as Code.
Yurii Bychenok
 
JRuby with Java Code in Data Processing World
SATOSHI TAGOMORI
 
Wonders of Golang
Kartik Sura
 

Viewers also liked (6)

PPTX
Node.js DBMS short summary
HoChul Shin
 
PPT
Python3 brief summary
HoChul Shin
 
PPTX
머신러닝 + 주식 삽질기
HoChul Shin
 
PPTX
부동산 텔레그램 봇
HoChul Shin
 
PPTX
부동산 텔레그램봇 사내공유 @Tech
HoChul Shin
 
PPTX
ML + 주식 phase 2
HoChul Shin
 
Node.js DBMS short summary
HoChul Shin
 
Python3 brief summary
HoChul Shin
 
머신러닝 + 주식 삽질기
HoChul Shin
 
부동산 텔레그램 봇
HoChul Shin
 
부동산 텔레그램봇 사내공유 @Tech
HoChul Shin
 
ML + 주식 phase 2
HoChul Shin
 
Ad

Similar to Lua vs python (20)

PPTX
Python programming language
Ebrahim Shakhatreh
 
PPTX
Python programming
Megha V
 
PDF
Lua and its Ecosystem
François Perrad
 
PPTX
UNIT - I FIRST PRESENTATION - Copy networking in python.pptx
gargojas31
 
PPTX
Programming in python in detail concept .pptx
Kavitha713564
 
PDF
Lua - Programming Language
Varun Sharma
 
PPTX
Python Programming Language
Laxman Puri
 
PPTX
Introduction to python
AnirudhaGaikwad4
 
PPTX
What is python
faizrashid1995
 
PPTX
Python Class 1
arijit banerjee
 
PDF
Research paper on python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
PPTX
Python Online From EasyLearning Guru
KCC Software Ltd. & Easylearning.guru
 
PPT
Python @ PiTech - March 2009
tudorprodan
 
PPTX
Python PPT by Sushil Sir.pptx
sushil155005
 
PDF
Python quick guide1
Kanchilug
 
PPTX
university notes Lecture - 1 (Python) E-Notes.pptx
7ja1nyx
 
PDF
Python For All | Software Professionals, QA & DevOps professionals
Nilesh Sutar
 
PDF
Python for All
Pragya Goyal
 
PPTX
Python.pptx
abclara
 
PDF
Different Programming Languages Analysed.pdf
Seasia Infotech
 
Python programming language
Ebrahim Shakhatreh
 
Python programming
Megha V
 
Lua and its Ecosystem
François Perrad
 
UNIT - I FIRST PRESENTATION - Copy networking in python.pptx
gargojas31
 
Programming in python in detail concept .pptx
Kavitha713564
 
Lua - Programming Language
Varun Sharma
 
Python Programming Language
Laxman Puri
 
Introduction to python
AnirudhaGaikwad4
 
What is python
faizrashid1995
 
Python Class 1
arijit banerjee
 
Research paper on python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Python Online From EasyLearning Guru
KCC Software Ltd. & Easylearning.guru
 
Python @ PiTech - March 2009
tudorprodan
 
Python PPT by Sushil Sir.pptx
sushil155005
 
Python quick guide1
Kanchilug
 
university notes Lecture - 1 (Python) E-Notes.pptx
7ja1nyx
 
Python For All | Software Professionals, QA & DevOps professionals
Nilesh Sutar
 
Python for All
Pragya Goyal
 
Python.pptx
abclara
 
Different Programming Languages Analysed.pdf
Seasia Infotech
 
Ad

Recently uploaded (20)

PDF
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PPTX
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PDF
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
PDF
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
PDF
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
PDF
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
PPTX
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 

Lua vs python

  • 1. P ytho n vs L ua S K p la ne t 신호철
  • 3. Script for making Applications  Background - The complexity of applications increased extremely. - Applications need to be applied large-scale refactoring.  What can the script do ? - Can reduce code-size and increase maintainability. - Make it easy to append new applications. - When the middleware layer is modified, the modification doesn’t propagate to the application layer. It’s limited to the script-engine layer.  Candidate script languages - Lua, Python
  • 5. What’s Lua  Lua is Implemented and maintained by Tecgraf*1.  Lua has used in many industrial applications such as Adobe’s Photoshop Lightroom.  Lua is the leading scripting language in games.  Lua is Embedded in games ( e.g. World of Warcraft ) and Ginga*2. : Tecgraf - http://www.tecgraf.puc-rio.br/ *1 : Ginga brasil – 브라질향 데이터방송 규격 *2
  • 6. Why Lua  Lua is small - The source contains around 17,000 Lines of C. - All standard libraries take just 144K Bytes.  Lua is powerful - Lua provides meta-mechanisms for implementing classes and inheritance. - Lua provides garbage collection.  Lua is fast - Several benchmarks show Lua as the one of the fastest languages.  Lua is portable & embeddable - Lua is definitely easy to be embedded with small footprint.  Lua is free : MIT License*1 : MIT License - http://ko.wikipedia.org/wiki/MIT_%EB%9D%BC%EC%9D%B4%EC%84%A0%EC%8A%A4 *1
  • 7. Lua-Application Prototyping - 1/2  We ported mobile Calculator into Lua - We implemented UI Wrapper functions which are required in Calculator. - GTK-related functions and Softkey functions. - Calculator Logic is implemented by Lua script. - Main functions which is needed in 4 fundamental rules of Arithmetic are ported now. - The prototype of Lua-Calculator is successfully ported in our mobile platform.
  • 8. Lua-Application Prototyping - 2/2  GTK mapping - Wrapper functions are implemented. - makeWindow, makeButton, makeLabel, setLabel, makeSoftkey.  Calculator Logic - 190 Lines of Lua code.  Calculator UI - 54 Lines of Lua code.  Wrapper Code & Lua script Main.c Calc.lua
  • 10. What’s Python  Released first by Guido van Rossum in 1991.  Now managed by Python Software Foundation*1  Embedded as a scripting language in these S/W products. *2 - GIMP, gedit, Vim, Maya etc - In mobile domain, Python for s60*3  Features a fully dynamic type, automatic memory management. *1 : Python Software Foundation – Wikipedia, http://en.wikipedia.org/wiki/Python_Software_Foundation *2 : Python-embedded S/W – Wikipedia, http://en.wikipedia.org/wiki/Python_software *3 : Python for s60 – nokia.com http://wiki.opensource.nokia.com/projects/Python_for_S60
  • 11. Why Python  Highly Readable - Python uses whitespace indentation to delimit statement blocks.  Powerful Standard Library - Python has a very large standard library.  Powerful Glue Language - Python has the ability to use a lower-level language such as C/C++. - Python can easily attach new modules by using ctypes*1 or swig*2, etc.  Free - Python Software Foundation License*3 : Allows modifications to the source code and derivative works. *1 : Ctypes – http://www.python.org/doc/2.5/lib/module-ctypes.html *2 : Swig – http://www.swig.org *3 : Python Software Foundation License – http://en.wikipedia.org/wiki/Python_Software_Foundation_License
  • 12. Python-Application Prototyping : Calculator  To wrap gtk layer, we try to use PyGTK*1.  platform-dependent functions such as Softkeys are not yet implemented by hand.  Calculator UI : 114 Lines of python code - Example UI code : Y:funcalc.py : PyGTK : GTK wrapper for python - http://www.pygtk.org/ *1
  • 14. Lua vs Python Lua Python Binary size about 200KB About 2MB (Lua version 5.1) (Python version 2.6) Memory usage Lua is more compact Speed Lua is faster*1 Multi-threading Thread-safe Poor-quality Standard Library Small & compact Rich & powerful Glue ability Easy Normal *1 : see also Lua vs Python : CPU+Memory
  • 15. What is the most suitable for mobile applications  Lua is more compact and faster than Python. But Python is further powerful. - Python has lots of build-in modules and many open-source wrapper modules such as pyGtk.  In case of mobile application which has abundant resources, Python is the most suitable for applications.
  • 17. Lua vs Python : CPU+Memory  CPU + Memory Usage + Lines of Code.

Editor's Notes

  • #15: Cpu & memory 에 대한 비교는 다음 사이트를 참고했음 http://dada.perl.it/shootout/craps_cpumem.html
  • #18: http://dada.perl.it/shootout/craps_cpumemloc.html