Results 1 to 9 of 9

Thread: Possible To Host Script Logic in Different Programming Language

  1. #1
    Join Date
    Mar 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Possible To Host Script Logic in Different Programming Language

    I'm new here and just wondering: is it possible to host the majority of a script's logic in a different programming language or environment and have it communicate with the Simba process to make requests for data and issue commands? This sounds like a really convenient feature and I'm wondering if there is a built-in way to access Simba programmatically through something like a foreign function interface or inter-process communication. I tried looking around but I'm not 100% sure what terms to search for. Thanks in advance.

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    afaik, the only thing similar to this is dlls using c++. but they are almost never used simply because they dont need to be used for most things.

  3. #3
    Join Date
    Mar 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have two proposed use-cases:
    - programmer can use language they are most familiar with
    - programmer can use domain-specific libraries for algorithmic tasks

    It sounds like a really cool idea on paper, and I'm curious if there is an existing implementation or what practical approaches could be used to make one.

  4. #4
    Join Date
    Mar 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is it possible for a plugin to call back into the current Simba script?

  5. #5
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    As both core and Warrior have stated, you can basically make a library if you'd rather use a different programming language, if you know how. While you'll still need to code to some extent in Simba, it'll take your methods from the library you've created. It has a couple of benefits:
    1) Generally it is much more efficient
    2) You're not limited by the procs/funcs of Simba.

    However, you cannot write a .dll in java, or at least not without some magic from C++. From my limited knowledge, I think you'll need some C++ to actually initiate the JVM, to run the java code.

    You might want to check these out:
    http://villavu.com/forum/showthread.php?t=58815 - How to create plugins, but it's in Lazarus, you'll have to adapt.
    http://villavu.com/forum/showthread.php?t=13118 - An example of a C++ plugin, if you wanted to work form there.
    Last edited by Richard; 03-17-2013 at 12:31 PM.

  6. #6
    Join Date
    Mar 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you all. These responses have been very insightful. I'm definitely curious to explore this idea, even though I'm not sure of its overall practicality yet.

    In the case of an extension, how would I make the extension call back into Simba? That is, I'm looking to invoke the extension from within Simba, then have the extension invoke some function that was defined inside the Pascal interpreter in Simba (e.g. some SRL library function). The conceptual call stack would look like the following:

    (top - most recent call)
    SomeSRLLibraryFunction
    SomeExternalLanguageLibraryFunction
    FunctionProvidedByExtension
    MainLoopOfSimbaScript

    The expected use-cases for this are:
    - use Simba color-related and SRL RS-related routines from within the extension
    - use Simba mouse-related routines from within the extension

    Where can I learn more about how extensions pass data around? Are arrays/strings/structs encoded according to Pascal convention, Delphi convention, or something else? (I'm not sure these are even the correct names, to be honest, since I have only used C among languages in this category.) I previously thought the two were the same, but Google suggests I need to specifically distinguish between the two which one I have.
    Last edited by ZappyDude; 03-17-2013 at 05:28 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •