/allegory-sdk

:candy: Allegory SDK

Primary LanguageLuaMIT LicenseMIT

The Allegory SDK

The Allegory SDK is a self-contained cross-platform low-code 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.
  • an async DNS resolver.
  • a fully-featured http client.
  • async connectors for MySQL and Tarantool.
  • OS threads APIs, low-level and high-level.
  • ...see full list of modules below.

The client-side stack is written from scratch in JavaScript and contains:

  • a virtual editable tree-grid widget, snappy a 100K records.
  • a collection of data-bound widgets for data entry, navigation and reporting.
  • layouting widgets for split-pane layouts.
  • a mechanism for web components better than the native one.

Status

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.

Compatibility

  • 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

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

Building

See our Building Guide which also teaches how create build scripts for new libraries.

Runtime

  • LuaJIT - Custom build of LuaJIT

Modules

  • Standard Library
    • glue - "Assorted lengths of wire" library
    • pp - Pretty printer and serializer
    • coro - Symmetric coroutines for cross-yielding
    • errors - Structured exceptions for writing network protocols
    • logging - Logging to files and network
    • lpeglabel - PEG (Parsing Expression Grammars) parser with labels
    • $, $log, $fs, $sock - "Drop your tools on the floor" modules
    • $daemon - Scaffold/boilerplate for writing server apps
  • Platform APIs
    • time - Wall clock, monotonic clock, sleep
    • fs - Filesystems, pipes, memory mapping
    • proc - Async process execution with I/O redirection
    • path - Path manipulation
    • unixperms - Unix permissons string parser
  • Multi-threading
    • pthread - Low-level threads
    • luastate - Create Lua interpreters to use with OS threads
    • thread - High-level threads API based on pthread and luastate
  • Networking
    • sock - Sockets & async scheduler for sockets & pipes
    • sock_libtls - TLS-encrypted async TCP sockets
    • linebuffer - Line buffer for text-based network protocols
    • 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
    • uri - URI manipulation
    • ipv6 - IPv6 conversion routines
  • Data Exchange
    • base64 - Base64 encoding & decoding
    • cjson - Fast JSON encoding & decoding
    • msgpack - MessagePack encoding & decoding
    • expat - XML parsing
    • genx - XML formatting
    • csv - CSV parsing
    • xlsxwriter - Excel 2007+ XLSX file generation
    • multipart - Multipart MIME encoding
  • Hashing
  • Compression
  • Databases
    • sqlpp - SQL preprocessor
    • mysql - MySQL async driver
    • tarantool - Tarantool async driver
    • schema - Database schema diff'ing and migrations
  • Raster Images
  • Templating
  • Data Structures
  • Math
    • ldecnumber - Fixed-precision decimal numbers math
    • box2d - 2D rectangle math
  • Support Libs
  • Web / Server side
    • webb - Procedural web framework
    • webb_action - Action-based routing with multi-language URL support
    • webb_query - SQL database access
    • webb_auth - Session-based authentication
    • webb_spa - Single-page app support
    • jsmin - JavaScript minification
  • Web / Client side
  • Web / Client side / Support libs

Contributing

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.

License

The Allegory SDK is MIT Licensed. 3rd-party libraries have various non-viral free licenses.

FAQ

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 inevitably byzantine and undebuggable by trying to do declaratively what is sometimes better done procedurally.


Allegory SDK (c) 2020 Allegory Software SRL