Lua Workshop 2016

The Lua Workshop 2016 will be held in San Francisco, CA, on October 13–14, 2016, courtesy of Mashape.

As in previous workshops (2005, 2006, 2008, 2009, 2011, 2012, 2013, 2014, 2015), the main goal of the workshop is to allow the Lua community to get together and meet in person and talk about the Lua language, its uses, and its implementation.

The workshop is open to everyone interested in Lua. There is no registration fee but participants are required to register because space is limited. Please make your own travel and accommodation arrangements. Contact us if you need help or have special requirements. For further details, see the local page.

Program

We shall have a plenary talk by Roberto Ierusalimschy (Lua's chief architect) and several contributed talks. There will also be plenty of time for getting together and chatting about Lua.

If you'd like to speak at the workshop, please send a tentative title and a short abstract with your registration.

See the preliminary schedule.


Thursday, Oct 13th

9:00 registration and badge pick-up
9:30 The design of Lua
Roberto Ierusalimschy
10:30 coffee break
11:00 On the history of Lua
Daurnimator
11:30 The Haxe Lua target
Justin Donaldson
12:00 Practical LPeg
Mitchell
12:30 lunch
14:00 Peer to Peer publish/subscribe using Lua and DDS
Gianpiero Napoli
14:30 IREP and Lua
Lee Busby
15:00 Creating mobile app in Lua with NOYA
Daogang Cao
15:30 coffee break
16:00 Regex Considered Harmful: Use Rosie Pattern Language Instead
Jamie Jennings
16:30 Mass spectrometry assay optimization using functional programming patterns in Lua
Bennett Kalafut
17:00 LuaRocks 3
Hisham Muhammad
17:30 pizza, beer and Lua, courtesy of Mashape


Friday, Oct 14th

9:30 LuaJIT: something interesting inside
Peter Cawley
10:30 coffee break
11:00 Working with strongly typed data models in Lua for building Industrial Internet of Things (IIoT) applications
Rajive Joshi
11:30 API design for Lua and C applications
Mitchell
12:00 A Sun For the Moon - A Zero-Overhead Lua Abstraction using C
ThePhD
12:30 lunch
14:00 Building a large web application in Lua with Lapis: itch.io
Leaf Corcoran
14:30 Lua in WAFs: An examination of Lua's use in ModSecurity and other web application firewalls
Robert Paprocki
15:00 Writing optimal Lua code for LuaJIT and OpenResty
Yichun Zhang
15:30 coffee break
16:00 The history and design of LuaCocoa
Eric Wing
16:30 Tales of a Lua engine embedder thrown into the JavaScript world
Eric Wing
17:00 Programming iOS in Lua: a bridge story
Jean-Luc Jumpertz

Organization

The workshop is organized by Marco Palladino at Mashape and the Lua team.

The organizers can be contacted at [email protected].

Sponsored by Mashape

Participants

Abstracts

The design of Lua slides video
Roberto Ierusalimschy (PUC-Rio)

The Haxe Lua target slides video
Justin Donaldson (Salesforce)

The Haxe Lua target brings some benefits that greatly help large, complex Lua applications. It has standard OOP, structural typedef, dynamic, and flexible macro-defined type checking, and has an especially speedy compiler. In addition, it has special support for Lua externs and idioms, and can emit code that runs universally on Lua/LuaJit, or it can enable LuaJit specific features with special compiler flags.

Practical LPeg slides video
Mitchell

LPeg is a fantastic text processing tool. It has a number of useful applications, including the parsing of source code for syntax highlighting, defining grammars for templating engines, and much more. Come learn how to leverage LPeg in practical ways in order to solve real-world problems.

On the history of Lua slides video
Daurnimator

I have been putting together a git history of Lua's code-base. Looking through the evolution of the code base gives us some insights into implementation dead ends and features that didn't meet the standard to be in a release. For mailing list regulars you may recall the various discussions that have led to some commits.

LuaRocks 3 slides video
Hisham Muhammad

This talk will discuss LuaRocks 3, the upcoming major release of the Lua package manager. LuaRocks 3 will feature the first update of the rockspec file format since LuaRocks 1.0, released in 2008. I will present what is being planned for LuaRocks and its rockspec format, and take the opportunity to discuss with the community the directions we want to take the project from there on.

Peer to Peer publish/subscribe using Lua and DDS slides video
Gianpiero Napoli (RTI)

During this talk we will explore how in RTI we used Lua to simply Publish Subscribe communication in a distributed system. Lua was first used to add scripting capability to one of our Rapid Prototyping tool, and then elevated to first class citizen scripting language to create complex pub/sub distributed systems based on the OMG standard Data Distribution Service (DDS) Data Distribution Service (DDS) is the platform for the Industrial Internet of Things (IIoT). It offers real-time, peer-to-peer, standard, data-centric publish subscribe. With RTI DDSConnector you can now exploit the power of DDS within Lua without having to deal with complex APIs. Define your data types, your data writers, data readers and desired quality of service in a XML file and simply load it in your Lua application. Your applications will effortlessly become participants in a logically shared, but decentralized peer-to-peer data-space with other applications over a LAN or WAN. DDS is an open real-time connectivity framework standard that has proven itself in industrial systems for building highly reliable systems that can be trusted without a single point of failure, and as a peer-to-peer (P2P) architecture with no message servers or brokers. If you need a connectivity framework that is fast, that can scale to hundreds of nodes, that is monitorable and robust, and if your system has to last, adapt to new technologies, work in heterogeneous environments or connect to legacy systems, DDS is the answer. If you want to do all that in Lua, DDSConnector is your answer. We will cover the basics of DDS with some practical examples and then dive in a few demos on how to use DDS in Lua through RTI DDS Prototyper.

IREP and Lua slides video
Lee Busby (LLNL)

The Intermediate Representation (IREP) reads program input from Lua tables, and transfers the data into compiled structures whose layout is similar to the tables. The compiled structures are shareable between C/C and Fortran. IREP can handle most varieties of "Plain Old Data" and has mechanisms to extend it beyond POD. Structure templates are written using simple cpp(1) macros. No preprocessing nor metaprogramming is necessary. The Lua table reader is generic. No additional code beyond the structure template is normally required for IREP to read the matching Lua table. IREP uses only standard language features. Interestingly, this requires a couple of capabilities new in Fortran. Our next generation physics simulation code is embedding Lua as its configuration and steering language, and now includes IREP.

Creating mobile app in Lua with NOYA slides video
Daogang Cao

1) ObjectOriented program using lua; 2) cross-platform lua engine (IOS & android) 3) api framework 4) demo: create mobile app using lua (for both iOS & android)

