Isn’t LUA similar to C++, but easier, shorter, and you don’t need a compiler?

Lua is written in C, still needs a compiler/interpreter, and is meant to be a scripting language. In short, it’s not meant to be compared against C++.

But you can’t deny there are quite a few similarities can you?

Barely. About all they have in common is Lua’s optional semicolons and garry manually adding C-style operators and comments. They aren’t really similar beyond being programming/scripting languages.

No they aren’t similar. One is an interpreted scripting language aimed to be high level (more like English) and the other is a powerful low level compiled language which gives you direct access to memory management. Lua is more like other scripting languages I think, such as Python. In games scripting languages are usually interfaced to an engine using a more low level and complex language (such as in Gmod’s lua is an interface to the source engine which is C++.)

ok shut the fuck up and stop replying to this thread i don’t need your life story

My, my. A bit testy. C++ and Lua are alike in the sense that they are both languages, otherwise they are drastically different. To make such an oblivious comparison should be after you experience coughlearncough both languages instead of simply making an assumption. Garry’s Mod in itself is a compiler in scope of Lua, but otherwise how would you go about running a Lua application? Have you even considered that all a .lua file is is blatantly a .txt file in disguise? It can do nothing on its own because a computer cannot understand our words until they are boiled down to what they mean. (Binary, my boy.)

Wow, anger problem?

As the others have said GMod Lua is very high level. It a couple similarities but is a whole lot easier to read, execute, debug. More so like a BASIC (i.e. VisualBasic/REALbasic but not compiled)

So in short, we can say that Lua != C++. Or should I say ~=?

I would say VB / RealBasic is one step up the ladder from lua. They are both even more basic.



In response to this.

Well I had (Life story) a class that had C++ and JAVA and when I did C++ I didn’t notice too many similarities, obviosly there are similarities between most codes (at least something), but JAVA was much more similar to Lua than C++.

At least it helped me learn it better. However, I had some sort of different JAVA and it wasnt the one that (at least to me) looked like HTML.

Do you mean JavaScript?

Actually, Lua is not interpretive, it just doesn’t have its own external compiler. GMod Lua is compiled by GMod every time the script is loaded, which is why many times large lua-heavy addons can take longer to load than the model-heavy addons. :eng101:

Lua can be interpreted at run-time or pre-compiled. There is a Lua compiler. You can compile one with the default sources from

Wow. What a dickhead.

let me put it simply: C++ != Lua. Lua ~= C++

I think you mean average facepunch user.

Sorry, should have said GMod Lua, not Lua in general. GMod Lua is compiled temporarily when the scripts are loaded.

Maybe not average, but he does represents a large proportion of the facepunch posters.