• What are you working on? v19
    6,590 replies, posted
[QUOTE=danharibo;31285195]Lua's lack of brackets make it hard to read for me, I have the same problem with Python, I prefer languages that let you use your own indentation which can be very handy for making code easier to read[/QUOTE] In Lua, do and end are the "brackets" (Or then, else, end). You can indent however you want.
[QUOTE=danharibo;31285195]Lua's lack of brackets make it hard to read for me, I have the same problem with Python, I prefer languages that let you use your own indentation which can be very handy for making code easier to read[/QUOTE] I don't mind VB's indentation. I just despise the language syntax is all. That lack of scope brackets in Lua and python add to a minimalistic feeling which I really enjoy though.
[QUOTE=danharibo;31285037]A question for all of you: Is there any reason you would choose Lua over V8 ECMAScript for game logic / scripting features? My opinion is that Lua has horrible syntax compared to JS so I'd much prefer using V8 to Lua and whatnot.[/QUOTE] Lua is small, in a couple senses. It has a small standard library, and it's interpeter is small. Lua is easy to learn and easy to read, it uses words, and not symbols for most things, it reads almost like psuedocode, and the syntax is consistent and flexible. Lua's syntax makes for great config files, it's syntax is almost JSON like in tables. Lua interfaces very well with C. Lua is flexible, it allows many different paradigms, while the most used type of OO in Lua is prototyped based, you can easily mimic classes. Lua is easy to modify and written in C.
[QUOTE=NorthernGate;31285254]I don't mind VB's indentation. I just despise the language syntax is all. That lack of scope brackets in Lua and python add to a minimalistic feeling which I really enjoy though.[/QUOTE] Not VB. V8. ECMAScript.
[QUOTE=ThePuska;31285278]Not VB. V8. ECMAScript.[/QUOTE] Oh, silly me. Disregard my comments
[QUOTE=Jawalt;31285255]Lua is small, in a couple senses. It has a small standard library, and it's interpeter is small. Lua is easy to learn and easy to read, it uses words, and not symbols for most things, it reads almost like psuedocode, and the syntax is consistent and flexible. Lua's syntax makes for great config files, it's syntax is almost JSON like in tables. Lua interfaces very well with C. Lua is flexible, it allows many different paradigms, while the most used type of OO in Lua is prototyped based, you can easily mimic classes. Lua is easy to modify and written in C.[/QUOTE] Ah, you bring up some good points. V8 is much like Lua in many of the ways you've mentioned (although, it's larger than Lua afaik, and isn't as easy to modify). I do think that V8 has the upper hand in terms of binding to C++, due to the fact that V8 wasn't written in C. I find that it's much more OO and easier to use than Lua in that regard.
[QUOTE=danharibo;31285456]I do think that V8 has the upper hand in terms of binding to C++, due to the fact that V8 wasn't written in C. I find that it's much more OO and easier to use than Lua in that regard.[/QUOTE] The Lua API is object-oriented - just not using the conventions of C++. The lua_ prefix can be considered a "namespace", and the distinction between Lua types (lua_pushstring, lua_pushnumber, etc) is similar to classes. If Lua were to be rewritten or wrapped to use C++ conventions (e.g; overloading LuaState.Push), it would compile to exactly the same code. The majority of abstraction would be optimised out by the compiler. There are many libraries available that provide a layer of abstraction over Lua to make it more friendly to use with C++, such as [URL="http://www.rasterbar.com/products/luabind.html"]LuaBind[/URL], [URL="http://www.tecgraf.puc-rio.br/~celes/tolua/"]toLua[/URL]/[URL="http://www.codenix.com/~tolua/"]toLua++[/URL] and [url=http://www.swig.org/]SWIG[/url]. It would also be quite easy to make your own header-only abstraction that the compiler can optimise out [I][U]entirely[/U][/I] (à la [URL="http://www.boost.org/doc/libs/?view=filtered_header-only"]boost[/URL]). I have a set of tools that I use for all my programming endeavours and Lua plays a major role in it. After significant research into various options for a scripting language, I chose Lua (namely LuaJIT). I find it incredibly easy to use with C++ (although I have added some custom extensions to the language, such as a built in __type metamethod, binary operators, etc). I'd be happy to give you some advice on rolling your own header-only library - perhaps share some source code. [B]Edit:[/B] You are correct, however; V8 does have an advantage over Lua on the fronts of binding and interoperability. I'm suggestion you treat Lua as if it is easily bound to C++, and don't consider the down-fall significantly. [B]Edit 2: [/B][TABLE="class: grid"] [TR] [TD]Holy[/TD] [TD][/TD] [/TR] [TR] [TD][/TD] [TD]Shit[/TD] [/TR] [TR] [TD]cakes[/TD] [TD][/TD] [/TR] [/TABLE] The editor has tables :O
-late snip-
[QUOTE=Deco Da Man;31285802]The Lua API is object-oriented - just not using the conventions of C++. The lua_ prefix can be considered a "namespace", and the distinction between Lua types (lua_pushstring, lua_pushnumber, etc) is similar to classes. If Lua were to be rewritten or wrapped to use C++ conventions (e.g; overloading LuaState.Push), it would compile to exactly the same code. The majority of abstraction would be optimised out by the compiler. There are many libraries available that provide a layer of abstraction over Lua to make it more friendly to use with C++, such as [url=http://www.rasterbar.com/products/luabind.html]LuaBind[/url] and [url=http://www.tecgraf.puc-rio.br/~celes/tolua/]toLua[/url]/[url=http://www.codenix.com/~tolua/]toLua++[/url]. It would also be quite easy to make your own header-only abstraction that the compiler can optimise out [i][u]entirely[/u][/i] (à la [url=http://www.boost.org/doc/libs/?view=filtered_header-only]boost[/url]). I have a set of tools that I use for all my programming endeavours and Lua plays a major role in it. After significant research into various options for a scripting language, I chose Lua (namely LuaJIT). I find it incredibly easy to use with C++ (although I have added some custom extensions to the language, such as a built in __type metamethod, binary operators, etc). I'd be happy to give you some advice on rolling your own header-only library - perhaps share some source code.[/QUOTE]I understand where you are coming from but V8's binding is nice out of the box, you don't need anything like V8++ in order to use C++'s OO. This isn't just a case of Lua's API looking OO, V8's binding works differently to Lua's for the programmer, which makes it a much better choice imho. There is also the fact that I personally find the ECMAScript syntax better than Lua's since it's closer to C++/C.
[QUOTE=danharibo;31285456]Ah, you bring up some good points. V8 is much like Lua in many of the ways you've mentioned (although, it's larger than Lua afaik, and isn't as easy to modify). I do think that V8 has the upper hand in terms of binding to C++, due to the fact that V8 wasn't written in C. I find that it's much more OO and easier to use than Lua in that regard.[/QUOTE] There's a bunch of libraries to make it easier for you to use C++ and Lua, too.
More spamming by me! [img]http://i.imgur.com/7m4Vp.gif[/img] Got the angle dependent sprite stuff done, now I'm waiting for Garb to finish the sprites. IT'S GONNA LOOK GREAT WITH MARIO POINTING IN THE GENERAL DIRECTION OF THE MOUSE! i hope.
Added a Super Laser weapon to my game: [img]http://i.imgur.com/8M6X6.gif[/img] An options menu: [img]http://i.imgur.com/JWoqj.png[/img] And Dogs Tags (which give extra xp) and an upgrade to increase their drop chance: [img]http://i.imgur.com/Zai1W.png[/img] (don't think I've shown my shop menu yet, so there it is ^) My to-do list for this game is getting smaller and smaller :D. Soon i'll start beta testing to make sure it's all balanced and fun.
I'm working on a game community. Hopefully will be popular eventually. Just very time consumeing [url]www.facepalmgaming.com[/url] [highlight](User was banned for this post ("Not programming/advertising" - Starpluck))[/highlight]
[QUOTE=Deco Da Man;31285802]The editor has tables :O[/QUOTE] But it seems to have lost support for [noparse][list][/noparse]. Not a good tradeoff IMO.
I'm starting to learn C++. So far so good, but I don't what's ahead of me. Anyone have any good reference manuals or websites I could use?
When somebody you know (Not a friend) tries to convince you that there is a new kind of virus programmed in C++ that learns and then sends it self and even the government can't stop it... Holy shit guys were all doomed ¬_¬ In other news. I got the first puzzle for my Comp Entry Sorted.
[QUOTE=HeroicPillow;31283952]Comments.[/QUOTE] I prefer [url=http://www.codinghorror.com/blog/2008/07/coding-without-comments.html]coding without comments[/url]. If you try to code as if you were not allowed to make comments, your code can become really self-descriptive which is great. "[i]Only at the point where the code cannot be made easier to understand should you begin to add comments.[/i]"
[QUOTE=ruarai;31288123]This is for programming. btw How did you get gold member?[/QUOTE] you can buy gold now
[QUOTE=Richy19;31288163]you can buy gold now[/QUOTE] Not anymore, apparently.
[QUOTE=BlkDucky;31288189]Not anymore, apparently.[/QUOTE] [url]http://store.boostar.org/[/url] [editline]23rd July 2011[/editline] Also does anyone recommend just skiping the first few chapters of the superbible untill it starts teaching you pure openGL not the GLTools?
Glad I just bought my namechange then.
[QUOTE=theJohn;31288145]I prefer [url=http://www.codinghorror.com/blog/2008/07/coding-without-comments.html]coding without comments[/url]. If you try to code as if you were not allowed to make comments, your code can become really self-descriptive which is great. "[i]Only at the point where the code cannot be made easier to understand should you begin to add comments.[/i]"[/QUOTE] I comment after every line that isn't a basic assignment.
[QUOTE=NotoriousSpy;31288475]I comment after every line that isn't a basic assignment.[/QUOTE] That's overkill. Most of the time I don't bother commenting my code; this is usually because variable and function names usually make my intentions quite obvious. I do comment sections which are harder to understand or have extra things to be aware of, though.
[QUOTE=mechanarchy;31288546]That's overkill. Most of the time I don't bother commenting my code; this is usually because variable and function names usually make my intentions quite obvious. I do comment sections which are harder to understand or have extra things to be aware of, though.[/QUOTE] Yeah, I know but it adds a nice sense of space.
Oh, guys - nearly 3000 posts. That's the end of this thread, isn't it? I think we got caught off-guard last time, so best be aware now. [editline]23rd July 2011[/editline] [QUOTE=NotoriousSpy;31288561]Yeah, I know but it adds a nice sense of space.[/QUOTE] I use whitespace for that.
Commence arguments about thread titles
[QUOTE=Chris220;31288587]Commence arguments about thread titles[/QUOTE] What are you working on? V20
[QUOTE=mechanarchy;31288563]Oh, guys - nearly 3000 posts. That's the end of this thread, isn't it? I think we got caught off-guard last time, so best be aware now.[/QUOTE] I think the treads no longer auto-lock.
[QUOTE=Ziks;31288724]I think the treads no longer auto-lock.[/QUOTE] So v19 will be the last thread ever?
We should still make a new one. Highlights are good and it will keep it manageable if the limit comes back and we NEED to make a new one. And seeing what garry does to the forums, it's likely that the limit will come back.
Sorry, you need to Log In to post a reply to this thread.