The Allegory SDK is a self-contained cross-platform programming environment for developing web-based database-driven business apps in LuaJIT and JavaScript.
The server-side stack is written entirely in Lua and contains:
- a coroutine-based scheduler for epoll and IOCP multiplexing.
- a programmable web-server-as-a-library.
- a fully-featured http client and async DNS resolver.
- OS threads with synchronized queues.
- async process execution with pipes and shared memory.
- the fastest libraries for hashing, encryption, compression, image codecs, image resizing, JSON and XML codecs, CSV parsing and XLS generation.
- async connectors for MySQL and Tarantool.
- a powerful SQL preprocessor with conditionals and macros.
- a database schema DSL with automatic schema synchronization.
- ...and more, see full list of modules below.
The client-side stack is written from scratch in JavaScript and contains:
- a virtual editable tree-grid widget that can handle 100,000 records at 60fps.
- a collection of data-bound widgets for data entry, navigation and reporting.
- layouting widgets for split-pane layouts common in data-dense business applications.
- a mechanism for web components better than the native one.
Follow the releases
to see what's new and the dev branch
to see what's cooking for the next release.
Look at the issues
to see what's missing, broken or wanted.
- Operating Systems: Debian 10+, Windows 10
- Browsers: Desktop Chrome, Firefox, Edge (Safari planned)
- CPUs: x86-64 with SSE 4.2 (AVX2 used if found).
Binaries are included in separate repos for each supported platform and are versioned to follow the main repo.
$ git clone git@github.com:allegory-software/allegory-sdk-bin-debian10 bin/linux
> git clone git@github.com:allegory-software/allegory-sdk-bin-windows bin/windows
See our Building Guide which also teaches how create build scripts for new libraries.
- LuaJIT - Custom build of LuaJIT
- Standard Library
- glue - "Assorted lengths of wire" library
- pp - Pretty printer and serializer
- coro - Symmetric coroutines for cross-yielding
- logging - Logging to files and network
- events - Event system (pub/sub) mixin for any object or class
- lpeglabel - PEG (Parsing Expression Grammars) parser with labels
- daemon - Scaffold/boilerplate for writing server apps
- cmdline - Command-line arg processing
- pbuffer - Dynamic binary buffer for decoding and encoding
- Platform APIs
- Multi-threading
- Multi-tasking
- tasks - Task system with process hierarchy, output capturing and scheduling
- Networking
- sock - Sockets & async scheduler for sockets & pipes
- sock_libtls - TLS-encrypted async TCP sockets
- connpool - Connection pools
- resolver - Async DNS resolver
- http_client - Async HTTP(s) 1.1 client for high-volume web scraping
- http_server - Async HTTP(s) 1.1 server
- smtp - Async SMTP(s) client
- url - URL parsing and formatting
- ipv6 - IPv6 conversion routines
- Data Exchange
- Hashing
- Compression
- gzip - DEFLATE & GZIP (based on zlib-ng)
- minizip2 - ZIP file reading, creating and updating (based on minizip-ng)
- Databases
- Raster Images
- jpeg - Fast JPEG decoding & encoding (based on libjpeg-turbo)
- png - Fast PNG decoding & encoding (based on libspng)
- bmp - BMP decoding & encoding
- bitmap - Bitmap conversions
- pillow - Fast image resizing (based on Pillow-SIMD)
- resize_image - Image resizing and format conversion
- Templating
- Data Structures
- heap - Priority Queue
- queue - Ring Buffer
- linkedlist - Linked List
- lrucache - LRU Cache
- Math
- ldecnumber - Fixed-precision decimal numbers math
- rect - 2D rectangle math
- Support Libs
- cpu_supports - check CPU SIMD sets at runtime
- Dev Tools
- debugger - Lua command-line debugger
- Web / Server side
- webb - Procedural web framework
- webb_action - Action-based routing with multi-language URL support
- webb_auth - Session-based authentication
- webb_spa - Single-page app support
- jsmin - JavaScript minification
- Web / Client side
- X-Widgets - Overview of the web components suite
- glue.js - JS "assorted lenghs of wire" library
- divs.js - DOM API and mechanism for web components
- webb_spa.js - SPA client-side counterpart of webb_spa.lua
- x-widgets.js - Web components & layouting widgets
- x-nav.js - Model mixin for data-driven widgets
- x-grid.js - Nav-based virtual tree-grid widget
- x-listbox.js - Nav-based listbox widget
- x-input.js - Nav-based single-value (scalar) widgets
- x-module.js - Persistence layer for widget-based self-editing UIs
- Web / Client side / Support libs
- mustache.js - Logic-less templates on client-side
- purify.js - HTML sanitizer
- markdown-it.js - Markdown parser
The SDK is open to contributions for fixing bugs and improving the existing modules. We also accept new modules but we take the liberty to chose what to include if we are to take resonsibility for maintaining them.
Before issuing a pull request, it might be helpful to read our Programming Guide which contains:
- The Lua coding style guide,
- Notes on programming for LuaJIT,
- Notes on Lua API design.
The Allegory SDK is MIT Licensed. 3rd-party libraries have various non-viral free licenses.
Q: Why Lua (for web apps)?
A: Because Lua is like modern JavaScript, except it got there 10 years earlier and it didn't keep the baggage while doing so. That being said, we're all engineers here, we don't have language affectations. We're just happy to use a language with stackful coroutines, real closures with full lexical scoping, hash maps, a garbage collector, a better ffi than we could ever ask for, and an overall non-opinionated design that doesn't pretend to know better than its user.
Q: Why not OpenResty?
A: We actually used OpenResty in the past, nothing wrong with it. It's probably even faster. It definitely has more features. Nginx is however quite large, not nearly as hackable as our pure-Lua server, it wants to control the main loop and manage threads all by itself, and its configuration directives are inescapably byzantine and undebuggable by trying to do declaratively what is sometimes better done procedurally.
Allegory SDK (c) 2020 Allegory Software SRL