Lua

From Things and Stuff Wiki
Jump to navigation Jump to search


General

  • Lua - a powerful, fast, lightweight, embeddable scripting language. Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.



  • Programming in Lua - Programming in Lua provides a solid base to any programmer who wants to use Lua. The first edition was aimed at Lua 5.0, remains largely relevant, and is freely available online for personal use. It covers all aspects of Lua—from the basics to its API with C. The book is the main source of programming patterns for Lua, with numerous code examples that help the reader to make the most of Lua's flexibility and powerful mechanisms. The book is targeted at people with some programming background, but it does not assume any prior knowledge about Lua or other scripting languages.






  • Learning Lua/From JS - Know JavaScript, and want to learn Lua? Here's are some quick facts about the similarities and differences.


  • LOOP - stands for Lua Object-Oriented Programming and is a set of packages for supporting different models of object-oriented programming in the Lua language. In fact, Lua is not an object-oriented language nor it was intended to be because one of the main goals of Lua is to remain simple and small. However, it provides facilities as syntactic sugar to support an object-oriented programming style. Additionally, the extension mechanisms of Lua can be used to implement most of the traditional object-oriented concepts commonly available in other languages. This lack of a standard object model avoids the use of a peculiar model instead of models customized for particular needs, like simplicity, flexibility or performance.


  • Luvit - implements the same async APIs as Node.js, but in Lua!


  • LuaJIT — a Just-In-Time Compiler for Lua.


  • Metalua - a language and a compiler which provide a complete macro system, similar in power to what's offfered by Lisp dialects or Template Haskell; manipulated programs can be seen as source code, as abstract syntax trees, or as an arbitrary mix thereof, whichever suits your task better.

Tools


  • ZeroBrane Studio - a lightweight Lua IDE with code completion, syntax highlighting, live coding, code analyzer, and debugging support for Lua 5.1, Lua 5.2, Lua 5.3, LuaJIT, and other Lua engines.



  • https://github.com/bkaradzic/GENie - project generator tool. It automagically generates project from Lua script, making applying the same settings for multiple projects easy.

Packages

  • LuaRocks - the package manager for Lua modules. It allows you to create and install Lua modules as self-contained packages called rocks. You can download and install LuaRocks on Unix and Windows.
  • ULua - Universal Lua Distribution. More than 300 binary packages updated daily from Luarocks




  • https://github.com/osch/lua-lwtk - provides a foundation for building cross platform GUI widgets in pure Lua on top of LPugl. For now only the cairo drawing backend is supported. Backend abstraction and support for other backends could be possible in the future. This project is work in progress.


Introspection

  • https://github.com/kikito/inspect.lua - transforms any Lua value into a human-readable representation. It is especially useful for debugging errors in tables. The objective here is human understanding (i.e. for debugging), not serialization or compactness.


Binding

System

Audio / MIDI

  • ecasound.lua - Provides access to the ecasound interactive mode


  • midialsa.lua - the ALSA library, plus some interface functions
  • MIDI.lua - Reading, writing and manipulating MIDI data


  • midisox - a SoX-like workalike, for handling MIDI files. Efeects: compand, echo, fade, key, mixer, pad, pan, pitch, quantise, repeat, stat, tempo, trim, vol





Networking


  • Mako Server - tiny, ready-to-run application server packs a punch with its super compact and efficient Lua web framework and its non-blocking asynchronous sockets. Plus, it comes with everything you need built-in, including an integrated database, SMTP, HTTP client/server, and even IoT protocols like MQTT and industrial protocols like OPC-UA and Modbus.

Game

  • LÖVE - an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X, Linux, Android and iOS.


Testing

  • busted - a unit testing framework with a focus on being easy to use. busted works with lua >= 5.1, moonscript, terra, and LuaJIT >= 2.0.0.


MoonScript

  • MoonScript - a dynamic scripting language that compiles into Lua. It gives you the power of one of the fastest scripting languages combined with a rich set of features. MoonScript can either be compiled into Lua and run at a later time, or it can be dynamically compiled and run using the moonloader. It’s as simple as require "moonscript" in order to have Lua understand how to load and run any MoonScript file.


class Thing
  name: "unknown"

class Person extends Thing
  say_name: => print "Hello, I am #{@name}!"

with Person!
  .name = "MoonScript"
  \say_name!

Terra

  • Terra - a low-level system programming language that is embedded in and meta-programmed by the Lua programming language


eLua

  • eLua - eluaproject - Embedded power, driven by Lua. Quickly prototype and develop embedded software applications with the power of Lua and run them on a wide range of microcontroller architectures


Typescript