Polycule Discord bot.
  • C 31%
  • Python 20.6%
  • CMake 13.4%
  • Assembly 5.8%
  • Rust 5.7%
  • Other 23.5%
Find a file
2026-11-28 23:15:37 +00:00
scripts Initial Commit 2026-11-28 23:15:37 +00:00
src Initial Commit 2026-11-28 23:15:37 +00:00
.gitignore Initial Commit 2026-11-28 23:15:37 +00:00
CMakeLists.txt Initial Commit 2026-11-28 23:15:37 +00:00
LICENSE Initial Commit 2026-11-28 23:15:37 +00:00
Makefile Initial Commit 2026-11-28 23:15:37 +00:00
README.md Initial Commit 2026-11-28 23:15:37 +00:00

Polybot

Polybot is a Discord bot written in twelve languages. A NASM-defined entry point starts the process, and the assembly dispatcher calls the language runtimes within the same Linux x86-64 address space.

The languages

Language Role
x86-64 assembly (NASM) Owns the entry point and dispatches events through an ELF-relative function table.
C Boots and shuts down the runtimes, embeds CPython, Lua, and QuickJS, and bridges their APIs.
C++ Buffers incoming events in a bounded FIFO, provides a monotonic clock, and enumerates loaded libraries.
Python Runs the Discord Gateway, manages heartbeat and reconnection, and sends Discord REST replies.
Rust Validates event JSON, writes the native event structure, and serializes statistics.
Go Routes command names to stable numeric IDs and supplies the metadata used by registration and /help.
Haskell Evaluates command access, guild context, and the developer user-ID allowlist.
Lua Implements command handlers and supplies response text and embed titles.
Fortran Aggregates heartbeat latency and calculates event rates.
Zig Owns and resizes the buffers used to pass events and responses across language boundaries.
COBOL Appends usage records containing the interaction ID and numeric command ID.
JavaScript (QuickJS) Turns command output and statistics into Discord message data and embeds.

Performance and metrics

it builds fast 👍👍👍 80.6ms media smoke test