Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Lua

Name: Anonymous 2009-12-01 15:45

So what do you think of Lua?
I'm considering it for my X3 inspired(cloned) game as a scripting language for all the entities, and co-routines emulate the "@" operator of X3 scripting language perfectly.
I just hope I can integrate it to my code without much trouble.

Name: Anonymous 2009-12-01 16:06

Not scheme.

Name: Anonymous 2009-12-01 16:09

Probably the best choice for a C-embedded language, but it is pretty slow. I find its exclusive use of double somewhat troubling, and the need to declare just about everything local is a little irritating, but it is otherwise excellent.

Name: Anonymous 2009-12-01 16:22

It's pretty decent for a scripting language.  I do find the basic-esce syntax a bit odd but I can forgive it.

Name: Anonymous 2009-12-01 16:31

Name: Anonymous 2009-12-01 16:47

Or game monkey or what ever it's called

Name: Anonymous 2009-12-01 16:48

>>5
Excellent use of sage.

Name: Anonymous 2009-12-01 17:11

>>3
Slow? Hilarious.

http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=lua&lang2=v8&box=1
Better than JavaScript v8 in some problem domains. Lua trashes TraceMonkey much worse on these same tests.

http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=lua&lang2=python&box=1
Generally beats FIOC.

http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=lua&lang2=jruby&box=1
http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=lua&lang2=ruby&box=1
JRuby, Ruby. Completely wasted.

You can compile Lua as well to increase performance and obfuscate your code. If you want to FUD, that's fine, but the language speaks for itself in terms of performance.

>>5
Hello, Alberto.

>>1
Lua is a good embeddable scripting language. It's perfect for C and it can be used with C++. It's extremely lightweight and it is fast. You can expose as much or as little as you would like to Lua if you use another library such as LuaBind, I think it is.

That is to say, you can expose an API or you can expose direct object access to Lua. Exposing an API can get a little confusing if you use tables. Getting data from a table and putting data into a table generally ends up confusing. Functors can help ease this complexity once you figure it out. Exposing direct object access is really confusing and fraught with peril if you don't use a library.

The syntax takes some getting used to, but there's a comprehensive manual available for when you hit snags. I wouldn't use anything other than Lua for C or C++ projects, personally.

Name: Anonymous 2009-12-01 17:20

>>8
Faster than CPython, slower than PLT Scheme. Javascript, not even being on the table for such an application as the OP's, is a ridiculous comparison, and I have never heard of Ruby touted as an embedded language, so what the fuck?

I like lua a lot. Only languages worth learning right now are lisp, C, and lua, in my opinion. But that doesn't mean I can ignore facts.

Name: Anonymous 2009-12-01 17:24

>>9
Results 1 - 20 of about 61,600 for "embedded Ruby". (0.28 seconds)
ruby embedded into c++
My best advice is to look at the ruby source itself, plus seek inspiration in projects which successfully has embedded ruby. ...
metaeditor.sourceforge.net/embed/

Name: Anonymous 2009-12-01 18:13

>>9
Check out LuaJIT (average from shootout, lower is better):

CPython: 46.34
PLT Scheme: 12.34
LuaJIT: 2.37

http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&d=data&calc=calculate&gpp=on&java=on&luajit=on&v8=on&lua=on&tracemonkey=on&box=1

Name: Anonymous 2009-12-01 19:45

>>11
inb4 something retarded like "LOL IT'S SLOWER THAN JAVA" (ignoring that it's a scripting language)

Name: Anonymous 2009-12-01 20:17

a while ago i modified the lua parser to accept both the superior

x3 = function(x)
{
print(x)
}
x3("FUNCTION")

and inferior

x3_old = function(x)
print(x)
end
x3_old("FUNCTION_OLD")

http://www.mediafire.com/?3jmqygizzzd
example in src/test.lua, diff1 for diff
make posix

now you can kindly stop whining about non-knuth approved syntax

Name: Anonymous 2009-12-01 20:46

>>11
Speaking of which, why the fuck doesn't Python have a JIT compiler yet? Wasn't Unladen Swallow supposed to accomplish this? Why is it taking so long?

Name: Anonymous 2009-12-01 21:12

>>14
Project was canceled, it would have made the language too fast.

Name: Anonymous 2009-12-01 21:13

>>13
Lua still sucks

Name: Anonymous 2009-12-01 21:27

It's good enough for Dungeon Crawl Stone Soup, its good enough for you.

Name: Anonymous 2009-12-01 22:53

>>1
Lua arouses its share of trolls because it's got some nonstandard constructs, but in the end it's a very nice and flexible language that probably has less syntactical cruft than any other language but Scheme and Lisp. It's easy to learn and every time I've used it it's been a joy to work with. Plus LPeg.re blows PCRE out of the water any day of the week. If you're embedding a scripting language, I can't think of anything else that's quite as good.

>>14
unladen-swallow works just fine today, last I checked. The problem is that it's not actually significantly faster than CPython for most problems.
http://morepypy.blogspot.com/2009/11/some-benchmarking.html
As you can see, cpython actually beats u-s on quite a few of the benchmarks. Pypy, on the other hand, seems to offer a major speedup, but it's not *quite* fully compatible. It's definitely the project to watch in the world of Python VM's.

Name: Anonymous 2009-12-01 23:22

If your engine is open sauce (GPLv3), I would recommend newLISP that includes all the speed and power of Lua but without the faggotry.

Name: Anonymous 2009-12-01 23:39

>>19
You mean ECL, right?

Name: Anonymous 2009-12-01 23:57

Pronounced 'la'.

Name: Anonymous 2009-12-01 23:57

How do the various Scheme implementations stack up for embedding purposes? What ones are worthwhile and what's shit?

Name: Anonymous 2009-12-02 2:41

About as fast a scripting language as you can cram in for real-time 3D.  I was using it for Quake 2 scripting extensions with stuff that ran on a per-frame basis (I forgot how many frames per second servers run at...) and it did fine.  Closures make for great event handling mechanisms.

The only problem I ever had with Lua is that there's no stable threading implementation... you sort of have to hope you don't screw up.  A runner-up for me is Ruby, but it's going to be significantly slower (but a lot nicer to code in).

Name: Anonymous 2009-12-02 3:47

>>22
mzScheme is probably the best you can do.
>>23
http://luaforge.net/projects/luapi/ ?

Name: Anonymous 2009-12-02 9:18

>>10
wow, that quote really drives home the point. I mean my point.

Name: Anonymous 2009-12-02 10:39

>>24
That's not exactly comparative.

Name: Anonymous 2009-12-04 3:09

Name: Anonymous 2010-12-17 1:40

This post brought to you by the Gay Nigger Association of America

Name: Anonymous 2011-02-03 6:00

Name: Anonymous 2011-02-03 6:03

Name: Anonymous 2013-06-18 18:28

Name: Anonymous 2013-06-18 18:35

Name: Anonymous 2013-06-18 18:42

Name: Anonymous 2013-06-18 18:48

Name: Anonymous 2013-06-18 18:55

Name: Anonymous 2013-06-18 19:02

Name: Anonymous 2013-06-18 19:09


Don't change these.
Name: Email:
Entire Thread Thread List