Mic check... or 2018 annual report :)
It's been a year this month since I started working on luapower again after 2 years of absence, and since I haven't posted anything on this forum in a while, I thought I'd take some time to go through the git logs and make a little report of what happened in the past 12 months. In a future message I will also lay out some future directions for this project. As usual, all the code is in Public Domain so you can use it without restrictions of any kind. Ok, story time!
Work (re)started in October 2017. The thing I did first was to fix a longstanding issue that was taking in a lot of time for me which is building binaries and testing on all 6 platforms that luapower runs on (Win, Linux, OSX, 32 and 64bit). So I bought a minimac, plugged it into my LAN and along with my two Ubuntu VMs and Win7 desktop machine I created an automated CI that would build binaries, run tests and collect dependency info automatically on all platforms. This fully scripted environment is documented and can be reproduced by anyone (relevant github repos on github.com/luapower/: vps, luapower-ci, ci_linux, ci_windows, ci_osx, ci_linux_lxc).
After that was in place I started working on some new libraries as well as finishing some old ones. I'll list them in roughly chronological order along with a little rationale/story for each one.
luapower.com/mustache (oct 2017) - full-spec mustache parser and renderer. This is beyond luapower's scope which is desktop apps, but I needed this for an outside project. I needed a mustache implementation that would match the official JS one perfectly in terms of output, which at the minimum means running all the official mustache tests, and although there are a few existing Lua implementations, none of them would pass all the mustache tests. I also tried to upgrade one existing implementation but I found the code too complex and gave up. The reason for seeking this level of compatibility is that I was making a single-page webapp in which templates would be rendered in Lua on the server on the first request, but subsequently rendered on the client side in JS so the output would have to look the same.
luapower.com/objc (oct 2017) - Objective-C bridge. Fixed it for OSX 10.10 when they broke Cocoa. This library is useless now on 10.13+ when they broke the bridgesupport files (as is any objc bridge for any language for that matter, python, ruby, LuaCocoa, you name it). I suppose it could be fixed, but I'm not sure OSX would be around long enough to see that :) I mostly wrote objc for luapower.com/nw in the first place, so lately I was thinking of wrapping those ObjC calls in a C layer and use that via ffi and ditch objc altogether. We'll see when I'll get back on porting for the Mac (I code everything for Windows first).
luapower.com/coro (nov 2017) - symmetric coroutines. This little lib implements the idea of symmetric coroutines, which I first read about in this paper http://www.inf.puc-rio.br/~roberto/docs/corosblp.pdf. The paper comes with a very short implementation which although very enlightening, is also limited. The problem with built-in Lua coroutines is that you can't do coroutine-based I/O inside other coroutines. Symmetric coroutines can solve that in principle, but the implementation in the paper does not allow mixing yield() and transfer() in the same code. This implementation fixes that so you can now make coroutine-based iterators and protocols around coroutine-scheduled I/O without problems.
luapower.com/rsync (nov 2017) - rsync algorithm in Lua. I reimplemented rsync in Lua mostly to see if it could compete with librsync, and because librsync does not have a 100% push-style API and thus cannot be used with coroutine-based I/O. There are benchmarks you can run. Overall the speed is good, but I'm still considering implementing the missing push-style API in librsync because librsync is still faster. The librsync binding is at github.com/luapower/librsync.
luapower.com/fs (dec 2017) - Portable filesystem API. I wanted to write this for a long time and get rid of lfs which after many years can't open files with accented letters on Windows. It also supports symlinks and hardlinks on all platforms as well as getting and setting all platform-specific file attributes and permissions. A memory mapping API is also in the works (but not a priority at the moment). luapower.com/path and a smaller lib (luapower.com/unixperms) for parsing unix perm strings are offshots (and depdencies) of this library.
luapower.com/path (dec 2017) - Path manipulation for Windows and UNIX paths in Lua. This misery took 2 weeks to get right and it's 500 LOC but it is necessary if you want to operate on arbitrary files and directories correctly and portably.
luapower.com/winapi.cairopanel, luapower.com/winapi.wglpanel -- moved those two out of winapi in order to have winapi clean of dependencies (they weren't hard dependencies anyway but now they're also no longer listed as dependencies on the website, which some people found confusing).
luapower.com/amoeba - forked the Lua implementation of github.com/starwing/amoeba, a Cassowary constraint solver. I found this to be a very clean and very fast implementation and planning to use it for an upcoming layouting system in luapower.com/ui.
luapower.com/bmp (feb 2016) - BMP file loading and saving.
luapower.com/easing (feb 2018) - separated the in/out/in-out/out-in modes from the actual easing formulas so that new formulas can be added without implementing all those modes redundantly (which are just different ways to use the formulas).
luapower.com/tweening (feb 2018) - Tweening module for vector-based animation. This is on par with GSAP without plugins in terms of timing model, animation model and runtime features. See the demos and docs for more info.
github.com/luapower/imgui (ian-apr 2018) - wasted a few months implementing an IMGUI. Gave up on it and started working on a classic object-oriented UI lib which I'll talk about later.
luapower.com/bitmap (mar 2018) - mainly bug fixes and API doc additions.
luapower.com/boxblur (mar 2018) - reimplemented boxblur in C/SSE2 based on the moving-averange algorithm. Supports both 8-bit grayscale and BGRA8 formats. I remember getting > 200 fps on a 1080p grayscale bitmap on my machine, but see for yourself, YMMV. Benchmarks included. I'm far from an expert in optimization so any tips on speeding this up further are very welcome.
luapower.com/rs232 (jun 2018) - RS232 lib leveraging
(jul 2018) Deprecated a lot of libs and moved them all in a meta-repo at github.com/luapower/luapower-repos-dev/. These are libs that I no longer have an interest in or have better alternatives for. You can still clone them with
mgit clone-allif you clone the above repo first (with
mgit clone https://github.com/luapower/luapower-repos-dev).
luapower.com/bundle (sometime 2018) - fs drop-in replacement APIs
fs.open(). Allows embedding directory listings and files in executables.
What I'm working on now
- luapower.com/tr (jul-sep 2018) - Unicode text shaping and rendering written in Lua. Supports subpixel positioning, emoticons, word wrapping, alignments, hit testing, clipping, cursors, selections, editing, control over OpenType features, moving, coloring and editing inside ligatures, OpenType-assisted auto-hinter. Other features are still missing (see the project page). I wrote this lib because AFAIK there's no free C lib that does this except Pango which depends on GObject and fontconfig and the implementation itself is orders of magnitude larger than what it could be in Lua, and also because I wanted to have the opportunity to add more hi-level features like embedding widgets in text for example.
tris based on many libs which have Lua bindings themselves and you can use independently:
- luapower.com/harfbuzz - does Unicode/OpenType shaping
- luapower.com/fribidi - implements the Unicode Bidirectional Algorithm
- luapower.com/ucdn - Unicode character classification
- luapower.com/freetype - glyph rasterization
- luapower.com/libunibreak - Unicode line/char/word breaking algorithms
- luapower.com/utf8 - UTF-8 encoding & decoding in Lua
- luapower.com/gfonts - selecting fonts by name from the Google Fonts repo
- luapower.com/dlist - doubly-linked list in Lua
- luapower.com/lrucache - LRU cache in Lua
- luapower.com/glue (tuples function, for multi-value indexing).
- luapower.com/ui (feb 2018 - present) - cross-platform UI library with styles, animations and (soon) layouts.
- Uses luapower.com/nw for creating native windows and getting mouse and keyboard input as well as for other OS GUI-related APIs like copy/pasting, notification icons, native menus, etc. This layer can be replaced by libs like SDL if needed.
- Uses luapower.com/cairo for drawing but all drawing code is isolated so it can be replaced with any 2D vector graphics lib.
- The widgets themselves are custom drawn and customizable with cascading styles and animated with transitions which are also declared in css (even caret blinking is done in css).
- Uses the luapower.com/boxblur for shadows.
- Uses luapower.com/oo as OOP library.
- Widgets are built upon a base layer object which implements all the drawing, positioning, clipping, layouting, hit testing, keyboard focusing functionality, similar to html layers.
- Tablist: tabs can be moved around and between tablists. Docking is next.
- Grid: the largest and most versatile widget for data-centric (business/operational) GUIs. Currently at only 2200 LOC is already editable and can smooth-scroll and select 1 million rows instantly, includes a vertical split pane, movable and resizable columns, stylable cells, etc. Next is tree-list, group-by row, data-binding, etc. The plan is to make this on par with the grids made by DevExpress (which I think can be achieved with a lot fewer LOC).
- Editbox: single line, multi-line, password mask.
- Dropdown menu with different picker widgets (grid, color picker).
- Buttons (incl. radio, checkbox, multi-choice).
- Color picker with HSL/HSV squares etc.
- Scrollbox with autohide scrollbars.
That's it for now. I'm sure I'm forgetting some stuff, I'll try to add more as I remember. As always, comments, questions, feedback appreciated.