Creating java classes with Eiffel

There is a lot of people in these forums that have claimed their animosity towards the aparently weakness of the java language when compared with other oo languages.

The biggest offender is the last implementation of java temaplates and still the lack the multiple inheritance.

However you guys have a possible exit in Eiffel. More precisely the freeware SmartEiffel compiler:

http://smarteiffel.loria.fr/

This is not a compiler in the proper term but a frontend to c++ and a compiler for java classes.

This languages is being developed by some univ dudes as a research project and suports the entire Eiffel architecture. See research papers in the middle of this page:

http://smarteiffel.loria.fr/technical/technical.html

Eiffel suports multiple inheritance, rewriting of class and member function names, and full generics.

What got my atention is not only the possibility of creating java aplications with Eiffel but the way they handle templates an inheritance. Aparently Eiffel can do a couple of nasty and very tasty tricks like:

-> Turning virtual methods static when the compiler detects they don’t use/require dynamic binding.

-> Inlining of previous methods.

-> The compiler can detect when generics can be decided staticaly at compile time. If this is not possible the compiler will resolve generics at runtime by adding he required code.

-> When using SmartEiffel as a frontend to ansi-c it will attach the SE library to it that will do grabage collection in c code by a method explained here:

http://smarteiffel.loria.fr/papers/papers.html#ISMM98

Mark and Sweep algorithm anyone ?

What may be vexing to Sun is how SmartEiffel implemented generics. In Eiffel generics are neither static or decided at runtime. The policy of the creators of that language is that they should NOT throw to the backs of programmers the decision of when to use static generics (decided at compile time) or dynamic generics with runtime info attached to the classes. It’s the compilers that does this automaticaly with no sacrifice for performance.

It seems a good idea. Im willing to guive a try to SmartEiffel. Besdies there is also the bonus to be able to translate Eiffel to both ansi c or java classes without having to change the code and it’s possible to easly interface to c code and java code with a minimal lost of performance when doing it or so they say.

Eiffel is a clever designed OO language, but it lacks of popularity and libraries. It’s far of the Java platform sadly :frowning: .

Eiffel got a nice design by contract syntax integrated in the language, it’s very usefull. There is a nice implementation of design by contract for Java : http://www.cs.iastate.edu/~leavens/JML/index.shtml

I know the Java Modeling Language. The profs at my univ advertise that all the time. However thats almost a language inside the Java language itself. Its like programming the same methods twice, one in a lisp like recursive language and the other in Java.

" Eiffel is a clever designed OO language, but it lacks of popularity and libraries. It’s far of the Java platform sadly Sad . "

I can ignore the popularity since at the end what counts is the classes that will run on the javavm. IMO the javavm is by far a much greater technological achievemnet than the java language itself. Sometimes i think the java language was made just to have something to test the javavm. Just like quake3 was made to be a prototype game to advertise the engine.

And by the way i believe there is a way to use any java classes with SmartEiffel so this may meen that all java libraries are accessible to SmartEiffel. But i think the only thing that will really matter in the case of games programming is the opengl bindings and access to the most common devices, since opengl is or should be used for every other thing including the gui.

For most people that know eiffel and program java, the ONLY thing they really care about is getting eiffel’s design-by-contract into java.

I have a stack of references for this, which I keep track of progress for, but IIRC the most advanced / solid one is usually JContract.

Compared to d-b-c, everything else in Eiffel is irrelevant to java devs IMHO - d-b-c does a whole galaxy of good. Other features might be nice, but are just like every language has the odd “nifty little thing” yet not enough for you to really weep that you don’t have it.

And i thought that Jcontract had disapeared from map.

I believe most people who turn to Java do it for two reasons:

1- C++ is a pain in the ass to learn and use and it has still too many low level features.

2- Java is easier and has the Sun logo in it. And this is probably the biggest reason why java devs use Suns language and not a better one.

[quote]And i thought that Jcontract had disapeared from map.
I believe most people who turn to Java do it for two reasons:
1- C++ is a pain in the ass to learn and use and it has still too many low level features.
2- Java is easier and has the Sun logo in it. And this is probably the biggest reason why java devs use Suns language and not a better one.
[/quote]
???
I use masm32 and Java. C++'s no multipass compiler could hurt you quite a lot. There is no such problem in assembly. (Of course you can’t be more low level than with assembly, or halfscript.)

Write once debug everywhere. I suppose it’s simplier, if you don’t count all thread problems. (but everyone would need to learn proper fast multithreading)
Of course you are NOT alowed to use name of Sun microsystems to advertize your work. So about what are you talked about?

BTW C++ is butt ugly.

" Of course you are NOT alowed to use name of Sun microsystems to advertize your work. So about what are you talked about? "

Java=Sun so if you program in Java you will be advertising not only your application but that you are programing in a language made by a well established and trusty software company. Sun won’t just go away the next morning and it won’t simply stop making the language evolve with new technological advances.

Believe me it counts for the people who is going to buy your software to know the language you use. Specialy when they understand very little of programming.