Author Topic: scripting  (Read 4168 times)

Balazs

  • Guest
scripting
« on: June 18, 2006, 11:45:46 pm »
I have read in one of the topics about scripting, so I looked after some stuff, and I have a few questions, that someone here might be able to answer.
I bumped into SWIG. This is how I get it: you give it a library, and it will make an interface for scripting languages for that library, so you can use the library say for example from Perl.
But actually, what I was wondering, is that my program is running, and I want scripting code to be run (from within the running app), which can modify the running program through the program's interface. Can I do that with SWIG? I guess I cannot, but can someone give me directions?

--
Greets,
B.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: scripting
« Reply #1 on: June 19, 2006, 12:02:43 am »
Can I do that with SWIG?
I don't want to offend, but are you aware that this is a Code::Blocks forum? Your question is not really related to C::B. If you want to get this answered you'd better ask the SWIG people or in a SWIG forum. BTW: It would have been nice if you had provided the link to what SWIG package you mean... I assume http://www.swig.org?!
With regards, Morten
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Balazs

  • Guest
Re: scripting
« Reply #2 on: June 19, 2006, 02:42:04 am »
I asked here, because one of the devs mentioned scripting is used in CB, and it is something I also want to use in one of my apps, yet I'm curious whether SWIG is appropriate or not. I assume the devs gathered quite a bit of knowledge on this, care to share? :)

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: scripting
« Reply #3 on: June 19, 2006, 03:43:25 pm »
Swig allows you to create bindings to a library for you target language just as you described.  This makes it very easy to create a python/perl/ruby application that uses that library.  The topic you are talking about is embedding.  This has nothing to do with swig.  Look up the topic of embedding.  Here is good article on Perl Embedding

What CB does is have a library that the main application uses, called the SDK.  They then wrap parts of the SDK for use by the scripts.  Each script that is called is passed some handles to objects that can be manipulated/called through use of the wrapped library functions.

Balazs

  • Guest
Re: scripting
« Reply #4 on: June 19, 2006, 06:36:08 pm »
I see. Embedding is what I want then. The description of swig is a bit confusing at first, as it centers around scripting, and what I thought about "scripting" is actually embedding.
Thanks for your answer!

--
Greets,
Balázs