Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Adding Modularity to Triangle Compiler

Thread view: 
glory.faded@gmail.com - 28 Nov 2005 07:58 GMT
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!
Chris Uppal - 28 Nov 2005 11:14 GMT
> 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
glory.faded@gmail.com - 28 Nov 2005 22:42 GMT
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!

> > I need to add classes to the triangle programming language, i.e. need
> > an object orieneted version of Triangle compiler. Its pretty
[quoted text clipped - 47 lines]
>
>     -- chris
Roedy Green - 28 Nov 2005 17:11 GMT
>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.  
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.