• Why Lua?
    19 replies, posted
[url]http://www.altdevblogaday.com/2013/02/19/why-lua/[/url]
I can't find anywhere which engine / game this is for?
[QUOTE=ash47;39642023]I can't find anywhere which engine / game this is for?[/QUOTE] [url]http://www.bitsquid.se/[/url] Googling the guy who wrote the article's name.
Not sure what's the point of such news but I have to say every game engine nowadays should use Lua. Best language ever. :v:
[QUOTE=_Kilburn;39642092]Not sure what's the point of such news but I have to say every game engine nowadays should use Lua. Best language ever. :v:[/QUOTE] Its not news its a blog.
Lua sux
I have to vastly disagree with his points about the debugger and "lack of intellisense" part. That's not part of the language, but part of the programming experience on a specific platform and/or IDE. I'm not sure at all why he thinks it's okay to put those together. Other than that, it's a good article. Lua poses a lot of uses and has done so for the last many years. I know that garry wrote on his blofg that he'd rather have used Javascript for GMOD, if he could have done so from the start. I'm personally VERY glad he chose Lua, because of not only its flexibility, but also its size in memory and usage. It's so tiny that the amount of stuff you can cramp into memory is amazing.
[QUOTE=garry;39642274]Lua sux[/QUOTE] dont talk shit about lua
[QUOTE=garry;39642274]Lua sux[/QUOTE] You're just mad because you suck at it.
I'm all for dynamically typed languages, however I don't particularly like Lua. Since most code that embeds Lua will be some C-like language, why are you embedding a language with an entirely different syntax, it makes it harder to move the code across the boundary. I'd much rather use Squirrel or Javascript than Lua, although they don't have quite the same community, or ease for binding.
i just wish NS2's developers had the sense to optimize the other aspects of their motherfucking game properly so we could look on it as a good example of a game made almost entirely in Lua. unfortunately unknown worlds decided to drop the ball on that, so now we have a game that requires literally 4.5ghz to play at 60fps on high.
pawn masterrace
[QUOTE=Darkimmortal;39643553]pawn masterrace[/QUOTE] isn't pawn like ridiculously rare nowadays? literally the only thing i've ever heard to use it is AMXX and its plugins for goldsource.
[QUOTE=Roger Waters;39643566]isn't pawn like ridiculously rare nowadays? literally the only thing i've ever heard to use it is AMXX and its plugins for goldsource.[/QUOTE] SA:MP Sourcemod (the best implementation)
[QUOTE=garry;39642274]Lua sux[/QUOTE] says the one who uses C++
[QUOTE=343N;39644172]says the one who uses C++[/QUOTE] Surprising as it might be, C++ is actually a pretty good language. There's a reason most game developers for high performance games tend to write engines in C++, and its not because they hate themselves
[QUOTE=343N;39644172]says the one who uses C++[/QUOTE] Oh here we go
[QUOTE=Darkimmortal;39643572] Sourcemod (the best implementation)[/QUOTE] that would insinuate that AMXX wasn't the best ever usage of pawn
Well it's completely wrong about C#. An implementation of Mono on CryEngine 3 called CryMono allows you to edit C# code in real time and see the results instantly, without restarting the game.
[QUOTE=SteveUK;39648182]Well it's completely wrong about C#. A implementation of Mono on CryEngine 3 called CryMono allows you to edit C# code in real time and see the results instantly, without restarting the game.[/QUOTE] Which is really technically possible with a lot of software. TinyCC, a not yet so mature C compiler, allows it's backend to be used. That backend supports C hotloading+hotcompilation, or the same as reloading the state in maybe a few seconds. [editline]20th February 2013[/editline] proof: [cpp] /* * Simple Test program for libtcc * * libtcc can be useful to use tcc as a "backend" for a code generator. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "libtcc.h" /* this function is called by the generated code */ int add(int a, int b) { return a + b; } char my_program[] = "int fib(int n)\n" "{\n" " if (n <= 2)\n" " return 1;\n" " else\n" " return fib(n-1) + fib(n-2);\n" "}\n" "\n" "int foo(int n)\n" "{\n" " printf(\"Hello World!\\n\");\n" " printf(\"fib(%d) = %d\\n\", n, fib(n));\n" " printf(\"add(%d, %d) = %d\\n\", n, 2 * n, add(n, 2 * n));\n" " return 0;\n" "}\n"; int main(int argc, char **argv) { TCCState *s; int (*func)(int); s = tcc_new(); if (!s) { fprintf(stderr, "Could not create tcc state\n"); exit(1); } /* if tcclib.h and libtcc1.a are not installed, where can we find them */ if (argc == 2 && !memcmp(argv[1], "lib_path=",9)) tcc_set_lib_path(s, argv[1]+9); /* MUST BE CALLED before any compilation */ tcc_set_output_type(s, TCC_OUTPUT_MEMORY); if (tcc_compile_string(s, my_program) == -1) return 1; /* as a test, we add a symbol that the compiled program can use. You may also open a dll with tcc_add_dll() and use symbols from that */ tcc_add_symbol(s, "add", add); /* relocate the code */ if (tcc_relocate(s, TCC_RELOCATE_AUTO) < 0) return 1; /* get entry symbol */ func = tcc_get_symbol(s, "foo"); if (!func) return 1; /* run the code */ func(32); /* delete the state */ tcc_delete(s); return 0; } [/cpp]
Sorry, you need to Log In to post a reply to this thread.