Embedding & Extending Python &other scripting languages

Discussion in 'Python' started by Tommy Nordgren, Apr 21, 2005.

  1. I'm interested in doing a rather ambitious project concerning compiler
    construction tools.
    My tools will parse specification files containing for example lalr
    parser specifications.
    The specifications will contain embedded semantic actions which i want to
    allow writing in any object-oriented language.
    The specifications will name a scripting language and a target language
    module . Then my tool will create an embedded interpreter for the
    scripting language, which will load a target language module written in
    the scripting language, and use it to generate code in the target
    language.

    I want to provide my system as open source.

    Now my basic problem is how to find what scripting languages are
    installed on a users system, and generate the necessary makefiles
    automatically. I will be using swig for interface creation.
    I want to support at least perl and python, with target language support
    for at least java and c++ initially.

    I probably want to support codegenerators written in ruby and tcl as
    well.

    Any help would be appreciated.

    I prefer email replies to <>


    Stockholm, April 21, 2005
    Tommy Nordgren
     
    Tommy Nordgren, Apr 21, 2005
    #1
    1. Advertising

  2. Tommy Nordgren

    Maurice LING Guest

    Hi Tommy,

    After reading what you've written, it is still very vague for me. Is it
    a program that reads a specification and outputs the corresponding codes
    in the langauge you want?

    Cheers
    Maurice

    Tommy Nordgren wrote:

    > I'm interested in doing a rather ambitious project concerning compiler
    > construction tools.
    > My tools will parse specification files containing for example lalr
    > parser specifications.
    > The specifications will contain embedded semantic actions which i want to
    > allow writing in any object-oriented language.
    > The specifications will name a scripting language and a target language
    > module . Then my tool will create an embedded interpreter for the
    > scripting language, which will load a target language module written in
    > the scripting language, and use it to generate code in the target
    > language.
    >
    > I want to provide my system as open source.
    >
    > Now my basic problem is how to find what scripting languages are
    > installed on a users system, and generate the necessary makefiles
    > automatically. I will be using swig for interface creation.
    > I want to support at least perl and python, with target language support
    > for at least java and c++ initially.
    >
    > I probably want to support codegenerators written in ruby and tcl as
    > well.
    >
    > Any help would be appreciated.
    >
    > I prefer email replies to <>
    >
    >
    > Stockholm, April 21, 2005
    > Tommy Nordgren
     
    Maurice LING, Apr 21, 2005
    #2
    1. Advertising

  3. Tommy Nordgren

    Mike Meyer Guest

    Tommy Nordgren <> writes:

    > I'm interested in doing a rather ambitious project concerning compiler
    > construction tools.
    > My tools will parse specification files containing for example lalr
    > parser specifications.
    > The specifications will contain embedded semantic actions which i want to
    > allow writing in any object-oriented language.
    > The specifications will name a scripting language and a target language
    > module . Then my tool will create an embedded interpreter for the
    > scripting language, which will load a target language module written in
    > the scripting language, and use it to generate code in the target
    > language.
    >
    > I want to provide my system as open source.
    >
    > Now my basic problem is how to find what scripting languages are
    > installed on a users system, and generate the necessary makefiles
    > automatically. I will be using swig for interface creation.
    > I want to support at least perl and python, with target language support
    > for at least java and c++ initially.


    Ouch. Nasty problem. You can find out what scripting languages are
    installed on a Unixish system by doing "which <name>" in a shell
    script. "<name>" varies depending on the language in question. I.e.:

    guru% which python
    /usr/opt/bin/python
    guru% which ruby
    /usr/opt/bin/ruby
    guru% which perl
    /usr/opt/bin/perl
    guru% which tclsh
    /usr/opt/bin/tclsh

    for python, ruby, perl and tcl.

    For Windows, you can probably grovel similar information out of the
    Registry. I'll leave details up to someone unfortunate enough to have
    to work with Windows.

    FWIW, you probably ought to verify that java and C++ are installed as
    well. End-users systems - specifically Windows, but some Linux/Unix
    distributions don't include either.

    Finally, checking just that just interpreter exists may not be
    sufficient for all Unix-like systems. Some systems, for various
    nonsensical reasons, split packages up into two halves. One half will
    install the interpreter, and the other half will install the include
    files and etc. that you need to build extensions. You may need those
    as well.

    <mike
    --
    Mike Meyer <> http://www.mired.org/home/mwm/
    Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
     
    Mike Meyer, Apr 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke
    Replies:
    3
    Views:
    535
    Robin Becker
    Oct 24, 2003
  2. jdetaeye
    Replies:
    0
    Views:
    514
    jdetaeye
    Mar 18, 2008
  3. Mark Chandler

    Extending other languages with Ruby

    Mark Chandler, Mar 28, 2007, in forum: Ruby
    Replies:
    4
    Views:
    108
  4. Diego
    Replies:
    2
    Views:
    168
    Stefan Rusterholz
    Aug 16, 2008
  5. jim

    Other scripting languages?

    jim, Mar 30, 2008, in forum: Javascript
    Replies:
    19
    Views:
    178
    Logos
    Mar 31, 2008
Loading...

Share This Page