LuaJIT: something interesting inside slides video
Peter Cawley (corsix.org)

Have you ever wondered what happens when you check out the LuaJIT sources and type "make"? Have you ever questioned how the LuaJIT interpreter implements call frames and function calls? Of course you haven't, because these sound like the dullest questions ever. However, thanks to LuaJIT being a treasure-trove of a codebase, even questions such as these turn out to have really interesting answers, and those answers deserve more time in the spotlight than they've had to date.

Regex Considered Harmful: Use Rosie Pattern Language Instead slides video
Jamie Jennings (IBM)

Of the more than 2.5 billion Gb of data being produced daily, about 75% is unstructured, and only about 0.5% is ever analyzed.� The goal of big data analytics is to fish useful insights out of the rising tide of available data --�but the first step is to parse the raw data,�and�the most popular tools today are�built on a shaky foundation. Most tools (e.g. Perl,�PCRE, ElasticSearch, Splunk, most Apache parsers) for processing unstructured text rely on�regexes, extensions�of regular expressions.� But regexes are not easy to write, and are notoriously difficult to read and maintain.� Also, regexes have surprisingly variable performance in practice.� So it's best to avoid putting a regex engine in your big data pipeline. In this talk, we introduce Rosie Pattern Language, an alternative to regexes. �RPL shares key concepts and notation with regexes, but RPL patterns are more powerful.� RPL is designed like a programming language: composable patterns are bound to identifiers; comments and whitespace are allowed within patterns; and patterns may be grouped into modules.� Such features facilitate the creation, maintenance, and sharing of patterns. �Finally, RPL matching (parsing) is consistently fast, often several times faster than competing tools. Rosie�Pattern�Language is implemented in Lua; the RPL compiler�produces expressions which are then processed at run-time by the�lpeg�pattern matching engine. �While�patterns are defined (specified) in RPL, post-match processing (including data format conversion) is done in Lua. �Thus, Lua is the extension language for RPL, allowing users to add new data format�conversion and validation routines. Rosie is open source, released under the MIT License, and can be found at https://github.com/jamiejennings/rosie-pattern-language.

