Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Lua
  3. Penlight

Penlight

MITLua

A collection of pure Lua libraries for data handling, functional programming, and OS path management, inspired by Python's standard library.

Visit WebsiteGitHubGitHub
2.1k stars263 forks0 contributors

What is Penlight?

Penlight is a collection of pure Lua libraries that extend Lua's standard library with utilities for data handling, functional programming, and OS path management. It solves the problem of Lua's minimal standard library by providing Python-inspired modules for common tasks like reading config files, manipulating strings and tables, and managing filesystem paths. This makes Lua more practical for application development and scripting.

Target Audience

Lua developers and scripters who need enhanced standard library functionality for building applications, tools, or scripts, particularly those familiar with Python's conveniences.

Value Proposition

Developers choose Penlight because it offers a comprehensive, Python-inspired toolkit within pure Lua, reducing the need to write boilerplate code or rely on multiple disparate libraries. Its focus on compatibility across Lua versions and pure Lua implementation (for core modules) ensures portability and ease of integration.

Overview

A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions,etc), and OS path management. Much of the functionality is inspired by the Python standard libraries.

Use Cases

Best For

  • Extending Lua's standard library with Python-like utilities
  • Reading and parsing configuration files in Lua applications
  • Implementing functional programming patterns in Lua scripts
  • Managing filesystem paths and operations cross-platform
  • Manipulating strings and tables with advanced operations
  • Building command-line tools with argument parsing support

Not Ideal For

  • High-performance real-time applications where minimal Lua overhead and native C speed are critical
  • Embedded systems with strict memory constraints that cannot tolerate additional library footprint
  • Projects already integrated with game engines like Löve2D that provide their own utility libraries
  • Environments requiring zero external dependencies beyond stock Lua for core file operations

Pros & Cons

Pros

Comprehensive Data Handling

Supports reading Unix config and Windows INI files via the config module, plus tabular data management with 2D array operations, filling gaps in Lua's standard library for application development.

Functional Programming Support

Includes map, reduce, lambda expressions, and list comprehensions through modules like func and comprehension, enabling Python-like coding styles directly in Lua for reduced boilerplate.

OS-Independent Path Management

Provides cross-platform tools for file and directory operations, such as copying, moving, and path queries via the path and dir modules, enhancing portability without OS-specific code.

Enhanced String and Table Utilities

Offers advanced string manipulation like lexical scanning and text wrapping, plus specialized table types like List and Map, extending Lua's built-in capabilities for complex data tasks.

Cons

External Dependencies for Core Features

File and directory functions require LuaFileSystem, and dir.copyfile on Windows needs Alien, adding installation complexity and breaking the pure Lua promise for some operations.

Manual Installation Complexity

While LuaRocks simplifies setup, manual installation involves copying directories and managing module paths, which can be error-prone compared to integrated package managers in other ecosystems.

Potential Performance Overhead

As a pure Lua library with extensive features, it may introduce performance overhead in resource-constrained environments, especially for operations that could be optimized with C extensions.

Frequently Asked Questions

Quick Stats

Stars2,114
Forks263
Contributors0
Open Issues32
Last commit2 days ago
CreatedSince 2010

Tags

#functional-programming#lua-libraries#luajit#path-management#luarocks#lua-library#lua-modules#lua#configuration-parsing#string-manipulation#data-handling#pure-lua

Built With

L
LuaFileSystem
L
Lua

Links & Resources

Website

Included in

Lua4.5k
Auto-fetched 4 hours ago

Related Projects

Lua FunLua Fun

Lua Fun is a high-performance functional programming library for Lua designed with LuaJIT's trace compiler in mind.

Stars2,257
Forks112
Last commit1 year ago
MosesMoses

Utility library for functional programming in Lua

Stars654
Forks102
Last commit6 years ago
RxLuaRxLua

Reactive Extensions for Lua

Stars539
Forks78
Last commit6 years ago
lua-stdliblua-stdlib

General Lua libraries

Stars304
Forks34
Last commit3 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub