gitwtfhub

wtf is l2c?

panshaogui/l2c — explained in plain English

Analysis updated 2026-05-18

3LuaAudience · developerComplexity · 5/5LicenseSetup · hard

TL;DR

A compiler that turns a typed subset of Lua into garbage-collector-free native C, for trading systems and embedded devices.

Mindmap

mindmap
  root((L2C))
    What it does
      Lua to C transpiler
      No garbage collector
      Ahead of time compile
    Tech stack
      Lua
      C
      Docker
      ZeroMQ
    Use cases
      HFT strategies
      Embedded firmware
      Predictable latency
    Audience
      Systems programmers
      Trading engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Write high frequency trading strategy logic without garbage collector pauses.

REASON 2

Compile Lua-like code into firmware for Raspberry Pi Pico or ESP32.

REASON 3

Build small, fast standalone executables with predictable memory use.

What's in the stack?

LuaCDockerZeroMQSQLite

How it stacks up

panshaogui/l2ck0nserv/dotfilesorlp/ncui
Stars333
LanguageLuaLuaLua
Last pushed2026-05-022015-03-13
MaintenanceMaintainedDormant
Setup difficultyhardeasymoderate
Complexity5/52/51/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires Docker and cross-compilation toolchains for embedded targets.

Wtf does this do

L2C is a compiler that turns a strict, typed subset of the Lua programming language into native C code with no garbage collector. It is built for two very different but equally demanding worlds: high frequency trading systems, where even a tiny pause to clean up memory can cost money, and small embedded devices like the Raspberry Pi Pico or ESP32, where there is barely any memory to spare in the first place. The core idea is that Lua's friendly, script like syntax is easy to write, but its usual garbage collector introduces unpredictable pauses. L2C removes that garbage collector entirely and forces the programmer to use fixed, pre-allocated blocks of memory instead. It supports things like fixed size buffers, a pool of memory that can be instantly reset between processing steps, and direct ways to read raw bytes as structured data without the usual conversion overhead. In exchange for this control, L2C deliberately refuses to support features that need a garbage collector, such as joining strings on the fly, flexible dictionaries, closures that capture variables, or coroutines. The project also ships a small standard library of ready made connectors to popular C and C++ tools, covering fast networking, lightweight databases, JSON parsing, asynchronous event loops, and bare metal operating systems for microcontrollers. To build a program, developers write their logic in this typed Lua subset, then use Docker based build environments to compile it into either a small standalone program for a regular computer or firmware for a microcontroller. This is a niche, opinionated tool aimed squarely at experienced systems programmers working on trading software or embedded firmware who want Lua's simpler syntax without giving up the speed and predictability of hand written C. It is not meant as a general purpose Lua compiler, and the maintainer states plainly that requests to add garbage collection support will not be accepted.

Yoink these prompts

Prompt 1
Help me write an L2C strategy file that connects to a ZeroMQ market data feed.
Prompt 2
Explain how L2C's tick-level arena allocator avoids garbage collection.
Prompt 3
Show me how to cross-compile an L2C program for the ESP32.
Prompt 4
What Lua features can't I use in L2C's strict subset?

Frequently asked questions

wtf is l2c?

A compiler that turns a typed subset of Lua into garbage-collector-free native C, for trading systems and embedded devices.

What language is l2c written in?

Mainly Lua. The stack also includes Lua, C, Docker.

How hard is l2c to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is l2c for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.