Bit manipulation in scripting languages
After reading around posts on the board, I tried Lua as my first scripting language in my engine. But I found I couldn't do bit manipulation like &(and) or |(or) in Lua. Did I miss anything in the manual?
Now I am testing SMALL. I like it's C-like syntax and it has what I need. But Lua is more popular and faster in my little tests. I haven't given it up yet. Can someone give me some suggestions?
It's not part of Lua's core language definition but someone made a patch for it:
http://lua-users.org/wiki/LuaPowerPatches
It's down the page a bit.
http://lua-users.org/wiki/LuaPowerPatches
It's down the page a bit.
Thanks for the answer. But I found my ignorant errors.
Small is slower than Lua (around 10%) if they both interpret the similar (but do the same thing) code and run it. But if the Small source is compiled by its "just-in-time" compiler, there is no match. Small will faster 15 times than Lua.
I hope someday Lua will have its JIT compiler. But before that, I will use Small as the scripting language of my engine. Well, besides the speed, there is still something to check. If I change my mind again, I will tell you.
Small is slower than Lua (around 10%) if they both interpret the similar (but do the same thing) code and run it. But if the Small source is compiled by its "just-in-time" compiler, there is no match. Small will faster 15 times than Lua.
I hope someday Lua will have its JIT compiler. But before that, I will use Small as the scripting language of my engine. Well, besides the speed, there is still something to check. If I change my mind again, I will tell you.
Quote: Original post by aquastartw
Thanks for the answer. But I found my ignorant errors.
Small is slower than Lua (around 10%) if they both interpret the similar (but do the same thing) code and run it. But if the Small source is compiled by its "just-in-time" compiler, there is no match. Small will faster 15 times than Lua.
I hope someday Lua will have its JIT compiler. But before that, I will use Small as the scripting language of my engine. Well, besides the speed, there is still something to check. If I change my mind again, I will tell you.
Small R0X! if you like C, it will do you much better than LUA. LUA is for those who prefer a lot of abstraction and 'power' as they call it.
July 16, 2004 12:20 AM
If you want a language that is LUA-style and has bit manipulation, take a look at Squirrel(http://squirrel.sourceforge.net)
Actarus
Actarus
Without starting a war, I'd like to say that if a scripting languages interpreted performance is hurting the real-time performance of your game, then you're probably misusing scripting in the first place. Lua is pretty damn quick compared to many other scripting languages, so much so that performance really shouldn't even be a deciding factor--and you can express many constructs in Lua with a simplicity I haven't seen elsewhere. ( But Small looks intriguing as well, JIT's are still awesome ;) )
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement