Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Script Engine in C++

Reply
Thread Tools

Script Engine in C++

 
 
Gernot Frisch
Guest
Posts: n/a
 
      03-24-2005

<(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) oups.com...
> Hey I'm sorry if this is not the appropriate news group for this
> question. I was wondering if anyone has any recommendation for
> embbedding a script engine in a c++ application. I want to feed my
> C++
> application scripts which based on the script would create C++
> objects
> and call the appropriate methods.
>
> At the moment I created a simple interpreter within our C++
> aplication
> that we can feed our custom scripts. The interpreter is primitive
> and
> it lacks alot of functionality that is why I am looking at other
> alternatives.
>
> I looked at spidermonkey to embed in my c++ application but it seems
> a
> little cumbersome dealing with C++ objects. Does anyone have any
> other
> recommendations?


I've seen some guy, who wrote a script engine based on a gcc
installation shipped with the program. So, you just #inlcude
"my_plugin.h" and have all the interfaces ready, then click a "create
plugin" script that gcc's a .dll (or a .so on Linux/unix) - fast and
easy to implement. Very good idea I think. Especially for a game,
where performance is everything.
-Gernot


 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      03-24-2005
Asfand Yar Qazi wrote:

> I, too, now consider Ruby my scripting language of choice.
> Integrating it with C++ needs the usual setjmp/longjmp exception
> support hacks as with any other scripting languages that support
> setjmp/longjmp exceptions. But the extensions API is probably the
> best I've seen.


? I just use the 'protected' versions of functions.

I remain curious what happens to reality when you throw a C++ exception
from a C++ layer, thru the Ruby layer, and into a catch in the calling
C++ layer. Probably fireworks...

--
Phlip

 
Reply With Quote
 
 
 
 
Ioannis Vranos
Guest
Posts: n/a
 
      03-25-2005
Phlip wrote:

> ? I just use the 'protected' versions of functions.
>
> I remain curious what happens to reality when you throw a C++ exception
> from a C++ layer, thru the Ruby layer, and into a catch in the calling
> C++ layer. Probably fireworks...



I think applause.



--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
Owen Jacobson
Guest
Posts: n/a
 
      03-26-2005
On Tue, 22 Mar 2005 00:51:22 +0000, Phlip wrote:

> Compare traversing a heterogeous list in Ruby to, say, Java:
>
> myList.each { |node| node.virtualMethod() }
>
> How many tokens would Java require to claw its way to the same (common)
> result?


This is so far off-topic that I can't even see C++ from here, but:

for (NodeType node : myList) {
node.virtualMethod ();
}

Looks like 15 tokens to me. Two more than the Ruby example. (Admittedly,
this is a new feature, and the idiom it replaces required far more tokens.)

HTH, Owen
 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      03-27-2005
Owen Jacobson wrote:

> This is so far off-topic that I can't even see C++ from here,


So what?

> but:
>
> for (NodeType node : myList) {
> node.virtualMethod ();
> }
>
> Looks like 15 tokens to me. Two more than the Ruby example.

(Admittedly,
> this is a new feature, and the idiom it replaces required far more

tokens.)

Props. And I know not to challenge Java, or its experimental
implementations, to show block closures, co-routines, generics, etc.

The important, topical goal here is understanding the friction between
static typing (like C++) and dynamic typing. The latter provides a
higher development velocity, at greater risk to your execution
velocity. We will see how Java can continue to compete.

--
Phlip

 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      03-27-2005
> I think applause.

Sour grapes, Ioannis?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces


 
Reply With Quote
 
Yuriy Solodkyy
Guest
Posts: n/a
 
      03-27-2005
If you targeting your application only for Windows platform, then you
can easily go with the scripting support provided by Windows. By
implementing a small COM object you'll get:

* Possibility of scripting in any language for which user registered a
scripting engine in the system (JScript and VBScript are there by
default and there is compatible scripting engine for Perl)
* Possibility to create and use inside the script any COM object with
dispatch interface registered in the system.
* Provide access to objects inside your application.
* Let user write event handlers for the events your objects have.

There was a nice article on CodeProject on how to embed Windows
scripting engine support into your application. Works great.

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hey I'm sorry if this is not the appropriate news group for this
> question. I was wondering if anyone has any recommendation for
> embbedding a script engine in a c++ application. I want to feed my C++
> application scripts which based on the script would create C++ objects
> and call the appropriate methods.
>
> At the moment I created a simple interpreter within our C++ aplication
> that we can feed our custom scripts. The interpreter is primitive and
> it lacks alot of functionality that is why I am looking at other
> alternatives.
>
> I looked at spidermonkey to embed in my c++ application but it seems a
> little cumbersome dealing with C++ objects. Does anyone have any other
> recommendations?
>


 
Reply With Quote
 
steumarok steumarok is offline
Junior Member
Join Date: Sep 2011
Posts: 1
 
      09-26-2011
New C++ scripting project has started:

http://code.google.com/p/nasiu-scripting/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
RE: How to execute a script from another script and other script doesnotdo busy wait. VYAS ASHISH M-NTB837 Python 2 01-07-2010 08:18 PM
.Net Search Engine - Has anyone used dtSearch .Net Engine? Sasha ASP .Net 3 05-22-2007 04:20 PM
wiki engine (just engine) available? loguser@almad.net Python 1 04-10-2006 07:58 AM
Is ASP Validator Regex Engine Same As VS2003 Find Regex Engine? =?Utf-8?B?SmViQnVzaGVsbA==?= ASP .Net 2 10-22-2005 02:43 PM



Advertisments