🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Embedding A Free Interpreter

Started by
10 comments, last by Ironica 21 years ago
Hey, I need an interpreter embedded into my project (game server). I been trying to write one myself, but I don''t really like it. I keep getting good ideas for it, then giving up, then getting a better idea and starting over etc >.< I seen some of you guys talking about Lua here. It looks pretty cool. I just want an interpreter that I can write functions for, which can access my C++ classes. I really don''t care what the script language itself is like. Think I should use Lua? Are there any other good ones around? How about Python? Would I be able to use that?
Advertisement
I suggest that you do a bit more reading about each interpreter that you are interested in - that will allow you to ask specific questions with respect to your project.

I''ve personally worked with Python and Lua as well as some more obscure scripting languages and I find Lua the easiest to get embeded and I enjoy the syntax...

Good Luck,

Dave "Dak Lozar" Loeser
Dave Dak Lozar Loeser
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous
Hehe thanks. Python looks good, but I have no idea how I would embed it yet. Need to read up I guess.

Maybe someone has some good links?
http://lua-users.org

How appropriate. You fight like a cow.
lua
lua wiki

my vote goes to lua obviously.. its a very robust scripting language, and imo it''s perfect for games (light weight, low overhead, easy to embed, etc)


-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
just to illustrate how easy it is to get lua embedded in existing applications- i had a simple scripting language of my own i was messing with.. eventually i needed something more powerful, so i completely reworked my app to use Lua. in less than 3 hours i had turned my game''s console into a command line Lua interpreter.. it''s really cool
-eldee;another space monkey;[ Forced Evolution Studios ]
Thanks.

So you guys like Lua? Hmm... it is quite a nice and simple scripting language. I think I''ll go with that then =)

I''ve compiled it, but I can''t get it to link. Oh well, I haven''t really read anything on it yet. I''ll have a look at it.
quote: Original post by Ironica
I''ve compiled it, but I can''t get it to link. Oh well, I haven''t really read anything on it yet. I''ll have a look at it.

You probably need to wrap the header includes with extern "C" { } that''s the thing that most people don''t realise they need when they first use Lua (it''s certainly the thing I forgot).

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
Thanks for that, but the problem was I didn''t link it with the static library. Just compiled the static libary, and linked it with =)

Hehe, now I gotta figure how to use it... I go read up.
I you use .NET, you can use the built-in compilers to compile actual code into an in-memory .dll that can do pretty much anything. And it's free.

Talk about scripting!

[edited by - Nypyren on June 23, 2003 5:28:11 AM]

This topic is closed to new replies.

Advertisement