Plex 2E

  • 1.  Solutions to generate Plex code from another language?

    Posted Feb 08, 2018 02:32 AM

    I wondered has anyone tried to implement something like this:

    1) You write code in another language, e.g. C# or Python.

    2) You run a special processor for the source code

    3) You get Plex action diagram that is about equivalent to functionality of the original language

     

    I would like to experiment if something like this if it has not been yet developed. I just don't know how to implement adding variables and fields to the action diagram.



  • 2.  Re: Solutions to generate Plex code from another language?

    Posted Feb 08, 2018 10:11 AM

    I have never considered this.  One of the large strengths of plex is the patterns and inheritance.  Unless you other code was very similar to the patterns you are using I am not certain how valuable this would be.

     

    If you want to add field and variables, you should be able to use the Model API to add triples to your function before you start to load in the action diagram statements.  This may require a two pass parser.  The first to determine the fields (and variables) needed, and the second to add the action diagram.  You would also want to make certain that any function calls were put into the action diagram before any statements that referenced their outputs.



  • 3.  Re: Solutions to generate Plex code from another language?

    Posted Feb 09, 2018 02:02 AM

    Thanks for the answer.

     

    Ok, I could consider the Model API.

     

    It was just a wild idea I have sometimes thought about.