Program that executes scripts

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
As a side project, to enhance my experience with cross-platform applications I've chosen to create a program in C::B (using wxWidgets) but I've hit a huge snag.

I simply don't know how to let the application compile and execute scripts without the use of an external executable.

I'm trying to create an IDE that allows you to create scripts inside of it providing pre-made functions that you are able to use as well to create functions of your own. When hitting start, the script should execute also providing a debug window, to let you find errors.

Now I simply want all of this in 1 executable, now for the language I have multiple things in mind. Where Python, LUA, Pascal (Delphi) or more languages are able to compile and executed or interpreted.

If you still don't know what I'm talking about, than you should take a look at Scar DIVI. It is a program that let's you macro though scripting using color finding and bitmap searching techniques. Now that program is pretty much only use-able for 1 thing and that's Runescape. Although it can be used for other simple things as well it isn't build for it. I'm trying to stay open minded and make it work for a whole lot more.

Does anyone with some experience in this subject help me further and set me on the correct path?
 

Xienoph

You can change this now in User CP.
Reaction score
43
Usually, you have the main executable that runs the IDE, and several executables that run the scripts in various programming languages. Why don't you want to use external executables? If any of the script interpreters (say the Python interpreter) is updated, you will need to recompile the entire executable. If they're separated, you just need to replace the Python interpreter with the updated one.

If you're doing multiple executables, I suggest that you look into "interprocess communication." I don't have a lot of experience in this, but communication between MATLAB and Java is a pain. I ended up using network sockets to communicate ^^.

What is C::B by the way?
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
Usually, you have the main executable that runs the IDE, and several executables that run the scripts in various programming languages. Why don't you want to use external executables? If any of the script interpreters (say the Python interpreter) is updated, you will need to recompile the entire executable. If they're separated, you just need to replace the Python interpreter with the updated one.

If you're doing multiple executables, I suggest that you look into "interprocess communication." I don't have a lot of experience in this, but communication between MATLAB and Java is a pain. I ended up using network sockets to communicate ^^.

What is C::B by the way?
C::B is an open source cross platform IDE, the full name would be Code::Blocks.

The reason I want it all in 1 executable is because I want it user friendly. I don't want loose executeables around which would only confuse the end-user.
Yes, it may be easier to just run a command line on an interpreter / compiler but that would only make it easier for me. I want to learn and using cheap techniques doesn't help me on that part of the programming.
At least this way, I have control over the versions of compilers people use because if they where loose executeables, they simply could update it and may bring up crashes in the IDE.
I have more reasons for this, but these are just the main two ones.

However, the IPC is good to know about. Thanks for that.
 

SerraAvenger

Cuz I can
Reaction score
234
How would you want to add plug-ins with a single executable?

I think what would be really great would be a simplistic plug-in manager.
 

Xienoph

You can change this now in User CP.
Reaction score
43
Ohhhh. Code::Blocks.

Well, you can ask the Python / Delphi / LUA developers for source code of their interpreter, and compile them together with the rest of the IDE's code. But they might be using different languages and ... it might get messy. Though I wonder if they have a precompiled version of their interpreters, such as .dlls and .libs. Then you can just import them to your IDE code.

If you want to write your own interpreter, that's hard to do well. First, you need to parse it, and there are several parser generators out there. The one I've heard is YACC, but apparently it's really hard to use. Once you get a parse tree, you just need to go through the tree and execute the tree. If you don't care about efficiency, that's it. You have nothing else to do. If you do ... it's really hard to do (in fact, I'm taking a class at optimizing compilers). I suggest just getting the existing source code. It takes a long time to write an efficient interpreter (see: JavaScript).

I don't think I understand what you want to do (I've read and reread and rereread your posts, but I'm still unsure what you want). But I hope those suggestions help you somehow.
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
If you still don't know what I'm talking about, than you should take a look at Scar DIVI.
I want to create an application just like Scar, but more open minded. Scar allows you to create "programmed" macro's, using bitmap and color finding techniques to do exactly what you want.
Unlike those common programs that loop, or execute exactly what you recorded before this allows a more flexible way to macro at either flash games, Runescape or even Warcraft III.

To accomplish this, I need to have an environment to program your script in and an interpreter or compiler to build your code and execute it.

The reason I want to do this is because Scar has major flaws, the procedures, function names are all build for Runescape and the ability to program object orientated proves to be very difficult. I want to improve this in my own program which will be of course ( stated in the first post ) cross platform as well.

Hopefully I did a better job explaining what I wanted to do.

If you want to write your own interpreter
Ohh nohz, It's a small side project. Not gonna write an entire interpreter. It will be slower which will be a very bad thing because I need speed at the users script. I'm not that good in programming either :p

So I guess I'm stuck with open-source languages (if I want to do it my way), which is not a bad thing tho. It just limits my choice of languages severely.

I'll take a look around, test a few things because I'm still busy working on the IDE itself, syntax highlighting, etc, etc, etc. Though it's looking pretty good already, at least that's my opinion.
256xyzr.png


Thanks for the information, Though it wasn't what I asked it was still very informative.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top