Sign in to follow this  

Embedding Scripting Languages

This topic is 4197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, as there is no giant list of resources for embeddable scripting languages in this forum like there is in the graphics library and graphic art forums, I thought I'd start one. Here is a list of the languages I've tried, and whether I succeesed in embedding them or not (note, primarily based around embedding and extending (slightly), so no comment on the actual languge) LUA Embedded using Code::Blocks, but not VC++, didn't seem too hard to embed. My Thoughts: Can't comment much, most of the tutorials for it are for older vesions, and those functions have new names and different ways of doing things, so no real progress. No helpful resources I've come across, some people like the LUA tutorials here. Python Embedded using VC++ once, then failed on a repeat attempt, didn't try Code::Blocks My Thoughts: A bugger to embed, I did it once, then tried with Boost::Python, which failed, then tried without again, but couldn't get that to work again. Resources: Boost::Python GameDev article about Embedding Python Squirrel Embedded with Code::Blocks, which took a while, and with C++, which was a breeze (almost). My thoughts: Combined with SqPlus, this is quite good, and quite simple to embed, but it's not use to me if I can't use it because I don't know how. Much bettor tutorials are needed on how to embed and extend this one. Resources: SqPlus Ruby Embedded with VC++, very easy to do, THE easiest, didn't try with Code::Blocks. My thoughts: Easiest to embed yet. Using this source code, it has been very simple and sthright forward. I haven't seen any examples of how you call functions either to or from ruby, but I've heard promising things! Resources: Nice simple intro to ruby GameMonkey Script Embedded with Code::Blocks, didn't try with VC++. My thoughts: Best documentation on how to embed and call functions I've ever seen, but the extending is scary and the code for calling functions from it is not nice. Resources: Language Guide Embedding GameMonkey That's all folks, maybe I'll update it when I'm awake... and yes, I will fix thse links ASAHP (H = "humanly", i.e. sleep) Feel free to post anything you like. [Edited by - Silvo on June 13, 2006 2:27:23 AM]

Share this post


Link to post
Share on other sites
you can also try this one:

PAWN Scripting language (previously known as SMALL)

http://www.compuphase.com/pawn/pawn.htm

It has a C like grammar, I've been using it in some of my projects and I can say it is easy to embed, pretty stable, and it generates very fast code. It has some C features missing, though (structs).

VicViper

Share this post


Link to post
Share on other sites
Here is my list quickly converted from some wiki-syntax on my personal wiki. If you know of one not listed here please let me know. :)

AngelScript
Has classes/objects: Maybe
Strongly typed variables: Yes
Embeddable: Yes
C-like syntax: Yes

Blaise
Has classes/objects: Yes
Strongly typed variables: Yes
Embeddable: Yes
C-like syntax: No

C-SMILE
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Yes

EEL
Has classes/objects: Maybe
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Yes

Embryo
Has classes/objects: No idea
Strongly typed variables: No idea
Embeddable: Yes
C-like syntax: Yes

Ferite
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Yes
No native win32 port available (yet?).

GameMonkey
Has classes/objects: Maybe
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Maybe

JewelScript
Has classes/objects: Yes
Strongly typed variables: Yes
Embeddable: Yes
C-like syntax: Yes

Lua
Has classes/objects: No
Strongly typed variables: No
Embeddable: Yes
C-like syntax: No

Pawn
Has classes/objects: No
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Maybe
Previously known as Small.

Pike
Has classes/objects: Yes
Strongly typed variables: Yes
Embeddable: No
C-like syntax: Yes

Python
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Maybe
C-like syntax: No

Ruby
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Maybe
C-like syntax: No

ShilScript
Has classes/objects: Maybe
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Yes

SpiderMonkey
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Yes

Squirrel
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Yes
C-like syntax: Yes

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by rck
Ruby
Has classes/objects: Yes
Strongly typed variables: No
Embeddable: Maybe
C-like syntax: No


This isn't right. Ruby definitely has strongly typed variables. I think you mean that Ruby is dynamically instead of statically typed. Ruby also has a lot of language bindings, so it is generally embeddable, though it is usually meant to be used standalone.

Share this post


Link to post
Share on other sites
Nice thread guys.

What I'd like to see is some small roundup/comparison of each of these languages - expanding on what rck started and talk about things such as Garbage collection model, performance, standard library, perhaps even showing simple example cases in each of the languages.

Perhaps if we all chip in would could build such a resource?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
This isn't right. Ruby definitely has strongly typed variables. I think you mean that Ruby is dynamically instead of statically typed. Ruby also has a lot of language bindings, so it is generally embeddable, though it is usually meant to be used standalone.
Sorry, my definition probably isn't the same as yours, what I meant is that variables are not innately variant.

