Skip to content
/ Lua Public

Equator Lua: Educational Content on the Lua Programming Language

License

AGPL-3.0, Unknown licenses found

Licenses found

AGPL-3.0
LICENSE-AGPL
Unknown
LICENSE-QCDA

qompassai/Lua

Repository files navigation

Qompass AI on Lua

Educational Content on the Lua Programming Language

Repository Views GitHub all releases

Lua
Lua Documentation Lua Tutorials
License: AGPL v3 License: Q-CDA

Qompass AI Lua Icon Lua Solutions
▶️ Qompass AI Quick Start
# Download and run the compiled binary installer
curl -fsSL https://raw.githubusercontent.com/qompassai/dotfiles/main/scripts/qai_lua_installer -o qai_lua_installer && \
  chmod +x qai_lua_installer && \
  ./qai_lua_installer

Alternatively, you can fetch and run the original shell script:

📄 We advise you read the script BEFORE running it 😉
#!/usr/bin/env bash
# qompassai/Lua/scripts/quickstart.sh
# Qompass AI Diver Lua Quick‑Start
# Copyright (C) 2025 Qompass AI, All rights reserved
#################################################### 
set -euo pipefail
PREFIX="$HOME/.local"
mkdir -p "$PREFIX/bin"
NEEDED_TOOLS=(git curl tar make clang)
MISSING=()
need_tool() {
  local t=$1
  if command -v "$t" >/dev/null 2>&1; then
    return 0
  elif [[ -x "/usr/bin/$t" ]]; then
    ln -sf "/usr/bin/$t" "$PREFIX/bin/$t"
    echo " → Added symlink for $t in $PREFIX/bin (not originally in PATH)"
    return 0
  else
    return 1
  fi
}
for tool in "${NEEDED_TOOLS[@]}"; do
  if ! need_tool "$tool"; then
    MISSING+=("$tool")
  fi
