Ideas For A New OO Multithreaded Language

The Yadavs <>
3 Jul 1996 23:42:01 -0400

          From comp.compilers

Related articles
Ideas For A New OO Multithreaded Language (The Yadavs) (1996-07-03)
| List of all articles for this month |

From: The Yadavs <>
Newsgroups: comp.compilers
Followup-To: poster
Date: 3 Jul 1996 23:42:01 -0400
Organization: Ontario Northland--ONLink
Keywords: OOP, design

I have been doing some work with compiliers lateley and I'm interested
in the idea of creating a new mutlithreaded OO language in releation
with another project. I was thinking about using my then fav OO
language, C++, as a base for design, extending it to C++++, D whatever.
  Only shortly after did I realize that there were numerous dialects of
such a language existing (paraC++, uC++, metaC++ and the list goes
on...). After learning Java, I found that a lot of ideas I was thinking
about were already implimented. However after thinking about it even
longer I find I still have a few ideas that might make it worthy to
design such a language.

Here are some basic definitions I have some up with about this OO
language (I haven't read one of those big fat books on OO design, after
you read this, tell me if I should).

1. There are 3 main enities in a language:


these definitions are probably chalked full of holes but here's my best

An object is a defined state, whose members form the components of a
state vector which identfies that object (In relation to a thread I was
reading a while ago if you change the value of a member is it the same
object? Without starting it up again I say yes, change the ordinate of
an ordered pair, and you have a different point, change the wheel on
your old car, and it's not your old car, if I'm wrong just tell me).

Operators are entities whose application to an object results in a new
object through changing of the applied's state vector.

Methods are functions that an object can perform through defined set of

Ok so what I'd like to do is start off with the base object called,
surprise, Object, and it'll have operators:

:(Object); //Inheret methods and members
from an Object
Object(); //Construtor
add_Operator(definition); //Define a new operator
add_Method(definition); //Define a new, not necessarily
//Should it have remove_Operator and remove_Method too?
create; //just like C++'s new and delete

from there we can create the next generation classes:

Vector : Object //Probably best used as
operator +;
operator -;
Vector dimension; //Uh I guess this wouldn't work, but
please keep following
and then our number types:

Integer:Vector(1) //Inheret from a one-dimensional
Real: Vector(1)


These methods of course would be platform dependant.

Other object to part of the first generation would be things like the
nilObject to identify absence of an object. I am also wondering if
would be possible to impliment the whole language via objects (there
would be an "if"object that would handle comparisons and whatever else
you'd need)?
Of course there is some point (at the number inhereted vector classes)
where you'd need to define methods with repsect to the platform being
used, but the compiler could generate byte codes, and then when
transferred to another plaform, it'll recompile using the methods it
needs. I realize Java does something similar, but I'm still at lost to
find one number that says how much of it's interpeted (I've heard from
20%- 60% in the same book!).
Now can we eliminate the need for classes? Whenever you want to create
an instance of a class, you just inheret from it and don't add any
methods. I also see advantages when wanting to have all objects
initialzed with certain values and it'd be too ugly for constructors.
And, in C++, and Java, I hate creating a definitition for just one
object I'm goining to use. Parameters to methods are passed as "an
object inherting from xxxx" and you can use all methods defined for that
parent object. I also like the way all objects are refrences until you
use th new operator.

Other features I can see:

-Why can't we use fonts for coding? Although I can see where it can get
to be a pain in the neck, code is much more readable by using things
like standard mathematical notation. Super and subscripts could do a
lot to clarify. Or maybe this would be a seprate part of the compilier
where "beautifies" and "de-beautifies" code allowing one to write with
standard ascii (or unicode I guess) if she pleases.
The other thing would be a layout where you can see all you tasks
running in paralell. When coding you should see all your tasks line up
beside eachother, this would be encouraging to take advantage of the
multithreaded nature.

I realize I haven't been very specific, and not included how I'd handle
things like access specifiers and the like, but I'm sure it's not hard
to imagine how it would be done. I've also got some logical errors in
the above vector example but, my objective (xcuse the pun ;->) here is
to just get a working model, I just want ot know if I'm on the wrong
track already. So does anyone here see anything:

anything else?

The last question I have is wether such a languge could be implimented
very efficiently (I suppose more to a parallel processing design for
multi-threading, but just pretend that you have an ideal multi-tasking

Please email or post, whatever you want.

All ideas are welcome, but please be kind with you critisims.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.