background preloader

Lua

Facebook Twitter

Penlight Documentation. Purpose It is often said of Lua that it does not include batteries.

Penlight Documentation

That is because the goal of Lua is to produce a lean expressive language that will be used on all sorts of machines, (some of which don't even have hierarchical filesystems). The Lua language is the equivalent of an operating system kernel; the creators of Lua do not see it as their responsibility to create a full software ecosystem around the language. That is the role of the community. A principle of software design is to recognize common patterns and reuse them. Penlight captures many such code patterns, so that the intent of your code becomes clearer. The default error handling policy follows that of the Lua standard libraries: if a argument is the wrong type, then an error will be thrown, but otherwise we return nil,message if there is a problem.

By default, the error stacktrace starts with your code, since you are not usually interested in the internal details of the library. ?? To Inject or not to Inject? The Programming Language Lua. Lua 5.1 Reference Manual. By Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes Copyright © 2006–2012 Lua.org, PUC-Rio.

Lua 5.1 Reference Manual

Freely available under the terms of the Lua license. contents · index · other versions · english · português · español. Unknown Worlds home page » UnknownWorlds. Busted : Elegant Lua unit testing, by Olivine-Labs. What's busted, precious?

busted : Elegant Lua unit testing, by Olivine-Labs

Busted is 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. busted test specs read naturally without being too verbose. You can even chain asserts and negations, such as assert.not.equals. Nest blocks of tests with contextual descriptions using describe, and add tags to blocks so you can run arbitrary groups of tests. LuaRocks Wiki: LuaRocks. LuaFileSystem.

Overview LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.

LuaFileSystem

LuaFileSystem offers a portable way to access the underlying directory structure and file attributes. Zeuxcg.org - Lua callstack with C++ debugger. 07 Nov 2010 Lua is a very popular scripting language in game development industry.

zeuxcg.org - Lua callstack with C++ debugger

Many games use Lua for various scripting needs (data representation, UI scripting, AI scripting), and some go as far as write the majority of the game in Lua. At CREAT, we used Lua for all of UI scripting, and for AI and other game logic on some projects. And, well, there were times when the game crashed - and the callstack consisted mainly of Lua functions.

Programming Gems. WxLua - homepage. 果冻想. Lua IDE: Decoda. Today we are very pleased to announce that we’ve released Decoda, our Lua IDE (Integrated Development Environment) and debugger, as open source.

Lua IDE: Decoda

You can get the latest version of the source from GitHub and the Windows installer from the download page. We created Decoda in 2007 just as we were starting work on Natural Selection 2 and getting our company off the ground. Since Natural Selection 2 uses Lua heavily we realized that a complete IDE with an integrated debugger would be critical. Although it was initially an internal tool, we quickly realized that other developers would benefit from Decoda as well. To help fund our company, we productized Decoda and began selling through our website. Today, after the successful launch of Natural Selection 2, we have the opportunity to re-evaluate our business strategy. We intend to keep on developing Decoda, but we are most excited about what *you* can do to help make it the best IDE out there! Max. LuaJIT. LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language.

LuaJIT

Lua is a powerful, dynamic and light-weight programming language. It may be embedded or used as a general-purpose, stand-alone language. LuaJIT is Copyright © 2005-2017 Mike Pall, released under the MIT open source license. Compatibility Overview LuaJIT has been successfully used as a scripting middleware in games, appliances, network and graphics apps, numerical simulations, trading platforms and many other specialty applications. LuaJIT has been in continuous development since 2005. For LuaJIT 2.0, the whole VM has been rewritten from the ground up and relentlessly optimized for performance. 深入Lua-based GUI系統架構與實做細節 >> 猴子靈藥. 在前篇「使用Lua實做GUI系統的遊戲實例」中介紹了 Lua 於 GUI 系統的基本用法後,本文開始進入 GUI 的核心功能層面。

深入Lua-based GUI系統架構與實做細節 >> 猴子靈藥

一般來說,有數種不同的架構方式能夠結合 Lua 與 C++ 實做 GUI 系統。 其一是將 Lua Script 當作純粹資料描述用的程式碼,僅儲存 UI Layout 相關的資料(如前篇文章所示),而由 C++ Code 掌控核心功能並且讀取 Lua Script 進行資料的處理。 其二則是於 C++ 端實做出一組完整的 UI Widget 類別,然後再將這組 Widget 的所有函式、甚至所有類別,註冊給 Lua 端自行呼叫使用。 另一種方法則是在 Lua Script 中包含資料描述以及核心功能,將 GUI 系統的全部相關功能全權交由 Lua 端處理。 而 C++ 端程式,則負責發送鍵盤與滑鼠的輸入訊息給 Lua 端程式,供 GUI 系統判斷各種 UI 事件。 使用上述的架構,在 C++ 端只需要實現唯一一個類別:GuiManager,做為 Facade 介面與遊戲引擎的其他系統溝通。 對整個 Lua-based GUI 系統的架構有了基礎的概念,並且瞭解 GUI 系統的 C++ 端如何運作之後,接著先看看在遊戲中使用 GUI Script 的實例: Frame { name = "ingame", x = 0, y = 0, width = 20, height = 20, backdrop = "Image/bk.png", Button { name = "ingame_main", x = 0, y = 0, width = 15, height = 20, graphics = StandardButtonGraphics, mouse_up = function() Gui.ShowFrame("main_menu"); Core.SetGameState(GAME_PAUSE); end, }; } Lua源码剖析(一) - 但行好事 莫问前程 - ITeye博客. Live coding in Lua with ZeroBrane Studio - ZeroBrane.

I was working on a lightweight Lua IDE for those who want to learn programming when I came across Bret Victor's Inventing On Principle and Kill Math projects.

Live coding in Lua with ZeroBrane Studio - ZeroBrane

If you haven't seen them before, I recommend you spend a bit of time listening to his ideas about interactive design. Just don't close this page and come back when you're done as I'll show you how you can do some of it with Lua scripts today. The core part of the message is that designers need an immediate connection to their creations and even a short update-run-use loop may be too long to explore a variety of different options, parameters, and their interactions. Sometimes the relations or dependencies between variables become more obvious when you not only have a way to interact with the object, but also control the interaction.

The live coding feature I am going to present gives you that ability. The functionality is highly experimental, but I have tested it on various scripts without problems. Coxpcall - Coroutine Safe xpcall and pcall. LuaDoc: Documentation Generator Tool for the Lua language. Overview LuaDoc is a documentation generator tool for Lua source code.

LuaDoc: Documentation Generator Tool for the Lua language

It parses the declarations and documentation comments in a set of Lua source files and produces a set of XHTML pages describing the commented declarations and functions. The output is not limited to XHTML. Other formats can be generated by implementing new doclets. The format of the documentation comments is also flexible and can be customized by implementing new taglets. ZeroBrane Studio - Lua IDE/editor/debugger for Windows, Mac OSX, and Linux. WxWidgets: Cross-Platform GUI Library. Development blog: Fixing memory issues in Lua. Garbage collection can be both a blessing and a curse. On the one hand, it frees you from manually managing memory. This saves development time, reduces bugs, and avoids tricky decisions about objects' ownerships and lifetimes. On the other hand, when you do run into memory issues (and you most likely will), they can be a lot harder to diagnose and fix, because you don't have detailed control over how memory is allocated and freed.

Professional LuaIDE.