done
if [[ ${#MISSING[@]} -gt 0 ]]; then
  printf '\n⚠  The following required tools are missing: %s\n' "${MISSING[*]}"
  if command -v pacman >/dev/null 2>&1 && command -v sudo >/dev/null 2>&1; then
    echo "→ Attempting to install them system‑wide with sudo pacman -S --needed ${MISSING[*]}"
    if sudo -n true 2>/dev/null; then
      sudo pacman -Sy --needed --noconfirm "${MISSING[@]}"
    else
      echo "   (sudo privileges required – please enter your password)"
      sudo pacman -Sy --needed "${MISSING[@]}"
    fi
    for t in "${MISSING[@]}"; do need_tool "$t"; done
  else
    echo "   Please install them with your package manager, then re‑run this script."
    exit 1
  fi
fi
export PATH="$PREFIX/bin:$PATH"
declare -A MENU=(
\[1]="lua 5.1.5"
\[2]="lua 5.2.4"
\[3]="lua 5.3.6"
\[4]="lua 5.4.6"
\[5]="LuaJIT"
)
printf '%s\n' "╭─────────────────────────────────────────────╮"
printf '%s\n' "│       Qompass AI · Lua Quick‑Start          │"
printf '%s\n' "╰─────────────────────────────────────────────╯"
printf '%s\n\n' "    © 2025 Qompass AI. All rights reserved     "
for k in "${!MENU\[@]}"; do printf ' %s) %s\n' "$k" "${MENU\[$k]}"; done
printf '%s\n' " a) all   (default)"
printf '%s\n\n' " q) quit"
read -rp "Choose versions to build \[a]: " choice
choice=${choice:-a}
\[\[ $choice == q ]] && exit 0
VERSIONS=()
if \[\[ $choice == a ]]; then
VERSIONS=(5.1.5 5.2.4 5.3.6 5.4.6 luajit)
else
for n in $choice; do
case $n in
1\) VERSIONS+=("5.1.5") ;;
2\) VERSIONS+=("5.2.4") ;;
3\) VERSIONS+=("5.3.6") ;;
4\) VERSIONS+=("5.4.6") ;;
5\) VERSIONS+=("luajit") ;;
*)
echo "Unknown option $n"
exit 1
;;
esac
done
fi
LUAROCKS\_VERSION="3.12.1"
DEFAULT\_IMPL="luajit"
JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu || echo 4)
: "${CC:=clang}"
CFLAGS="-O3 -march=native -flto -fPIC -pipe -fstack-protector-strong"
LDFLAGS="-flto -Wl,-O1,--as-needed,-z,relro,-z,now"
\[\[ -x $(command -v ld.lld) ]] && LDFLAGS+=" -fuse-ld=lld"
case "$(uname -s)" in
Darwin*)
PLATFORM=macosx
SHARED="-DLUA\_USE\_MACOSX"
;;
MINGW\* | MSYS\* | CYG\*)
PLATFORM=mingw
SHARED=""
;;
\*)
PLATFORM=linux
SHARED="-DLUA\_USE\_LINUX"
;;
esac
add\_to\_rc() {
local rc\_file=$1
local line="export PATH='$PREFIX/bin:$PATH'"
if \[\[ -f "$rc\_file" ]] && ! grep -Fq "$line" "$rc\_file"; then
printf '\n# added by lua quickstart\n%s\n' "$line" >>"$rc\_file"
echo " → PATH updated in $rc\_file"
fi
}
install\_luarocks() {
local lua\_prefix="$1"
local rocks\_prefix="$lua\_prefix"
pushd /tmp >/dev/null
curl -fsSLO "https://luarocks.org/releases/luarocks-$LUAROCKS\_VERSION.tar.gz"
tar xf "luarocks-$LUAROCKS\_VERSION.tar.gz"
cd "luarocks-$LUAROCKS\_VERSION"
./configure \
\--prefix="$rocks\_prefix" \
\--with-lua="$lua\_prefix" \
\--with-lua-include="$lua\_prefix/include" \
\--with-lua-lib="$lua\_prefix/lib"
make -j"$JOBS"
make install
local tag
tag=$(basename "$lua\_prefix" | sed 's/^lua//;s/^luajit$/jit/')
ln -sf "$rocks\_prefix/bin/luarocks" "$PREFIX/bin/luarocks$tag"
popd >/dev/null
rm -rf "/tmp/luarocks-$LUAROCKS\_VERSION"
}
cd /tmp
for v in "${VERSIONS\[@]}"; do
if \[\[ $v == luajit ]]; then
echo -e "\n=== LuaJIT ==="
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git
pushd LuaJIT >/dev/null
make -j"$JOBS" CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
make install PREFIX="$PREFIX/luajit"
ln -sf "$PREFIX/luajit/bin/luajit" "$PREFIX/bin/luajit"
popd >/dev/null && rm -rf LuaJIT
install\_luarocks "$PREFIX/luajit"
continue
fi
echo -e "\n=== Lua $v ==="
curl -fsSLO "https://www.lua.org/ftp/lua-$v.tar.gz"
tar xf "lua-$v.tar.gz" && rm "lua-$v.tar.gz"
pushd "lua-$v" >/dev/null
make "$PLATFORM" CC="$CC" MYCFLAGS="$CFLAGS $SHARED" MYLDFLAGS="$LDFLAGS" -j"$JOBS"
$CC "$CFLAGS" -shared -o src/liblua.so -Wl,--whole-archive src/liblua.a -Wl,--no-whole-archive -lm
short=${v%.\*}
dest="$PREFIX/lua$short"
make install INSTALL\_TOP="$dest"
install -m 755 src/liblua.so "$dest/lib"
ln -sf "$dest/bin/lua" "$PREFIX/bin/lua$short"
ln -sf "$dest/bin/luac" "$PREFIX/bin/luac$short"
popd >/dev/null && rm -rf "lua-$v"
install\_luarocks "$dest"
cat >"$dest/lib/pkgconfig/lua$short.pc" <\

Or, View the quickstart script.

🧭 About Qompass AI

Matthew A. Porter
Former Intelligence Officer
Educator & Learner
DeepTech Founder & CEO

Publications

ORCID ResearchGate Zenodo

Developer Programs

NVIDIA Developer Meta Developer HackerOne HuggingFace Epic Games Developer

Professional Profiles

Personal LinkedIn Startup LinkedIn

Social Media

X/Twitter Instagram Qompass AI YouTube

🔥 How Do I Support
🏛️ Qompass AI Pre-Seed Funding 2023-2025 🏆 Amount 📅 Date
RJOS/Zimmer Biomet Research Grant $30,000 March 2024
Pathfinders Intern Program
View on LinkedIn
$2,000 October 2024

🤝 How To Support Our Mission

GitHub Sponsors Patreon Liberapay Open Collective Buy Me A Coffee

🔐 Cryptocurrency Donations

Monero (XMR):

Support via Monero

Monero QR Code
42HGspSFJQ4MjM5ZusAiKZj9JZWhfNgVraKb1eGCsHoC6QJqpo2ERCBZDhhKfByVjECernQ6KeZwFcnq8hVwTTnD8v4PzyH
📋 Copy Address

Funding helps us continue our research at the intersection of AI, healthcare, and education

Frequently Asked Questions

Q: How do you mitigate against bias?

TLDR - we do math to make AI ethically useful

A: We delineate between mathematical bias (MB) - a fundamental parameter in neural network equations - and algorithmic/social bias (ASB). While MB is optimized during model training through backpropagation, ASB requires careful consideration of data sources, model architecture, and deployment strategies. We implement attention mechanisms for improved input processing and use legal open-source data and secure web-search APIs to help mitigate ASB.

