Lua Playground

Write Lua, run it on the BEAM, and watch the register-based bytecode this VM actually executes. No JavaScript Lua. Every byte is Elixir.

Language
Security & limits
Errors
Your first Lua program on the BEAM.
main.lua
Output
idle
Hit Run or press to execute.
Bytecode · Lua.Compiler.Prototype
1 proto
params
0
vararg
yes
registers
4
upvalues
0
Hover a row to highlight every instruction from the same source line. Click to jump the editor there.
PC Line Instruction
000 load_env r0
001 L1 source_line line 1
002 L1 get_open_upvalue r1, r0
003 L1 get_field r2, r1.print
004 L1 move r1, r2
005 L1 load_constant r3, "Hello, Lua on the BEAM!"
006 L1 move r2, r3
007 L1 call r1, args=1, results=0
008 L2 source_line line 2
009 L2 load_constant r1, 42
010 L2 return r1, count=1
Run +
Indent Tab / Shift + Tab
Heads-up Snippets run in a sandboxed VM with a 1.5s timeout.