Mass spectrometry assay optimization using functional programming patterns in Lua slides video
Bennett Kalafut (Thermo Fisher Scientific)

Determination of fragment ions and tuning of compound-specific ion source and ion-optical parameters is a necessary step in the development of specific and sensitive tandem mass spectrometry assays. Using embedded Lua, we have automated this optimization process for Thermo Fisher Scientific's TSQ Quantiva and TSQ Endura mass spectrometers. Treating the combination of optimizations as function composition and higher-order functions as composable iterators has allowed us to adopt programming concepts from functional languages such as map, filter, reduce, and function decorators/functionals. This has resulted in a simple and flexible design, easily extendable to accommodate new peripherals and new user options such as loop flow injection of samples. I will present this design, including what we do to remove or hide state and side-effects.

Working with strongly typed data models in Lua for building Industrial Internet of Things (IIoT) applications slides video
Rajive Joshi (RTI)

Building IIoT systems involves integrating independently developed components using shared strongly typed data models rooted in the physics of the application domain. Data Domain Specific Language (DDSL) is a pure Lua module that makes it easy and fun to work with strongly typed data models in Lua. It was borne out of a practical need for effectively working with data types constrained by an underlying data model in the dynamically typed Lua environment. It is being used with the Data Distribution Service (DDS), the predominant open standard connectivity framework for IIoT systems integration. Like an Interface Description Language (IDL), DDSL can be used to define data models; however, unlike an IDL the data models can be defined programmatically and incrementally, thus providing the foundation for automated data model mapping and machine learning. Data model instances are kept in sync with the underlying data model---when a model is changed, all the linked instances get updated. A newly added field is automatically initialized to the correct instance specific hierarchical path leading up to that field in the data model. This can be viewed as an automatically generated index for storage, and is used, for example, to access the fields when exchanging complex data types using DDS. DDSL has been applied to create data generators for automated testing; it can also be applied for specifying range constraints and units, for automated checking of data instance fields, and feeding templating engines. DDSL can also export the data models to IDL, or import data models defined in XML. This talk will provide the rationale behind DDSL, an introduction to data modeling with DDSL, and show a working demonstration of how it is being used to build data-centric distributed IIoT applications with Lua and DDS.

API design for Lua and C applications slides video
Mitchell

Lua is well known for its unique abilities as an embedded scripting language. Not only can developers extend their C applications with Lua, but with the proper interface, users can too! Designing APIs for both internal and external use can be tricky and require many iterations to "get it right". Over the last 9 years, the Textadept text editor's Lua and C APIs have benefited from relentless refactorings and reworkings, and users can extend the application more easily and intuitively than ever before. Come and learn about how you can enable users to extend your C applications with Lua, as we explore many of the lessons learned about API design from Textadept's development.

A Sun For the Moon - A Zero-Overhead Lua Abstraction using C slides video
ThePhD

