Looking for an embeddable scripting language for C++ with 64-bit support and Cross Platform
Asked Answered
H

5

5

I'm looking for a scripting language that works on 32-bit and 64-bit machines as well as on Windows and Linux. I will be embedding it into a C++ application so I prefer it to be natively written in C++ rather than C. I also would prefer the script to have thread/asynchronous support.

So far the languages that I have looked at are GameMonkey, Lua, and V8 JavaScript Engine. V8 JavaScript has the most appeal so far. I don't really want to use GameMonkey because AFAIK it doesn't support 64-bit addressing. Lua is written in C so I would probably use the C++ wrapper, but I really don't like mixing C and C++ code.

So are there some other alternatives that I could look at?

Havens answered 22/7, 2010 at 7:58 Comment(3)
Lua compiles cleanly off-the-shelf as C++.Ileum
Thanks lhf, that is great news :)Havens
also thanks to starblue for fixing my tags :)Havens
S
4

I say Lua. It's ultraportable (It even runs under PalmOS, WindowsCE and DOS!), small (200-300k), fast and it is very easy to interface it with C/C++.

Also, Michael Pall makes amazing progress with his LUA JIT implementation. His current beta-4 supports x86 and x86_64 jitting and beats the crap out of almost every interpreter language I know: http://luajit.org/

Sabba answered 22/7, 2010 at 9:59 Comment(1)
Wow, this is exciting, I will be using lua JIT :). Thanks.Havens
F
6

I personally prefer Lua over others. Maybe because it's used by WoW and I do my own tweaks for WoW addons. But I've seen many opinions that is good, even on SO.

Freeforall answered 22/7, 2010 at 8:17 Comment(1)
Yes, I have chosen to use Lua. Thanks :)Havens
S
4

I say Lua. It's ultraportable (It even runs under PalmOS, WindowsCE and DOS!), small (200-300k), fast and it is very easy to interface it with C/C++.

Also, Michael Pall makes amazing progress with his LUA JIT implementation. His current beta-4 supports x86 and x86_64 jitting and beats the crap out of almost every interpreter language I know: http://luajit.org/

Sabba answered 22/7, 2010 at 9:59 Comment(1)
Wow, this is exciting, I will be using lua JIT :). Thanks.Havens
F
3

Maybe Falcon, ChaiScript, IO or even AngelScript might match your requirements?

Footplate answered 22/7, 2010 at 8:42 Comment(3)
Thanks, Haven't seen Falcon / ChaiScript / or IO before. Falcon is an interesting language.Havens
Yes, I use it in a big project and it's a better alternative than Python for some reasons. That said, I suppose it will work in 64bit but I didn't try yet.Footplate
Just wanted to verify that 64bit ChaiScript does work. It's only been officially tested on Linux, but 0 issues were found.Consubstantiate
A
2

You could also use Squirrel, it is C++, with a C/Java-like syntax, supporting OO (even class inheritance) and many neat things. It is in par with Lua in terms of speed, but the code size once compiled is slightly bigger.

If you are writing your program in C++ you might prefer it over Lua, and the syntax is much more appealing (to the eye and your productivity if you are writing C++ code often).

Atalayah answered 12/3, 2011 at 5:5 Comment(0)
G
1

If you use qt you could use qtscript. Otherwise python might be a good idea.

Grenier answered 22/7, 2010 at 9:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.