Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Embedding & Extending Python &other scripting languages

Reply
Thread Tools

Embedding & Extending Python &other scripting languages

 
 
Tommy Nordgren
Guest
Posts: n/a
 
      04-21-2005
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 <(E-Mail Removed)>


Stockholm, April 21, 2005
Tommy Nordgren
 
Reply With Quote
 
 
 
 
Maurice LING
Guest
Posts: n/a
 
      04-21-2005
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 <(E-Mail Removed)>
>
>
> Stockholm, April 21, 2005
> Tommy Nordgren

 
Reply With Quote
 
 
 
 
Mike Meyer
Guest
Posts: n/a
 
      04-21-2005
Tommy Nordgren <(E-Mail Removed)> 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 <(E-Mail Removed)> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
after embedding and extending python (using swig) problem importing (non-core) modules stefan Python 3 12-08-2004 07:11 PM
Embedding/Extending Python at the same time... Hugh Macdonald Python 0 11-19-2004 04:21 PM
Extending/Embedding python Alicia Haumann Python 4 09-08-2004 11:36 PM
embedding and extending issues (with Boost.Python) Faheem Mitha Python 0 06-28-2004 06:44 PM
extending and embedding python with C# Luke Python 3 10-24-2003 04:43 PM



Advertisments