Loading ...
Sorry, an error occurred while loading the content.

Access to bytecode of languages like Perl and Python?

Expand Messages
  • Omer Zak
    In machine language programming and in LISP, in principle, instructions and data are interchangeable. In practice, considering machine language instructions as
    Message 1 of 1 , Jul 31, 2001
    • 0 Attachment
      In machine language programming and in LISP, in principle, instructions
      and data are interchangeable.

      In practice, considering machine language instructions as data or vice
      versa is not always feasible or desirable, due to the need for protection
      mechanisms, sandboxing, or complexity of machine language instructions
      (which requires specific expertise, possessed by compiler writers, to
      handle them).

      In LISP, it is relatively simple to consider data as code and vice versa.
      Sandboxing remains a desirable option.

      In other languages (Java, Perl, Python), there is a step of compilation
      into bytecode, which then is complicated and inaccessible to the program.
      It is possible to construct program code and execute it on the fly by
      means of a specific compile function. However, after compilation, it is
      not easy to manipulate the bytecode.

      In Tcl it is easier to consider (string) data as instructions. Modern
      versions of Tcl do compile text strings into bytecodes, but this is only
      due to efficiency considrations - it is not part of language
      specification.

      In FORTH, mapping between source code and bytecode is almost trivial.

      In LISP, Tcl and FORTH, it is easy to create new control structures. In
      other languages, it is more difficult.

      I think it would be cool if it were possible to specify and add to Perl
      and Python functions, which manipulate compiled bytecodes. Such functions
      will have to consider the bytecodes as trees.
      --- Omer
      There is no IGLU Cabal. However, when it existed, it was COOL!
      WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
    Your message has been successfully submitted and would be delivered to recipients shortly.