473,946 Members | 2,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script Engine in C++

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 ?

Jul 23 '05
16 4767

<fe***********@ gmail.com> schrieb im Newsbeitrag
news:11******** **************@ o13g2000cwo.goo glegroups.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
Jul 23 '05 #11
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

Jul 23 '05 #12
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
Jul 23 '05 #13
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.virtualMet hod() }

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.virtualMet hod ();
}

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
Jul 23 '05 #14
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.virtualMet hod ();
}

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

Jul 23 '05 #15
> I think applause. :-)

Sour grapes, Ioannis?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 23 '05 #16
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.

fe***********@g mail.com 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 ?


Jul 23 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2327
by: jianchiwei | last post by:
question: I run c:\python23\Lib\site-packages\win32comext\axscript\client\pyscript.py and it told me Registered: Python Registration of Python ActiveX Scripting Engine complete. But, when I run a asp script <%@LANGUAGE=Python%>
5
3087
by: Vince C. | last post by:
Hi. I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS, no preference). I've tried (in VBS) writing a Sub rs_RecordChangeComplete( adReason, cRecords, pError, adStatus, pRecordset ) - rs being a server-side ADODB.Recordset object - but it doesn't get called whenever rs is moved (I browse it in a loop). Is there a way to catch those events from ASP?
3
8444
by: Ed Brandmark | last post by:
I have a tag of the form <SCRIPT LANGUAGE="JavaScript1.1" SRC="foo.js"..... and was wondering if this delays the loading of my page until that file foo.js downloads. It seems that if I place this in the HEAD of my document - the page will wait until it downloads. If I place it in the BODY of my document - supposedly the page
38
7189
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } function makeArray0() {
1
2508
by: Carl Waldbieser | last post by:
Has anyone had any experience embedding a CPython engine in a .NET application? In the COM/ActiveX world, it was pretty easy to use Mark Hammond's win32 modules to create a script engine component that you could expose other COM objects to, but I was not sure how I would go about doing something similar in a .NET environment. For example, something like: .... .NET Application code ... 'Create Foo object. set Foo = New Foo("baz")...
9
1729
by: sam.s.kong | last post by:
Hello! I have a JavaScript code like the following. <script> var s = "</script>"; ....
1
3023
by: Hardy Wang | last post by:
Hi all, Anybody knows where can I find some information about script engine theory? I have the requirement: Our product has some template files, and there placeholder/variabled embedded inside template (like %CurrentTime%, %HoursRemaining% and so on). There are also some other variables (like %Coupon%) whose value is based on values of other variables. For example
1
2722
by: Andrus | last post by:
I'm creating WinForms ERP application. This application need to run custom scripts in may places like: retrieving list of invoices before adding invoice before saving invoice after saving invoice before posting invoice after posing etc.
3
11311
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
0
10151
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9981
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11557
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10685
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9885
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7416
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4938
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3538
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.