Welcome, Guest. Please login or register.

Author Topic: Java (sort of) for the Amiga  (Read 3256 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Java (sort of) for the Amiga
« on: December 18, 2006, 06:11:24 PM »
I have a pet C++ framework that gives a lot useful classes (provided you want to do game/graphics type stuff, play with threads etc) but nothing like the featureset offered by java's runtime.

The problem you have is that java has a fair few syntatical differences from C++ that would make any such project impossible as well as keywords and their expected behaviours. There's no final, abstract, synchronized, implements, interface, import, export, extends etc and even though the behaviour of these can often be implemented, you won't get that implementation into a simple #define'd keyword that makes your source appear similar to the equivalent java source.

Furthermore, java uses garbage collection, C++ doesn't and writing a GC implementation on a system where your classes might have to do low level work (eg locking hardware resources etc), GC becomes extremely tricky to implement.

There are a great many more differences too, far to many to detail here.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Java (sort of) for the Amiga
« Reply #1 on: December 19, 2006, 04:09:56 PM »
Source code translation is a different matter. What you initially suggested sounded more like making C++ syntactically more java like so that java sources could be compiled by C++.

Try converting Java to C++ that makes extensive use of threads, synchronized calls, static code within classes, anonymous closures, even without using anything beyond java.lang and you will run into problems.
int p; // A