Forum

> > Off Topic > Lua vs. C++
Forums overviewOff Topic overviewLog in to reply

English Lua vs. C++

34 replies
Page
To the start Previous 1 2 Next To the start

old Lua vs. C++

Greenhawk
User Off Offline

Quote
I like C++ and Lua a lot but I'm debating with myself to see which is better, or just simply one relies on the other. I know C++ is a very popular language and all but th code seems to be code within code within another code. At the same time it can be used to program/design anythinh

In Lua it's straight forward and real easy to learn. It is also used in video games for Ai scripts, spawns and etc. Also let's not forget, it was used to make the world wide bodacious and awesome Counter-Strike 2D!

Tell me what you guys think.

old Re: Lua vs. C++

Yates
Reviewer Off Offline

Quote
C++ obviously.

Just look, it has two friggin' plus signs! (++)

old Re: Lua vs. C++

Greenhawk
User Off Offline

Quote
user Assassin moder has written
C++ is a programming language.

LUA is like scripted based.


Let's say i wanted to make a game. I know I would use Lua for the game objects and etc. but what would I use C++ for?

old Re: Lua vs. C++

Infinite Rain
Reviewer Off Offline

Quote
С++ Is programming language. Lua is scripting language. The difference between two is freaking obvious.

user Greenhawk has written
Let's say i wanted to make a game. I know I would use Lua for the game objects and etc. but what would I use C++ for?

You would use C++ for everything.

old Re: Lua vs. C++

DC
Admin Off Offline

Quote
user Greenhawk has written
Also let's not forget, it was used to make the world wide bodacious and awesome Counter-Strike 2D!

That's wrong. CS2D wasn't made in Lua. I just "embedded" a Lua script engine in CS2D so you can modify stuff using Lua scripts (older versions of CS2D didn't even have any Lua at all. I added it with later updates).

Games are commonly not completely written in scripting languages like Lua because it would simply be too slow. There are frameworks to script entire games anyway. Löve for example https://love2d.org - but it probably isn't a good idea for large and complex games because of the speed. It works well for little games though.

The main difference between Lua and C++: C++ and most other programming languages are compiled to machine code. This is what the CPU understands and therefore it makes the execution as fast as possible. Scripting languages are either compiled to byte code when needed (just in time compiling) or they are not compiled at all but parsed directly. Both is slower than simply executing precompiled machine code. Especially parsing is always significantly slower. Byte code is marginally slower (Java for example is compiled to byte code for the Java VM).

old Re: Lua vs. C++

Greenhawk
User Off Offline

Quote
@user DC: Ohhhh ok. I was gonna use Love2d for a big project too, but now I gotta find another framework . Anyway thanks for the clarity and thanks to the others too

old Re: Lua vs. C++

DC
Admin Off Offline

Quote
It also depends on the game type of course. Some games simply don't need that much performance or can be optimized very well even when being quite complex and large. Of course you can do a huge point and click adventure with Löve or a jump and run game with tons of levels.

old Re: Lua vs. C++

Assassin moder
User Off Offline

Quote
@user Greenhawk: You can also use C# indeed. I'm using it to programming with it. It's simple, also, I don't saw any C++ code, just C# so..

Second: Blitwizard 2D is open source so you can use both.

old Re: Lua vs. C++

Alpha Beta
User Off Offline

Quote
You can still get BlitzPlus for free. It's similar to BlitzMax (CS2D was written in it), but less features.

edit://

I just realized that you can download the BlitzMax successor, Monkey X, for free!
That's probably the best choice for you.
edited 2×, last 29.05.14 08:18:54 pm

old Re: Lua vs. C++

Infinite Rain
Reviewer Off Offline

Quote
@user Alpha Beta:
CS2D is still written in BlitzMax. And I would not suggest you using BlitzPlus because its graphics features sucks. I'm using it for console-based applications though.

old Re: Lua vs. C++

Alpha Beta
User Off Offline

Quote
Never said it wasn't. But if you can get something for free, then better take it.
But yeah, you can try Monkey.

old Re: Lua vs. C++

Greenhawk
User Off Offline

Quote
Thank you all for the info. I'll start with LOVE 2D and if I don't like it, I can just make my own engine
To the start Previous 1 2 Next To the start
Log in to replyOff Topic overviewForums overview