Language workbench written in python3

Discussion in 'Python' started by Nestor Arocha, Sep 5, 2012.

  1. I'm developing a language workbench written in Python. The idea is to create an environment where grammars and translators can interact easily.

    https://github.com/nesaro/pydsl

    any comments, feedback or ideas? :)
     
    Nestor Arocha, Sep 5, 2012
    #1
    1. Advertising

  2. On Thursday, 6 September 2012 02:34:17 UTC+5:30, Nestor Arocha wrote:
    > I'm developing a language workbench written in Python. The idea is to create an environment where grammars and translators can interact easily.
    >
    >
    >
    > https://github.com/nesaro/pydsl
    >
    >
    >
    > any comments, feedback or ideas? :)


    Translator means what precisely?
     
    Ramchandra Apte, Sep 6, 2012
    #2
    1. Advertising

  3. On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote:
    > On 09/06/2012 09:34 AM, Ramchandra Apte wrote:
    >
    > > Translator means what precisely?

    >
    >
    >
    > Examples of translators include compilers, assemblers, and
    >
    > interpreters. They also include implementations like cfront, which
    >
    > translates from one high-level language to another lower-level
    >
    > language. (high and low being relative)
    >
    >
    >
    > --
    >
    >
    >
    > DaveA


    Is conversion from Python to C++ possible from this project?
     
    Ramchandra Apte, Sep 6, 2012
    #3
  4. Nestor Arocha

    Dave Angel Guest

    On 09/06/2012 09:53 AM, Ramchandra Apte wrote:
    > On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote:
    >> On 09/06/2012 09:34 AM, Ramchandra Apte wrote:
    >>
    >>> Translator means what precisely?

    >>
    >>
    >> Examples of translators include compilers, assemblers, and
    >>
    >> interpreters. They also include implementations like cfront, which
    >>
    >> translates from one high-level language to another lower-level
    >>
    >> language. (high and low being relative)
    >>

    > Is conversion from Python to C++ possible from this project?

    I'll let the OP answer that. I don't know anything about it.



    --

    DaveA
     
    Dave Angel, Sep 6, 2012
    #4
  5. On Thursday, September 6, 2012 2:53:15 PM UTC+1, Ramchandra Apte wrote:
    > On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote:
    >
    > > On 09/06/2012 09:34 AM, Ramchandra Apte wrote:

    >
    > >

    >
    > > > Translator means what precisely?

    >
    > >

    >
    > >

    >
    > >

    >
    > > Examples of translators include compilers, assemblers, and

    >
    > >

    >
    > > interpreters. They also include implementations like cfront, which

    >
    > >

    >
    > > translates from one high-level language to another lower-level

    >
    > >

    >
    > > language. (high and low being relative)

    >
    > >

    >
    > >

    >
    > >

    >
    > > --

    >
    > >

    >
    > >

    >
    > >

    >
    > > DaveA

    >
    >
    >
    > Is conversion from Python to C++ possible from this project?


    No, it is not currently possible for several reasons:
    * current parser implementation is a recursive descent parser. I haven't implemented an LR parser yet, although PLY lexers and parsers are supported.
    * Syntax Directed Translator is not fully implemented either.
    * Parser Trees are supported, but there is no clear method defined for converting them into ASTs (like antlr grammars)
    * Even with AST and SDT support, a Python to C++ translator will require more complex tools and a lot of coding.

    This tool is oriented to small DSLs parsing and translation; grammars like Python or C++ are too complex for the current implementation
     
    Nestor Arocha, Sep 6, 2012
    #5
  6. On Friday, 7 September 2012 01:18:45 UTC+5:30, Nestor Arocha wrote:
    > On Thursday, September 6, 2012 2:53:15 PM UTC+1, Ramchandra Apte wrote:
    >
    > > On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote:

    >
    > >

    >
    > > > On 09/06/2012 09:34 AM, Ramchandra Apte wrote:

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > > Translator means what precisely?

    >
    > >

    >
    > > >

    >
    > >

    >
    > > >

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > Examples of translators include compilers, assemblers, and

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > interpreters. They also include implementations like cfront, which

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > translates from one high-level language to another lower-level

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > language. (high and low being relative)

    >
    > >

    >
    > > >

    >
    > >

    >
    > > >

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > --

    >
    > >

    >
    > > >

    >
    > >

    >
    > > >

    >
    > >

    >
    > > >

    >
    > >

    >
    > > > DaveA

    >
    > >

    >
    > >

    >
    > >

    >
    > > Is conversion from Python to C++ possible from this project?

    >
    >
    >
    > No, it is not currently possible for several reasons:
    >
    > * current parser implementation is a recursive descent parser. I haven't implemented an LR parser yet, although PLY lexers and parsers are supported.
    >
    > * Syntax Directed Translator is not fully implemented either.
    >
    > * Parser Trees are supported, but there is no clear method defined for converting them into ASTs (like antlr grammars)
    >
    > * Even with AST and SDT support, a Python to C++ translator will require more complex tools and a lot of coding.
    >
    >
    >
    > This tool is oriented to small DSLs parsing and translation; grammars like Python or C++ are too complex for the current implementation


    I was thinking I could use it for my Python to C/C++ converter - py2c @ code.google.com/p/py2c (py2c would love a developer so join and contribute)
     
    Ramchandra Apte, Sep 8, 2012
    #6
    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. Derek Simmons
    Replies:
    0
    Views:
    805
    Derek Simmons
    Aug 1, 2004
  2. Steve C. Orr, MCSD
    Replies:
    1
    Views:
    563
    reaway lee
    Aug 24, 2003
  3. MyEclipse Support
    Replies:
    0
    Views:
    425
    MyEclipse Support
    Jul 23, 2003
  4. kashumoto_tokugawa
    Replies:
    1
    Views:
    1,707
  5. Andrew Berg
    Replies:
    0
    Views:
    339
    Andrew Berg
    Jun 16, 2012
Loading...

Share This Page