Lua: Tiny Embeddable Scripting that Doesn't Suck

7,298 views
7,139 views

Published on

From Strange Loop 2010:

This talk shows WHY to use Lua (as opposed to the zillion other scripting languages) for embedded scripting inside of larger, non-Lua projects. Lua is safe, fast, simple, learning, and more popular that you might expect.

Video of this talk is available at http://kylecordes.com/2010/lua-strange-loop

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,298
On SlideShare
0
From Embeds
0
Number of Embeds
2,365
Actions
Shares
0
Downloads
58
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Lua: Tiny Embeddable Scripting that Doesn't Suck

  1. 1. Lua: Tiny Embeddable Scripting that Doesn’t Suck Kyle Cordes Strange Loop 2010 http://www.flickr.com/photos/mikebaird/4060342528/
  2. 2. About Kyle Cordes • Blah, Blah, Blah
  3. 3. cat ~/.plan Learn; (Clojure, at the moment) Teach; (How to SaaS) Hire; (Grow Oasis Digital) Market; (same) Launch Next Big Thing
  4. 4. Abstract “This talk will show how and WHY to use Lua (as opposed to the zillion other scripting languages) for embedded scripting inside of larger, non-Lua projects. Lua is safe, fast, simple, easy to learn, and more popular that you might expect.” (What you were sold...)
  5. 5. The 20-minute version “This talk will show how and WHY to use Lua (as opposed to the zillion other scripting languages) for embedded scripting inside of larger, non-Lua projects. Lua is safe, fast, simple, easy to learn, and more popular that you might expect.” (What you will get.)
  6. 6. Use the Interwebs http://www.lua.org/ http://www.flickr.com/photos/james_michael_hill/88311128/
  7. 7. Yet Another Scripting Language Why should we care?
  8. 8. Because Lua Doesn’t Suck 6 Reasons
  9. 9. Jail http://www.flickr.com/photos/kuzeytac/ http://www.flickr.com/photos/8422710@N06/
  10. 10. Lua code runs in a Sandbox http://www.flickr.com/photos/engelsrud/158040644/
  11. 11. Safe By Default Default: no I/O, safe but impotent. Lua doesn’t even have “print” built in. Host application provides whatever limited set of APIs/primitives are warranted. Contrast this to Java’s complex security model, for example.
  12. 12. Small http://www.flickr.com/photos/kentigern/221409419/ http://www.flickr.com/photos/andrewscott/577706627/
  13. 13. Lua is Small To embed, hook to a handful of functions. As small as <100 KB (DLL/LIB) Easily runs on small devices or in small apps. Example: Lua on the iPhone http://probablyinteractive.com/2009/10/18/Setting-up-iPhone-Wax.html?
  14. 14. Simple http://www.flickr.com/photos/benmcleod/44336195/ http://www.flickr.com/photos/slightlywinded/66875782/
  15. 15. Lua is Simple • to use - well suited for small software • to learn - ~20 keywords, ~20 operators • to teach - plenty of non-developers use it
  16. 16. Flexible http://www.flickr.com/photos/wiccked/348866434/ http://www.flickr.com/photos/wainwright/351684037/
  17. 17. Lua is Flexible • Dynamically typed • First-class functions • Easy interop • Written in super-clean C, ports to nearly any platform • Ample libraries off-the-shelf
  18. 18. Fast http://www.autoblog.com/photos/pagani-zonda-hh-0/ http://www.flickr.com/photos/kentigern/223140455/
  19. 19. LuaJIT is in C++ / Java6 territory. http://luajit.org/ Interpreted Lua is generally faster than Python, Ruby, Perl, and PHP. http://bit.ly/8RLpoG
  20. 20. Momentum http://www.flickr.com/photos/us_army_rolling_along/3342500833/ http://www.flickr.com/photos/us_army_rolling_along/4509400870/ http://www.flickr.com/photos/carbonnyc/76463757/s
  21. 21. Lua in World of Warcraft • At least one external IDE • Several published books • Large community
  22. 22. Angry Birds
  23. 23. Wikipedia lists 110 games with Lua scripting (many on the PC, many on consoles, some on handhelds)
  24. 24. Not Just Games • Adobe Photoshop Lightroom • Oasis Digital projects • Many, many more
  25. 25. Lua == 42 ? http://www.flickr.com/photos/almostinfamous/3531123548/
  26. 26. The right answer for every scripting need? At my last venture, we chose JavaScript instead: 1. Better Java Integration 2. Everyone knows JavaScript 3. More tooling, easier sell
  27. 27. kylecordes.com http://www.flickr.com/photos/thetruthabout/

×