User Tools

Site Tools


programming:lua

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
programming:lua [2021/04/02 19:16]
nanodano [Installing]
programming:lua [2021/04/14 02:44] (current)
nanodano [Executing code]
Line 25: Line 25:
 </code> </code>
  
-===== Hello World =====+===== Executing code =====
  
-There are a few ways you could execute the Hello World code.+There are a few ways you could execute a script:
  
   * In the interactive REPL: ''lua''   * In the interactive REPL: ''lua''
   * By invoking the Lua interpreter and passing it a file: ''lua hello.lua''   * By invoking the Lua interpreter and passing it a file: ''lua hello.lua''
-  * By executing a script directly with a shebang (''#!/usr/bin/lua'')''./hello'' +  * By executing a script directly with a shebang (e.g. ''#!/usr/bin/lua''and run with ''./hello'' 
-  * Running a precompiled script (''luac hello.lua''): ''lua luac.out''+  * Running a precompiled script. Compile with ''luac hello.lua'' and run with ''lua luac.out'' 
 + 
 +===== Hello World =====
  
 <code lua hello_world.lua> <code lua hello_world.lua>
 print 'hello world' print 'hello world'
 </code> </code>
programming/lua.1617391013.txt.gz · Last modified: 2021/04/02 19:16 by nanodano