Lua Is So Underrated

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. CorsixTH-ljs

    A port of CorsixTH to LJS

    The idea was to be able to convert any existing Lua code automatically and get it working as before like I did with some non trivial projects like:

    - https://github.com/mingodad/CorsixTH-ljs

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. ZeroBraneStudioLJS

    Port of ZeroBraneStudio from lua to ljs

  4. extism

    The framework for building with WebAssembly (wasm). Easily load wasm modules, move data, call functions, and build extensible apps.

    The WebAssembly component model is aimed at having composable components that can call each other. The components can be written in any language, compiled to WebAssembly, and interoperate: https://github.com/WebAssembly/component-model/

    Extism is a plugin framework for WebAssembly:

    https://extism.org/

    https://github.com/extism/extism

    Visual Studio Code can run WebAssembly extensions: https://code.visualstudio.com/blogs/2024/05/08/wasm

    A project to bring WebAssembly plugins to Godot: https://github.com/ashtonmeuser/godot-wasm

    WasmEdge can be embedded in applications: https://wasmedge.org/docs/embed/overview

    Wasmer can be embedded in applications: https://blog.wasmer.io/executing-webassembly-in-your-rust-ap...

    Wasmtime can be embedded in applications: https://docs.wasmtime.dev/lang.html

  5. terra

    Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.

    If you like Lua, see Terra, https://terralang.org/

    > Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.. Like C/C++, Terra is a statically-typed, compiled language with manual memory management. But unlike C/C++, it is designed from the beginning to be meta-programmed from Lua.. In Terra, we just gave in to the trend of making the meta-language of C/C++ more powerful and replaced it with a real programming language, Lua.

  6. luau

    A fast, small, safe, gradually typed embeddable scripting language derived from Lua

    Luau (developed by Roblox) is a fork of Lua 5.1 with some very significant improvements to speed and QoL. It also alleviates the nil-terminated array problem.

    https://github.com/luau-lang/luau

  7. sol2

    Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:

    The Lua C API is fantastic from a design perspective, but as you have discovered, it is rather error prone. Fortunately, there are many wrapper libraries that take care of all the stack manipulation. For example, I'm using https://github.com/ThePhD/sol2 to interface with C++ and the API is incredibly ergonomic.

  8. fullmoon

    Fast and minimalistic Redbean-based Lua web framework in one file.

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. embedded-scripting-languages

    A list of embedded scripting languages

    I agree. Also tables are quite weird, and 1-based indexing is definitely a mistake (sorry 1 fans but it is).

    I think it just doesn't have much competition in the "embeddable languages" space unfortunately.

    As another commenter said, JavaScript is probably the best choice in most cases today.

    There's a list of options here but most of them are not really good options usually:

    https://github.com/dbohdan/embedded-scripting-languages

    E.g. Python would be a terrible choice in most cases. Awk? Some of them aren't even general purpose programming languages like Dhall.

    If you narrow it down to embeddable-like-Lua there are hardly any.

  11. moddable

    Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers.

  12. quickjs

    Public repository of the QuickJS Javascript Engine.

  13. bubbleos

    I feel like this post doesn't really get into what I like about Lua, which is pretty unfortunate.

    I'm not a huge Lua fan. Though on projects with others I'll use whatever language they're using, left to my own devices, I probably write about 3× as much JS as Lua, about 32× as much Python as Lua, and about 20× as much C as Lua.

    But Lua has some really nice features.

    First, LuaJIT is motherfucking alien technology from the future. I wrote a straightforward escape-time fractal renderer in https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/mand.l... with a dynamic function invocation in the inner loop (to switch between fractals) and LuaJIT's trace compilation just compiles that right out. You can literally just write high-level code at like a Python or JavaScript level and, as often as not, it just goes faster than C. (Sometimes it doesn't. JIT compilers are unpredictable and sometimes disappointing.)

    Now, probably somebody is going to reply to this and tell me that everybody runs JS in JIT compilers too, so this isn't a real difference. Unfortunately that's bullshit. I'm sorry, but V8 and SpiderMonkey are just not in the same league, though not because their implementors are less brilliant. They're just attempting a much harder job, because JS is a much hairier language.

    LuaJIT's C FFI is also just, there's no expression in English sufficiently emphatic to express its wonderfulness. Here we might say it's the very child of ten thousand whores. Here's the FFI binding for Yeso, the graphics library used for the above fractal demo: https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/yeso.l...

    (to be continued)

  14. lua-language-server

    A language server that offers Lua language support - programmed in Lua

    I just started using lua and have types in vscode using lua annotations. https://github.com/LuaLS/lua-language-server/wiki/Annotation...

  15. Spring RTS game engine

    A powerful free cross-platform RTS game engine. - Report issues at https://springrts.com/mantis/ (by spring)

    In the Spring/Recoil RTS game engine[1] we adapted Lua to have deterministic execution allowing synchronous multiplayer simulation. In addition we relatively easily implemented a precise[2] serialization of the Lua VM, allowing us to support save/load for games with no code required from their side.

    In other languages these would require much more effort.

    [1] https://github.com/spring/spring or https://github.com/beyond-all-reason/spring (yay for forks!)

    [2] Preserving the order of iteration on items in a hash table.

  16. spring

    A powerful free cross-platform RTS game engine (by beyond-all-reason)

    In the Spring/Recoil RTS game engine[1] we adapted Lua to have deterministic execution allowing synchronous multiplayer simulation. In addition we relatively easily implemented a precise[2] serialization of the Lua VM, allowing us to support save/load for games with no code required from their side.

    In other languages these would require much more effort.

    [1] https://github.com/spring/spring or https://github.com/beyond-all-reason/spring (yay for forks!)

    [2] Preserving the order of iteration on items in a hash table.

  17. ljs

    Lua with C/C++/Java/Javascript syntax

  18. ljs-5.4

    Lua 5.4 with C/C++/Java/Javascript syntax

  19. ljs-5.1

    Lua 5.1.5 with C/C++/Java/Javascript syntax

  20. raptorjit-ljs

    Applying ljs to raptorjit

  21. snabb-ljs

    Snabb packet networking converted to ljs

  22. Luon

    A compiler and IDE for the Luon programming language - a liaison beween Lua and Oberon+ - targeting LuaJIT

    Maybe it's time to check out Luon [1], which has a syntax similar to Oberon and takes some concepts from Lua, it's statically typed and targets the LuaJIT VM. It was recently covered in HN [2]

    [1] https://github.com/rochus-keller/Luon/blob/master/Readme.md

  23. wasm-micro-runtime

    WebAssembly Micro Runtime (WAMR)

    To be able to embed WASM-compiled languages for embedding you first need a small WASM runtime you can depend on (and things like ref types, GC etc which have been standardized only in the last couple of years).

    That didn't exist until recently, but now you can use https://github.com/bytecodealliance/wasm-micro-runtime/blob/...

    I am not aware of anyone using this yet, but I hope to see that become common in the next few years.

  24. component-model

    Repository for design and specification of the Component Model

    The WebAssembly component model is aimed at having composable components that can call each other. The components can be written in any language, compiled to WebAssembly, and interoperate: https://github.com/WebAssembly/component-model/

    Extism is a plugin framework for WebAssembly:

    https://extism.org/

    https://github.com/extism/extism

    Visual Studio Code can run WebAssembly extensions: https://code.visualstudio.com/blogs/2024/05/08/wasm

    A project to bring WebAssembly plugins to Godot: https://github.com/ashtonmeuser/godot-wasm

    WasmEdge can be embedded in applications: https://wasmedge.org/docs/embed/overview

    Wasmer can be embedded in applications: https://blog.wasmer.io/executing-webassembly-in-your-rust-ap...

    Wasmtime can be embedded in applications: https://docs.wasmtime.dev/lang.html

  25. godot-wasm

    Interact with WebAssembly modules from Godot

    The WebAssembly component model is aimed at having composable components that can call each other. The components can be written in any language, compiled to WebAssembly, and interoperate: https://github.com/WebAssembly/component-model/

    Extism is a plugin framework for WebAssembly:

    https://extism.org/

    https://github.com/extism/extism

    Visual Studio Code can run WebAssembly extensions: https://code.visualstudio.com/blogs/2024/05/08/wasm

    A project to bring WebAssembly plugins to Godot: https://github.com/ashtonmeuser/godot-wasm

    WasmEdge can be embedded in applications: https://wasmedge.org/docs/embed/overview

    Wasmer can be embedded in applications: https://blog.wasmer.io/executing-webassembly-in-your-rust-ap...

    Wasmtime can be embedded in applications: https://docs.wasmtime.dev/lang.html

  26. quickjs-emscripten

    Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions

    I’m not sure if wasm would be considered full process isolation but it does provide a software based sandboxing. I’m referring to running quickjs in wasm by compiling it with emscripten.

    https://github.com/justjake/quickjs-emscripten

  27. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

Did you know that C++ is
the 7th most popular programming language
based on number of references?