AAMC AI Guidelines | One way to align AI against ASB

AI Math at a glance

Forward Propagation Algorithm

$$ y = w_1x_1 + w_2x_2 + ... + w_nx_n + b $$

Where:

  • $y$ represents the model output
  • $(x_1, x_2, ..., x_n)$ are input features
  • $(w_1, w_2, ..., w_n)$ are feature weights
  • $b$ is the bias term

Neural Network Activation

For neural networks, the bias term is incorporated before activation:

$$ z = \sum_{i=1}^{n} w_ix_i + b $$ $$ a = \sigma(z) $$

Where:

  • $z$ is the weighted sum plus bias
  • $a$ is the activation output
  • $\sigma$ is the activation function

Attention Mechanism- aka what makes the Transformer (The "T" in ChatGPT) powerful

The Attention mechanism equation is:

$$ Attention(Q, K, V) = softmax(\frac{QK^T}{\sqrt{d_k}})V $$

Where:

  • $Q$ represents the Query matrix
  • $K$ represents the Key matrix
  • $V$ represents the Value matrix
  • $d_k$ is the dimension of the key vectors
  • $\text{softmax}(\cdot)$ normalizes scores to sum to 1

Q: Do I have to buy a Linux computer to use this? I don't have time for that!

A: No. You can run Linux and/or the tools we share alongside your existing operating system:

  • Windows users can use Windows Subsystem for Linux WSL
  • Mac users can use Homebrew
  • The code-base instructions were developed with both beginners and advanced users in mind.

Q: Do you have to get a masters in AI?

A: Not if you don't want to. To get competent enough to get past ChatGPT dependence at least, you just need a computer and a beginning's mindset. Huggingface is a good place to start.

Q: What makes a "small" AI model?

A: AI models ~=10 billion(10B) parameters and below. For comparison, OpenAI's GPT4o contains approximately 200B parameters.

What a Dual-License Means

Protection for Vulnerable Populations

The dual licensing aims to address the cybersecurity gap that disproportionately affects underserved populations. As highlighted by recent attacks[1], low-income residents, seniors, and foreign language speakers face higher-than-average risks of being victims of cyberattacks. By offering both open-source and commercial licensing options, we encourage the development of cybersecurity solutions that can reach these vulnerable groups while also enabling sustainable development and support.

Preventing Malicious Use

The AGPL-3.0 license ensures that any modifications to the software remain open source, preventing bad actors from creating closed-source variants that could be used for exploitation. This is especially crucial given the rising threats to vulnerable communities, including children in educational settings. The attack on Minneapolis Public Schools, which resulted in the leak of 300,000 files and a $1 million ransom demand, highlights the importance of transparency and security[8].

Addressing Cybersecurity in Critical Sectors

The commercial license option allows for tailored solutions in critical sectors such as healthcare, which has seen significant impacts from cyberattacks. For example, the recent Change Healthcare attack[4] affected millions of Americans and caused widespread disruption for hospitals and other providers. In January 2025, CISA[2] and FDA[3] jointly warned of critical backdoor vulnerabilities in Contec CMS8000 patient monitors, revealing how medical devices could be compromised for unauthorized remote access and patient data manipulation.

Supporting Cybersecurity Awareness

The dual licensing model supports initiatives like the Cybersecurity and Infrastructure Security Agency (CISA) efforts to improve cybersecurity awareness[7] in "target rich" sectors, including K-12 education[5]. By allowing both open-source and commercial use, we aim to facilitate the development of tools that support these critical awareness and protection efforts.

Bridging the Digital Divide

The unfortunate reality is that too many individuals and organizations have gone into a frenzy in every facet of our daily lives[6]. These unfortunate folks identify themselves with their talk of "10X" returns and building towards Artificial General Intelligence aka "AGI" while offering GPT wrappers. Our dual licensing approach aims to acknowledge this deeply concerning predatory paradigm with clear eyes while still operating to bring the best parts of the open-source community with our services and solutions.

Recent Cybersecurity Attacks

Recent attacks underscore the importance of robust cybersecurity measures:

  • The Change Healthcare cyberattack in February 2024 affected millions of Americans and caused significant disruption to healthcare providers.
  • The White House and Congress jointly designated October 2024 as Cybersecurity Awareness Month. This designation comes with over 100 actions that align the Federal government and public/private sector partners are taking to help every man, woman, and child to safely navigate the age of AI.

By offering both open source and commercial licensing options, we strive to create a balance that promotes innovation and accessibility. We address the complex cybersecurity challenges faced by vulnerable populations and critical infrastructure sectors as the foundation of our solutions, not an afterthought.

References