This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
programming:lua [2021/04/02 06:43] nanodano [Hello World] |
programming:lua [2021/04/14 02:44] (current) nanodano [Executing code] |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| Also search for other packages with '' | Also search for other packages with '' | ||
| - | If you want to build from source, it's very easy because it's so portable and written in ANSI C. Simply [[https:// | + | If you want to build from source, it's very easy because it's so portable and written in ANSI C. Simply [[https:// |
| <code bash> | <code bash> | ||
| Line 25: | Line 25: | ||
| </ | </ | ||
| - | ===== Hello World ===== | + | ===== Executing code ===== |
| - | There are a few ways you could execute | + | There are a few ways you could execute |
| * In the interactive REPL: '' | * In the interactive REPL: '' | ||
| * By invoking the Lua interpreter and passing it a file: '' | * By invoking the Lua interpreter and passing it a file: '' | ||
| - | * By executing a script directly with a shebang (''# | + | * By executing a script directly with a shebang (e.g. ''# |
| - | * Running a precompiled script | + | * Running a precompiled script. Compile with '' |
| + | |||
| + | ===== Hello World ===== | ||
| <code lua hello_world.lua> | <code lua hello_world.lua> | ||
| print 'hello world' | print 'hello world' | ||
| </ | </ | ||