Oftentimes, programmers wish to integrate Lua into an existing application, mainly into C or C codebases. For this, they use the C API. Because of its low-level stack-based semantics, individuals often try to wrap it up into useful primitives or small wrapper libraries. Sometimes, they do this well: in other cases, it is not executed nearly as nicely. This presentation will talk about what it takes to wrap the Lua C API up in a C interface that's easy to use, using the sol2 library as an example. It will discuss the implementation choices and potential pitfalls in both the context of C and C using existing libraries (Luabind, Selene, etc.) and highlight how to properly use the Lua 5.1, 5.2 and 5.3 C API for both performance and ease of use.

Building a large web application in Lua with Lapis: itch.io slides video
Leaf Corcoran

itch.io is an independent game marketplace, home to over 44k independent creations. It's build in MoonScript and Lapis, with over 130k lines of MoonScript (Compiled to ~200k Lua). Lapis is a web framework that runs inside of OpenResty. In this talk I'll discuss how Lapis is structured from a high level, how itch.io's application code is organized, how we develop new features, advantages we've noticed compared to other frameworks, how we test, and how itch.io influences Lapis's design.

Lua in WAFs: An examination of Lua's use in ModSecurity and other web application firewalls slides video
Robert Paprocki (DreamHost)

As web applications evolve and grow in complexity and ubiquity, the need to develop performant web application firewall (WAF) solutions as grown as well. This talk will focus on the history and use of Lua in open source WAF solutions. We will discuss how the Apache (and now platform-agnostic) ModSecurity leverages embeded Lua to provide rule authors a powerful extension to the ModSecurity DSL. We will also discuss how developments in the OpenResty community allow for the development of complex Lua applications in the context of the Nginx proxy ecosystem, and examine one such project (lua-resty-waf) in close detail, discussing performance, comparing its feature set with existing open source WAF projects, and discussing the role Lua and LuaJIT plays in optimizing execution times.

Writing optimal Lua code for LuaJIT and OpenResty slides video
Yichun Zhang (CloudFlare)

OpenResty is a high performance web platform built on Lua and NGINX. We have large-scale Internet products built upon OpenResty in companies like CloudFlare, Jingdong, Adobe, Tencent, Sina, Alibaba, Youku, and many others. Over the years, we created many advanced profiling tools that can do online and offline performance analysis. In this presentation, the creator of OpenResty, Yichun Zhang, will examine various important Lua coding details that matter a lot in high performance Lua web applications atop LuaJIT and OpenResty. Then he will walk through some interesting details in the LuaJIT internals when performance is concerned. Finally, approaches like higher level DSLs will be proposed to do automatic Lua code optimizations on Lua programmers' behalf.

The history and design of LuaCocoa slides video
Eric Wing (PlayControl Software)

This talk will explore the subtle details of building a full featured language bridge between Lua and Cocoa, which needs to go far beyond just Objective-C bridging and address the evolution of technology and requirements on Apple platforms over the past 15 years of LuaCocoa's history, such as memory management and the optional Obj-C garbage collector, C types, subclassing, blocks, BridgeSupport, Scripting Bridge, sandboxing, etc.

Tales of a Lua engine embedder thrown into the JavaScript world slides video
Eric Wing (PlayControl Software)

This talk will compare and reflect the process and challenges of embedding JavaScript from the perspective of somebody who comes from the Lua embedding world. To further spice things up, iOS and Android (and maybe WinRT) will be the target platforms discussed, all of which are partially locked down platforms with non-standards compliant parts which even in the Lua case poses additional challenges.

Programming iOS in Lua: a bridge story slides
Jean-Luc Jumpertz (Celedev)

Building a solid bridge between Lua and an entire OS SDK is certainly a complex and challenging task. You need to adapt the calling conventions and design patterns used in the OS SDK to make them feel simple and natural in Lua; you have to manage the peaceful coexistence of different memory management models, and of different typing systems; and of course you have to write the binding code that allow Lua code and the native OS SDK to communicate with each other. In this talk, I will explain how these points were handled in the Lua to iOS / macOS bridge we have developed as part of the CodeFlow IDE, and how integrating the bridge with the IDE can greatly improve the developer experience.