# clx kompiliert Lua nativ – ganz ohne Lua-VM

Original title: Trials and Tribulations of Native Lua Compilation

> Hacker News story 50142296 · language: de · submitted 2026-10-18
> Web version: https://zeli.app/de/story/50142296
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 30 · by [_samt_](<https://news.ycombinator.com/user?id=_samt_>) · 💬 16
[original](<https://samyeyo.github.io/clx/blog.html>) · [HN discussion](<https://news.ycombinator.com/item?id=50142296>)

## Summary

Lua ist klein und leicht einzubetten, doch jede Anwendung schleppt eine Lua-VM mit. Der Autor hat mit clx einen Compiler gebaut, der Lua-5.5-Quellcode in C++ übersetzt und mit Clang, GCC oder MSVC zu echten nativen Executables kompiliert. Die clx-Runtime liefert Tabellen, Strings, Garbage Collection und Coroutinen, aber keine Bytecode-Interpretation. Module, native C++-Bibliotheken und sogar dynamisches Laden per --dynamic bleiben möglich – und kleinere, schnellere Programme sind ein willkommener Nebeneffekt.

## Key quote

> Das Schwierige an einem nativen Lua-Compiler war nicht, Code für if, while oder arithmetische Ausdrücke zu erzeugen. Die Kunst bestand darin, Luas Semantik zu bewahren und gleichzeitig auszunutzen, dass das Ziel nun nativer Code war.

---

## Cite

- Page: https://zeli.app/de/story/50142296
- Date: 2026-10-18
- Source: samyeyo.github.io (https://samyeyo.github.io/clx/blog.html)
- Hacker News: https://news.ycombinator.com/item?id=50142296

## Other languages

- en: https://zeli.app/story/50142296 · markdown: https://zeli.app/story/50142296.md
- zh: https://zeli.app/zh/story/50142296 · markdown: https://zeli.app/zh/story/50142296.md
- ja: https://zeli.app/ja/story/50142296 · markdown: https://zeli.app/ja/story/50142296.md
- ko: https://zeli.app/ko/story/50142296 · markdown: https://zeli.app/ko/story/50142296.md
- es: https://zeli.app/es/story/50142296 · markdown: https://zeli.app/es/story/50142296.md
- ru: https://zeli.app/ru/story/50142296 · markdown: https://zeli.app/ru/story/50142296.md
