Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: SpiderMonkey?  (Read 8618 times)

0 Members and 1 Guest are viewing this topic.

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
SpiderMonkey?
« on: April 11, 2004, 01:13:44 AM »

At school (instead of doing schoolwork ::)) I've been spending a small amount of time learning about scripting languages and engines, like WME Script. I'm wondering whether WME Script is a completely original concoction built from the ground up by Mnemonic, or whether it is built on an existing engine.

For instance, SpiderMonkey is a JavaScript engine built by the Mozilla team. I haven't learned enough to actually integrate it into a C++ project, but I'm curious if anyone's had any experience using it -- especially whether its somehow related to WME Script.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:SpiderMonkey?
« Reply #1 on: April 11, 2004, 08:25:13 AM »

Unrelated; WME script is not based on any existing scripting engine.
I didn't study SpiderMonkey too deeply, but I'm not sure it could handle all the features necessary for game scripting, such as many separate threads running, the ability to break execution at any time, to save the entire state of all scripts and restore it later etc.
It is always a great dilemma whether to choose an existing scripting component or to create your own from scratch. Both approaches have their pros and cons.

If I had to choose a pre-made scripting engine today, I'd probably go for Lua, it's lightweight, supports threading and could be easily modified to support the game-spcific features.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:SpiderMonkey?
« Reply #2 on: April 12, 2004, 05:03:45 PM »

That's quite a feat, building your own scripting engine from scratch.. especially with the features you've mentioned.

I really like WME Script (aside from the two-deep issue with arrays and nested objects). I don't know of any other C-like or JavaScript-esque languages that support the features you're talking about. Have you considered letting people use the WME Script engine for other projects besides WM?

See, what I'm trying to do at school is build a very simple, but expandable, online game framework.. at this stage implementing nothing more than a scripting engine and a winsock wrapper. The idea is that the scripting engine would have access to the networking component, thus being able to send messages back and forth via the socket.

I'm really interested in choosing the right scripting language up front, so it would be nice to already have the features you're talking about. I don't know enough (nor do I have the time or desire at this point) to implement my own from scratch.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:SpiderMonkey?
« Reply #3 on: April 12, 2004, 06:37:44 PM »

I really like WME Script (aside from the two-deep issue with arrays and nested objects). I don't know of any other C-like or JavaScript-esque languages that support the features you're talking about. Have you considered letting people use the WME Script engine for other projects besides WM?

Well, not that I would have a problem with that, but currently the script virtual machine is too dependent on the engine core classes. The compiler itself, though, is independent. It's in a separate library (dcscomp.dll).


I'm really interested in choosing the right scripting language up front, so it would be nice to already have the features you're talking about. I don't know enough (nor do I have the time or desire at this point) to implement my own from scratch.

Unfortunately I'm not aware of any free C/Java-like scrripting engine, but you should really give Lua a try. Also take a look at Python. Those are the most popular scripting languages out there, and AFAIK both of them have some sort of socket bindings too.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:SpiderMonkey?
« Reply #4 on: April 12, 2004, 07:20:27 PM »

I can't stand the syntax of either Lua or Python. C-like or JavaScript syntax, or something close, would be ideal.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:SpiderMonkey?
« Reply #5 on: April 12, 2004, 07:42:25 PM »

Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:SpiderMonkey?
« Reply #6 on: April 13, 2004, 02:19:32 AM »

Thanks. Right now I'm actually looking at GameMonkey (http://www.somedude.net/gamemonkey), but I'm still waiting to find out if it supports the features I need and want.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:SpiderMonkey?
« Reply #7 on: April 13, 2004, 07:09:54 AM »

Nice, very nice.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

BadSector

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 1
    • View Profile
Re: SpiderMonkey?
« Reply #8 on: May 04, 2004, 04:55:30 PM »

While looking at the internet for references to NerveBreak, i've found this thread :-).

You may want to know that NerveBreak 0.1.4 which is released these days (02.05.2004) now supports objects/classes and host-side function calls (which means that the host program can interrupt the script execution in order to run a function defined in the script - this allows the script to define event handling functions or similar mechanisms). NerveBreak provides many ways to execute a script, from a simple function call that loads the script from an external file, compiles it to bytecode and executes it, to a set of functions that let's you load the code manually (in source code or precompiled form) and execute it instruction-per-instruction (there is an example in the release package that does exactly that in order to execute three scripts simultaneously and demonstrate a mechanism to have shared data between the scrips).

For what it does and it's purposes, NerveBreak is fast enough since it can execute around 450000 commands per second in an Athlon64 3200+ (in a typical game you won't need more than 1000 commands per second).

So you may consider using it for your game. In any case, you can send me an e-mail or -even better- create a thread in the NerveBreak forum at http://nervebreak.sourceforge.net/.

I hope that i helped you :-).
Logged
 

Page created in 0.017 seconds with 21 queries.