Difference: FRCVLabMLSA_future (1 vs. 3)

Revision 32019-05-29 - LabTech

Line: 1 to 1
 
META TOPICPARENT name="FRCVLabMLSA"
<meta name="robots" content="noindex" />
Line: 51 to 51
  There is a pattern for the steps to be performed, and it also gives more information about the function and the module. So it will make it easier to resolve scoping issues.
Added:
>
>

Future work for Pybind11

  1. Handling of C++ defined function import rather than whole C++ module import in Python file.( E.g., from example import Pet)
  2. Handling situation where the function is defined in the pybind11 binding statement. (E.g., m.def("add",[](int a){ return a+a;}) )
  3. Handling cases of function overloading i.e., more than one function defined with the same name but different parameters.
 

Permissions

  • Persons/group who can view/change the page:

Revision 22017-07-12 - AnneMarieBogar

Line: 1 to 1
 
META TOPICPARENT name="FRCVLabMLSA"
Changed:
<
<
<meta name="robots" content="noindex" />
>
>
<meta name="robots" content="noindex" />
 
Changed:
<
<

Future Work

>
>

MLSA_logo.png Future Work

 
Changed:
<
<
- Handling other ways of calling Python

    >
    >
    - Extension of the RDA analysis for more complex interoperability aPIs, including use of DATALOG for analysis
     
    Changed:
    <
    <
  • PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *fp, const char *filename, int, PyCompilerFlags *);
    • Also PyRun_AnyFile or PyRun_AnyFileEx or PyRun_AnyFileFlags
    • if FP is associated with an interactive device, return PyRun_InteractiveLoop(); else return the result of PyRun_SimpleFile().
    • IF filename is NULL, the function uses "???" as the filename

  • PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char * command, PyCompilerFlags *);
    • also PyRun_SimpleString
    • "command" is the python command(s) to be executed. The function will create a main function to add and run what is defined in "command"
      • the string can be filtered to find default Python functions
      • using a default name for this kind of python call to represent it in the graph (numbered default name to differ calls)

  • PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *);
    • also PyRun_InteractiveOne
    • fp is an interactive device (console, terminal) and filename is the name of the file
      • executes only ONE statement from "filename"

  • PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *);
    • Also PyRun_InteractiveLoop
    • fp is an interactive device (console, terminal) and filename is the name of the file
      • executes statements from "filename"

  • PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *str, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *);
    • Also PyRun_String
    • runs "str" in the context specified by "globals" and "locals"
      • create a default function name for this kind of call, then use it as nodes in the graph

  • PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int, PyObject *, PyObject *, int, PyCompilerFlags *);
    • Also PyRun_File or PyRun_FileExFlags or PyRun_FileExFlags
    • Python source code is read from fp, and filename is the name of the file.
    >
    >
    - More extensive testing and comparisons of the CGs generated with those for existing CG tools
     
    Changed:
    <
    <
    All these methods use a string as identifier to modules or commands. It should not be difficult to identify functions and analyze them. They are also similar to "PyRun_SimpleFile", which is already implemented .
    >
    >
    - Handling other ways of calling Python
     
    Changed:
    <
    <
  • Pure Embedding (most safe and complete way of calling python)
    • see for the original code: https://docs.python.org/3/extending/embedding.html
    • Process:
      • pModule = PyImport_Import(PyObject *pName);
        • pName comes from converting C string to Python Object using Python.h interface. It is the name of the module(file) to open.

      • pFunc = PyObject_GetAttrString(PyObject *pModule, const char *func);
        • func is the name of the function inside the module.

      • pValue = PyObject_CallObject(PyObject *pFunc, PyObject *pArgs);
        • pArgs is the list of arguments. pValue is the return value of the function. It must be converted to a C type
    >
    >
    • PyAPI _FUNC(int) PyRun _AnyFileExFlags(FILE *fp, const char *filename, int, PyCompilerFlags *);
      • Also PyRun _AnyFile or PyRun _AnyFileEx or PyRun _AnyFileFlags
      • if FP is associated with an interactive device, return PyRun _InteractiveLoop(); else return the result of PyRun _SimpleFile().
      • IF filename is NULL, the function uses "???" as the filename
    • PyAPI _FUNC(int) PyRun _SimpleStringFlags(const char * command, PyCompilerFlags *);
      • also PyRun _SimpleString
      • "command" is the python command(s) to be executed. The function will create a main function to add and run what is defined in "command"
        • the string can be filtered to find default Python functions
        • using a default name for this kind of python call to represent it in the graph (numbered default name to differ calls)
    • PyAPI _FUNC(int) PyRun _InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *);
      • also PyRun _InteractiveOne
      • fp is an interactive device (console, terminal) and filename is the name of the file
        • executes only ONE statement from "filename"
    • PyAPI _FUNC(int) PyRun _InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *);
      • Also PyRun _InteractiveLoop
      • fp is an interactive device (console, terminal) and filename is the name of the file
        • executes statements from "filename"
    • PyAPI _FUNC(PyObject *) PyRun _StringFlags(const char *str, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *);
      • Also PyRun _String
      • runs "str" in the context specified by "globals" and "locals"
        • create a default function name for this kind of call, then use it as nodes in the graph
    • PyAPI _FUNC(PyObject *) PyRun _FileExFlags(FILE *, const char *, int, PyObject *, PyObject *, int, PyCompilerFlags *);
      • Also PyRun _File or PyRun _FileExFlags or PyRun _FileExFlags
      • Python source code is read from fp, and filename is the name of the file.
     
    Changed:
    <
    <
    >
    >
    All these methods use a string as identifier to modules or commands. It should not be difficult to identify functions and analyze them. They are also similar to "PyRun_SimpleFile", which is already implemented .
     
    Added:
    >
    >
    • Pure Embedding (most safe and complete way of calling python)
    • pFunc = PyObject _GetAttrString(PyObject *pModule, const char *func);
      • func is the name of the function inside the module.
    • pValue = PyObject _CallObject(PyObject *pFunc, PyObject *pArgs);
      • pArgs is the list of arguments. pValue is the return value of the function. It must be converted to a C type
      The problem with this approach is that there are multiple conversions and attributions before getting the reference to the function. A Reaching Definition Analysis is necessary to find the intermediate values.
    Line: 86 to 49
      The problem with this approach is that there are multiple conversions and attributions before getting the reference to the function. A Reaching Definition Analysis is necessary to find the intermediate values.
    Deleted:
    <
    <
     There is a pattern for the steps to be performed, and it also gives more information about the function and the module. So it will make it easier to resolve scoping issues.
    Deleted:
    <
    <
     

    Permissions

    • Persons/group who can view/change the page:
    Line: 99 to 58
     

    -- (c) Fordham University Robotics and Computer Vision

    Added:
    >
    >
    META FILEATTACHMENT attachment="MLSA_logo.png" attr="" comment="" date="1499887779" name="MLSA_logo.png" path="MLSA_logo.png" size="39428" user="AnneMarieBogar" version="1"

    Revision 12016-07-28 - BrunoVieiro

    Line: 1 to 1
    Added:
    >
    >
    META TOPICPARENT name="FRCVLabMLSA"
    <meta name="robots" content="noindex" />

    Future Work

    - Handling other ways of calling Python

    • PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *fp, const char *filename, int, PyCompilerFlags *);
      • Also PyRun_AnyFile or PyRun_AnyFileEx or PyRun_AnyFileFlags
      • if FP is associated with an interactive device, return PyRun_InteractiveLoop(); else return the result of PyRun_SimpleFile().
      • IF filename is NULL, the function uses "???" as the filename

    • PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char * command, PyCompilerFlags *);
      • also PyRun_SimpleString
      • "command" is the python command(s) to be executed. The function will create a main function to add and run what is defined in "command"
        • the string can be filtered to find default Python functions
        • using a default name for this kind of python call to represent it in the graph (numbered default name to differ calls)

    • PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *);
      • also PyRun_InteractiveOne
      • fp is an interactive device (console, terminal) and filename is the name of the file
        • executes only ONE statement from "filename"

    • PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *);
      • Also PyRun_InteractiveLoop
      • fp is an interactive device (console, terminal) and filename is the name of the file
        • executes statements from "filename"

    • PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *str, int start, PyObject *globals, PyObject *locals, PyCompilerFlags *);
      • Also PyRun_String
      • runs "str" in the context specified by "globals" and "locals"
        • create a default function name for this kind of call, then use it as nodes in the graph

    • PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int, PyObject *, PyObject *, int, PyCompilerFlags *);
      • Also PyRun_File or PyRun_FileExFlags or PyRun_FileExFlags
      • Python source code is read from fp, and filename is the name of the file.

      All these methods use a string as identifier to modules or commands. It should not be difficult to identify functions and analyze them. They are also similar to "PyRun_SimpleFile", which is already implemented .

    • Pure Embedding (most safe and complete way of calling python)
      • see for the original code: https://docs.python.org/3/extending/embedding.html
      • Process:
        • pModule = PyImport_Import(PyObject *pName);
          • pName comes from converting C string to Python Object using Python.h interface. It is the name of the module(file) to open.

        • pFunc = PyObject_GetAttrString(PyObject *pModule, const char *func);
          • func is the name of the function inside the module.

        • pValue = PyObject_CallObject(PyObject *pFunc, PyObject *pArgs);
          • pArgs is the list of arguments. pValue is the return value of the function. It must be converted to a C type

      The problem with this approach is that there are multiple conversions and attributions before getting the reference to the function. A Reaching Definition Analysis is necessary to find the intermediate values.

      There is a pattern for the steps to be performed, and it also gives more information about the function and the module. So it will make it easier to resolve scoping issues.

    Permissions

    • Persons/group who can view/change the page:

    -- (c) Fordham University Robotics and Computer Vision

     
    This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
    Ideas, requests, problems regarding TWiki? Send feedback