Quote:
Original post by evolutional
Nice thread guys.

What I'd like to see is some small roundup/comparison of each of these languages - expanding on what rck started and talk about things such as Garbage collection model, performance, standard library, perhaps even showing simple example cases in each of the languages.

Perhaps if we all chip in would could build such a resource?
Sure.

Share this post


Link to post
Share on other sites
The following is a short list of languages that can be embedded in Java applications. I can't say that I've tried many of them, mostly just BeanShell, hence the descriptions are not too helpful.


BeanShell

Their description: BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and javascript.

My description: scripts Java with Java, easy to set up and easy to interact with your program internals and the Java library - too easy, even


Pnuts

Their description: Pnuts is a script language for Java environment. It enables interaction with Java environment, simple Web scripting, customization for Java programs, and so on.

My descrption: confusing, own syntax, lack of good documentation and examples


JScheme

Their description: The goal of this project is to develop the JScheme implementation of Scheme in Java and to explore the use of JScheme in web programming. JScheme is a dialect of Scheme with a very simple interface to Java, called the Javadot notation.

My description: A scheme interpreter for Java, haven't looked much into it


Jython

Their description: ython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

My description: python implementation in pure Java. official release does not support generators but these have been added to the current codebase - no idea how lightweight they are though.


Groovy

Their description: Groovy is an agile dynamic language for the Java Platform with many features that inspired languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax.

My description: much hyped, still very young. apparently being pushed for standard?

Share this post


Link to post
Share on other sites
re: Squirrel with SqPlus- recent versions of SqPlus include example project/make files for VC7.1, VC8, Code::Blocks, and GNUMake. Where did you have a challenge with embedding?

Sorry about the lack of docs for SqPlus: other than the Wiki, the example testSqPlus2.cpp has just about every example usage of SqPlus you might need. By tracing through the examples in testSqPlus2.cpp with the debugger, you'll learn how everything works, and be better able to extend/change SqPlus (though its almost a year old now and fairly feature complete for game use). Additional SqPlus documentation and examples are welcome from the user community (feel free to add to the Wiki when you figure something out that may help other users).

If you have questions about using SqPlus, if you don't get answers on GameDev.net, try the Squirrel Forum: Squirrel Forum.

Some Ogre users are using SqPlus, see the Ogre Squirrel Page.

The Squirrel language is reasonably well documented: Squirrel Language Documentation. If you have any questions regarding the language, post them on the Squirrel forum. Squirrel's author (Alberto) is pretty good at answering language questions.

Share this post


Link to post
Share on other sites
Top stuff here folks!!

