Show HN: Lunar, a "fast", memory-efficient Lua 5.1 VM written in Go
Show HN (score: 6)Description
The embedding API avoids the Lua C API’s stack-based interface in favor of typed Go values and callback frames. Libraries and script-file access are opt-in, so the host explicitly controls what Lua code can access.
On my current benchmarks and use-cases, Lunar is often ~1.5x to 2x faster than GopherLua and Shopify’s go-lua. Its largest improvement however is memory use: loading a 9 MB CBOR-derived object graph (hundreds of thousands of tables) allocates about 107 MB versus 785 MB with GopherLua, with roughly 72 MiB versus 542 MiB retained after GC.
The public API is still stabilizing, and I’d especially appreciate feedback on the embedding design and Go interface.
(Note that this project started in another repo when I still had hopes of porting some of my changes back upstream to another existing library.)
More from Show
Show HN: Latex.to – LaTeX to PDF via Full Tex Live in the Browser
Show HN: Latex.to – LaTeX to PDF via Full Tex Live in the Browser Hi HN, I implemented your feedback:<p>latex.to is an Overleaf alternative that now runs a full Tex Live distribution in the browser.<p>This is done via CheerpX (JIT wasm engine) running a 32bit alpine image with TeX Live.<p>Things I previously tried: - originally this project started with just KaTeX for LaTeX to image - v86 wasm engine: Too slow (at least 10 times slower than CheerpX) - various TeX Live binaries wasm ports: These usually don't port Biber (because it's a Perl app) or engines like ConTeXt.<p>What makes this work: - CheerpX only streams (via HTTP range requests) the data it needs. Compiling the base example only downloads 50 MB (the whole image is 5GB). - Cloudflare R2 can only cache files less than 512MB. Hence the 5GB image is split into 1 base image and 19 mount images. - LaTeX needs to bake (index) the fonts before compiling which can take a long time and can OOM CheerpX. Hence all fonts more than 0.7 MB are prebaked into the image file.<p>The first compile is a bit slower because it needs to download assets like fonts, but everything is cached and the second compile is much faster.<p>100% free, no login, no compile timeout, documents are compiled in the browser and NOT sent to a remote server.<p>Please let me know in case something doesn't work / you have any questions or feedback.
No other tools from this source yet.