Serializing Python compiled code.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • renjipanicker@gmail.com

    Serializing Python compiled code.

    Hi everyone,

    In a C++ application having a Python interpreter embedded, is it
    possible to compile a small Python snippet into object code and
    serialize the compiled object code to, for example, a database? I am
    exploring the possibility of writing a data driven application, where
    small-sized object code can be read from a database and executed.
    Keeping aside all other considerations such as security, etc for a
    moment, is this feasible?

    Please do reply.

    Thanks,
    -/renji
  • Tim Roberts

    #2
    Re: Serializing Python compiled code.

    renjipanicker@g mail.com wrote:
    >
    >In a C++ application having a Python interpreter embedded, is it
    >possible to compile a small Python snippet into object code and
    >serialize the compiled object code to, for example, a database? I am
    >exploring the possibility of writing a data driven application, where
    >small-sized object code can be read from a database and executed.
    >Keeping aside all other considerations such as security, etc for a
    >moment, is this feasible?
    The biggest problem, in my view, is that the compiled object code won't
    work with any other version of Python, or with versions where the compiler
    was built with other options, or possibly even on other processors with the
    same version. The nice thing about a database server is that you can use
    it from different computers without worrying about versions or processors.

    Compilation is not that expensive. Why not just store the raw code
    snippets?
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.

    Comment

    Working...