I'll fix the original post as soon as I figure out the url thing... I'll add the giant list provided by rck, but we definatly need a summary of the language, its capabilities and what we think, and for the "popular" ones, get links to tutorials/other resources (just because, if they arn't popular, no one will write stuff for them, hey?).

Maybe some sort of "template" is needed?

Something like this:?

Name: Python
Official Site: Python.org
Official Description: "blah blah blah"
Notes: Very nice, bugger to embed, etc.
Wrappers:

Attributes:
  • Object Oriented: maybe

  • Embeddable: yes

  • ...

Resources:




[Edited by - Silvo on June 13, 2006 2:23:58 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by evolutional
What I'd like to see is some small roundup/comparison of each of these languages - expanding on what rck started and talk about things such as Garbage collection model, performance, standard library, perhaps even showing simple example cases in each of the languages.

Perhaps if we all chip in would could build such a resource?


This is an interesting discussion, and I agree we should attempt to make it become a separate and easily maintainable resource. Some sort of wiki would probably be a good idea?
There was also such a suggestion in the other thread ("benchmarks"), I think these two topics would make for a good foundation for one comprehensive comparison between various scripting languages. On the one hand, there would be a comparison concerning "embeddability" and features-as well as applicable licensing, and on the other hand we could have performance comparisons for each language.

If such a resource used a dynamic backend, it should be pretty straightforward to augment it for future scripting languages etc.

Would GameDev.net be willing to provide hosting for such a resource section dedicated to the comparison of the various mainstream languages? Or should we set up a separate webpage somewhere else?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Another important thing to keep in mind when composing such lists, is to make sure that we list the version of the scripting interpreter we are referring to. That way, we could even provide comparisons between different versions of the same interpreter.
Such a resource would certainly be tremendously helpful when it comes to decisionmaking which language to use in a certain setting.

In that context, it would probably also be relevant to mention data pertinent to the overhead of embedding a certain language (i.e. static/dynamic library size etc).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Silvo
Top stuff here folks!!

I'll fix the original post as soon as I figure out the url thing... I'll add the giant list provided by rck, but we definatly need a summary of the language, its capabilities and what we think, and for the "popular" ones, get links to tutorials/other resources (just because, if they arn't popular, no one will write stuff for them, hey?).

Maybe some sort of "template" is needed?

Something like this:?

Name: Python
Official Site: Python.org
Official Description: "blah blah blah"
Notes: Very nice, bugger to embed, etc.
Wrappers:
SWIG: not nice
Boost::Python: not nice
Attributes:
Object Oriented: maybe
Embeddable: yes
...
Resources:
Python world: nice set of tutorials about how to...


This sounds good, we should probably extend the template to be generally useful, i.e.:

interpreter version, supported host programming languages, syntax (style), link to wikipedia entry, integration tools/wrappers,links to docs, links to tutorials and examples etc.

While such stuff could definitely be maintained conveniently via some sort of wiki, it would be even cooler if there was a dynamic frontend, to allow users to search the database for entries that match their requirements, i.e.:
embeddable in C/C++, ECMA-like syntax, library size below 650kbyte, license: ZLIB, BSD, features: OO, ...

Share this post


Link to post
Share on other sites
< Quote all three anon posters here >

All good ideas, now all we need is someone to do it. As I've never made a wiki type thing before... any volunteers??

Share this post


Link to post
Share on other sites
Here is the "New and improved list", not finished, obviously.

List:
AngelScript
BOO
FICL
GameMonkey
IO
LUA
PAWN
Python
Ruby
SMALL
SpiderMonkey
Squirrel



************************************************************


- AngelScript -

Official Site: http://www.angelcode.com/angelscript/

What is it?
"The AngelCode Scripting Library, or AngelScript as it is also known, is an extremely flexible cross-platform scripting library designed to allow applications to extend their functionality through external scripts. It has been designed from the beginning to be an easy to use component, both for the application programmer and the script writer."
< INSERT ADDITIONAL DEFINITION HERE >

Facts:

  • Object Oriented: Perhaps

  • Strongly typed variables: Yes

  • Embeddability: no comment

  • C-style syntax: Yes

  • Supported Platforms: no comment



Additional Libraries:

  • < INSERT LIBRARIES HERE >



Resources:

  • < INSERT RESOURCES HERE >



TOP

************************************************************


- BOO -

Official Site: boo.codehaus.org

What is it?
"Boo is a new object oriented statically typed programming language for the Common Language Infrastructure with a python inspired syntax and a special focus on language and compiler extensibility."
< INSERT ADDITIONAL DEFINITION HERE >

Facts:

  • Object Oriented: Yes

  • Strongly typed variables: Yes

  • Embeddability: no comment

  • C-style syntax: No

  • Supported Platforms: no comment



Additional Libraries:

  • < INSERT LIBRARIES HERE >



Resources:


TOP

************************************************************


- FICL (Forth Inspired Programming Language) -

Official Site: ficl.sourceforge.net

What is it?
"Ficl is a programming language interpreter designed to be embedded into other systems as a command, macro, and development prototyping language."
< INSERT ADDITIONAL DEFINITION HERE >

Facts:

  • Object Oriented: Yes

  • Strongly typed variables: no comment

  • Embeddability: no comment

  • C-style syntax: no comment

  • Supported Platforms: no comment



Additional Libraries:

  • < INSERT LIBRARIES HERE >



Resources:

  • < INSERT RESOURCES HERE >



TOP

************************************************************

- GameMonkey -

Official Site: http://www.somedude.net/gamemonkey/

What is it?
"GameMonkey is a embedded scripting language that is intended for use in game and tool applications. GameMonkey is however suitable for use in any project requiring simple scripting support. GameMonkey borrows concepts from Lua (www.lua.org), but uses syntax similar to C, making it more accessible to game programmers. GameMonkey also natively supports multithreading and the concept of states."
< INSERT ADDITIONAL DEFINITION HERE >

Facts:

  • Object Oriented: Perhaps

  • Strongly typed variables: No

  • Embeddability: no comment

  • C-style syntax: Perhaps

  • Supported Platforms: no comment



Additional Libraries:

  • < INSERT LIBRARIES HERE >



Resources:


TOP

************************************************************


- IO -

Official Site: http://www.iolanguage.com/about/

What is it?
"Io is a small, prototype-based programming language. The ideas in Io are mostly inspired by Smalltalk (all values are objects), Self (prototype-based), NewtonScript (differential inheritance), Act1 (actors and futures for concurrency), LISP (code is a runtime inspectable/modifiable tree) and Lua (small, embeddable)."
< INSERT ADDITIONAL DEFINITION HERE >

Facts:

  • Object Oriented: no comment

  • Strongly typed variables: no comment

  • Embeddability: no comment

  • C-style syntax: also no comment

  • Supported Platforms: no comment



Additional Libraries:

  • < INSERT LIBRARIES HERE >



Resources:

  • < INSERT RESOURCES HERE >



TOP************************************************************


- LUA -

Official Site: http://www.lua.org

What is it?
"Lua is a powerful light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose, stand-alone language." To read more about lua go here: http://www.lua.org/about.html.
< INSERT ADDITIONAL DEFINITION HERE >

Facts:

  • Object Oriented: No
  • ;
  • Strongly typed variables: No

  • Embeddability: Easy

  • C-style syntax: No

  • Supported Platforms: Most



Additional Libraries:

  • http://lua-users.org/wiki/LibrariesAndBindings Numerous Extensions and Libraries can be found here.

  • IDEs and other environments as well as wrappers can be found here: http://lua-users.org/wiki/LuaAddons

  • KeplerProject - Numerous modules for Lua 5.0 including LuaSQL, CGILua, LuaXMLRPC, and others.

  • mod_lua - An extension for Apache (http://oss.digirati.com.br/mod_lua/1.0/). Does not appear to be compatible with Apache2.



Resources:

  • Programming in Lua (first edition) by Roberto Ierusalimschy (http://www.lua.org/pil/)

  • The latest pre-compiled binaries at LuaBinaries: http://luabinaries.luaforge.net/

  • Lua-Users Wiki includes tutorials and much more: http://lua-users.org/wiki/



TOP

[Edited by - Silvo on June 20, 2006 2:06:13 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
for such a template, there may be more fields we could find useful, eg:

- overview
- features
- available bindings (i.e. OpenGL, networking etc.)
- lines of source code (of the interpreter)
- supported platforms
- used in projects (IDEs, games etc.)
- source examples (hello world?)

also, I actually like the idea of trying to make something like this searchable by its fields-however, I am not aware of a wiki system that would offer such flexibility, maybe someone else knows such a system?

Concerning licensing, I am however not sure if it makes sense to only mention the corresponding licenses, maybe it would be better to provide higher level license descriptions, i.e. "may be used commercially without restrictions", "source code may be modified, binaries redistributed, without requiring distribution of affected source code"...?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
for such a template, there may be more fields we could find useful, eg:

- overview
- features
- available bindings (i.e. OpenGL, networking etc.)
- lines of source code (of the interpreter)
- supported platforms
- used in projects (IDEs, games etc.)
- source examples (hello world?)


All of this information takes up room, and if we decide to go with the wiki idea, then each could have its own page with information on the language their. I think it would be best for a small summary of a complete list of languages, and overview is essential, features could be discussed in brief, bindings i think would fit in the "libraries" section, i dont understand "lines of source code", and if it means what i think it means, it isnt very important. Supported platforms is so obvious that I completly forgot about it. "Used in projects" is not something we should have to work out, most have some info on that on their site. source examples i think would be covered in the tutorials which we would link to.

Quote:
Original post by evolutional
I'll investigate setting up a wiki on my webspace tonight. I'll also write up some additional text for GameMonkey Script (current version).

Here's a couple of extra Gamemonkey links:

Introduction to GameMonkey Script Part 1
Introduction to GameMonkey Script Part 2


Thanks for that! I'll add the links.


Also, if anyone wants to add information or is willing to write up info for a language, be my guest!

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
There may be no giant list before now, but most of those languages are mentioned in the Forum FAQ. Check it out, folks.


I did, but it's just mentioned in passing, compared to this, it isn't really satisfactory.

Share this post


Link to post
Share on other sites
Quote:
Original post by Silvo
Quote:
Original post by Kylotan
There may be no giant list before now, but most of those languages are mentioned in the Forum FAQ. Check it out, folks.


I did, but it's just mentioned in passing, compared to this, it isn't really satisfactory.


Maybe not, but then I don't necessarily agree with some of the judgements that are already in this thread. Languages are necessarily a bit more about personal taste than libraries are and I personally didn't want to put my biases into such a list.

Share this post


Link to post
Share on other sites
Boo
Boo is a new object oriented statically typed programming language for the Common Language Infrastructure (.NET) with a python inspired syntax and a special focus on language and compiler extensibility.
My Thoughts: Very easy to embed, referencing your own assemblies is a breeze, very similar to Python.
Resources:
Boo Homepage
Boo Google Group

Share this post


Link to post
Share on other sites

This topic is 4197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this