Download for standalone version of Lua

Posted by Nick Gammon on Wed 24 Nov 2004 06:20 PM — 12 posts, 48,839 views.

Australia Forum Administrator #0
In case you want to play with Lua 'stand-alone' - that is, from a command-line, you can download the precompiled binary from http://www.gammon.com.au/files/mushclient/lua.zip (181 Kb). This archive contains the following files:


122,880 lua.dll
 53,248 lua.exe
 16,492 lua.lib
 57,344 luac.exe
143,360 lualib.dll
  9,562 lualib.lib
  1,877 Readme.txt

The two DLLs implement the Lua 'core' and libraries (they are the same files that ship with MUSHclient). The program 'lua.exe' is stand-alone Lua, and the program 'luac.exe' is the Lua compiler which can be used to make Lua 'binary files'. Just unzip them into a single directory which you can use for testing Lua. The .lib files are needed if you want to write your own DLLs - the export the functions needed for use in Visual C++.

Amended on Wed 24 Nov 2004 07:09 PM by Nick Gammon
Greece #1
You can make native applications with it, or some kind of bytecode or something?
Australia Forum Administrator #2
See other recent post - bytecode.
#3
so weird lor
#4
I can't run a .lua from the exe. Is there something i'm doing wrong? I'm trying to learn the language and I started with the

Print("Hello World")

in a .lua file. But I don't know how to run it from the lua interpreter. Or can't you?
USA #5
Just use "lua <filename>". If the file is named test.lua, use "lua test.lua".

Also, it's print, not Print. Lua is case-sensitive.
#6
Thats what I do. and it says

stdin:1 `=' expected near `hello'

I have no clue what this means.

oh and I do have it as print not Print I just mistyped.
Amended on Tue 22 Jun 2010 10:33 PM by Eldeon
USA #7
You must've mistyped elsewhere too, because what you posted is syntactically correct. Please copy and paste -exactly- what you have in the file. You can put it in [code] [/code] tags to format it nicely.
#8
print("Hello World")


That's all that's in the file. Or do I need more?

and i'm putting in exactly

lua hello.lua

and I get the error message.
Amended on Tue 22 Jun 2010 10:52 PM by Eldeon
USA #9
I notice that you're using "Hello", whereas the error shows "hello". I think maybe you're editing one file and running a different one by mistake, because there's no way you can get that error from this script.


EDIT: Oh, heh. I think I realized what's going on. Don't type "lua hello.lua" from inside the interpreter! Run it from the shell (command prompt in Windows).

This is what I think you're doing (and which you shouldn't do):
$ lua
Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
> lua hello.lua
stdin:1: '=' expected near 'hello'
>


This is what you should be doing:
$ lua hello.lua
Hello World
$



EDIT 2: To execute it from within the interpreter, you can use dofile("hello.lua"). I think this was my fault, for misinterpreting what you asked for.

$ lua
Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
> dofile("hello.lua")
Hello World
>
Amended on Tue 22 Jun 2010 10:41 PM by Twisol
#10
WOW thanks for clearing that up. I hadn't realized that. thanks.
USA #11
You're welcome. Sorry that took so long for such a simple question!