Adding Modularity to Triangle Compiler

Discussion in 'Java' started by glory.faded@gmail.com, Nov 28, 2005.

  1. Guest

    Hi,
    I need to add classes to the triangle programming language, i.e. need
    an object orieneted version of Triangle compiler. Its pretty
    complicated for me, I am actually trying to work on type systems for
    object oriented languages, and chose Triangle for it, as I was familiar
    with it. But, unfortunately it didn't have notion of classes in it. Can
    anybody give me a good reference or a jumpstart.

    -----------------------------
    Everyone Dies!
     
    , Nov 28, 2005
    #1
    1. Advertising

  2. Chris Uppal Guest

    wrote:

    > I need to add classes to the triangle programming language, i.e. need
    > an object orieneted version of Triangle compiler. Its pretty
    > complicated for me, I am actually trying to work on type systems for
    > object oriented languages, and chose Triangle for it, as I was familiar
    > with it. But, unfortunately it didn't have notion of classes in it. Can
    > anybody give me a good reference or a jumpstart.


    What are you looking for:

    1) How to design an OO language ?

    2) How to design an OO extension to an existing language ?

    3) Implementation techniques for OO languages ?

    4) How to design a type system for an OO language ?

    5) An OO language that might be better suited for your purposes than Triangle ?

    6) Etc ??

    The impression I'm getting is that you are not interested in Triangle per se,
    and that adding OO to it is just a chore that you have to get out of the way
    before you can settle down to the real work. If so then starting with Triangle
    seems odd -- if you wanted to learn about jet engine design, you wouldn't start
    by bolting wings on your car ;-)

    Some suggested answers:

    1) Learn an existing language. Smalltalk (best), Ruby (ok), Python (it may
    suit your personal taste better than Ruby), CLOS/Lisp (powerful and much you
    can learn from), Java (poor), C++ (bad).

    2) Look at how OO has been grafted onto existing languages. C converted to C++
    (Read Stoustrup's book). Pascal converted to Delphi. Python (early, non-OO)
    converted to Python (current, with OO). Lua, non-OO but specifically designed
    to allow OO to be layered over it. CLOS added to Lisp (read the "Art of the
    Metaobject Protocol" book).

    3) See (4).

    4) This is a biggie. How you design your type system will determine the
    expressiveness of the language, which in turn will constrain the
    implementation. See (1) for some examples. There is also a moderately large
    and (to me) totally incomprehensible literature on theories of type systems for
    OO. The name Cardelli drops up often, and is to be treated with wary respect
    (as you might an unexploded tiger).

    5) See (1).

    -- chris
     
    Chris Uppal, Nov 28, 2005
    #2
    1. Advertising

  3. Roedy Green Guest

    On 27 Nov 2005 23:58:54 -0800, wrote, quoted or
    indirectly quoted someone who said :

    >I need to add classes to the triangle programming language, i.e. need
    >an object orieneted version of Triangle compiler. Its pretty
    >complicated for me, I am actually trying to work on type systems for
    >object oriented languages, and chose Triangle for it, as I was familiar
    >with it. But, unfortunately it didn't have notion of classes in it. Can
    >anybody give me a good reference or a jumpstart.


    See Stroustrup's book the annotated C++ reference which talks about
    how he used vtbls to implement classes.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Nov 28, 2005
    #3
  4. Guest

    Thanks, Chris.
    I was actually looking for number 2, and you are right about the
    impression you got. Since, I already started with the project, now I
    will have to stick to Triangle. I am trying to design a statically type
    safe OO language based on Triangle. I will have to implement it anyway.
    And I will be using translation semantics based on lambda calculus.
    Thanks for the info on the books. And ye its large for me too, actually
    too large, the theory of type systems. I will probably do studying on
    other languages to get a good feeling.

    Cheers!

    Chris Uppal wrote:
    > wrote:
    >
    > > I need to add classes to the triangle programming language, i.e. need
    > > an object orieneted version of Triangle compiler. Its pretty
    > > complicated for me, I am actually trying to work on type systems for
    > > object oriented languages, and chose Triangle for it, as I was familiar
    > > with it. But, unfortunately it didn't have notion of classes in it. Can
    > > anybody give me a good reference or a jumpstart.

    >
    > What are you looking for:
    >
    > 1) How to design an OO language ?
    >
    > 2) How to design an OO extension to an existing language ?
    >
    > 3) Implementation techniques for OO languages ?
    >
    > 4) How to design a type system for an OO language ?
    >
    > 5) An OO language that might be better suited for your purposes than Triangle ?
    >
    > 6) Etc ??
    >
    > The impression I'm getting is that you are not interested in Triangle per se,
    > and that adding OO to it is just a chore that you have to get out of the way
    > before you can settle down to the real work. If so then starting with Triangle
    > seems odd -- if you wanted to learn about jet engine design, you wouldn't start
    > by bolting wings on your car ;-)
    >
    > Some suggested answers:
    >
    > 1) Learn an existing language. Smalltalk (best), Ruby (ok), Python (it may
    > suit your personal taste better than Ruby), CLOS/Lisp (powerful and much you
    > can learn from), Java (poor), C++ (bad).
    >
    > 2) Look at how OO has been grafted onto existing languages. C converted to C++
    > (Read Stoustrup's book). Pascal converted to Delphi. Python (early, non-OO)
    > converted to Python (current, with OO). Lua, non-OO but specifically designed
    > to allow OO to be layered over it. CLOS added to Lisp (read the "Art of the
    > Metaobject Protocol" book).
    >
    > 3) See (4).
    >
    > 4) This is a biggie. How you design your type system will determine the
    > expressiveness of the language, which in turn will constrain the
    > implementation. See (1) for some examples. There is also a moderately large
    > and (to me) totally incomprehensible literature on theories of type systems for
    > OO. The name Cardelli drops up often, and is to be treated with wary respect
    > (as you might an unexploded tiger).
    >
    > 5) See (1).
    >
    > -- chris
     
    , Nov 28, 2005
    #4
    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. Paul Selibas

    Modularity

    Paul Selibas, Nov 24, 2005, in forum: Java
    Replies:
    3
    Views:
    434
  2. Richard Maher
    Replies:
    6
    Views:
    576
    Richard Maher
    Jul 2, 2007
  3. bugbear
    Replies:
    13
    Views:
    553
  4. =?iso-8859-1?q?Robin_K=E5veland?=

    Plugins / Modularity

    =?iso-8859-1?q?Robin_K=E5veland?=, Oct 10, 2007, in forum: Python
    Replies:
    3
    Views:
    317
  5. naorye
    Replies:
    0
    Views:
    336
    naorye
    Nov 30, 2009
Loading...

Share This Page