FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Own Java code to D?

 
Post new topic   Reply to topic     Forum Index -> Tioport
View previous topic :: View next topic  
Author Message
flashdog



Joined: 10 Oct 2008
Posts: 15

PostPosted: Tue Nov 11, 2008 12:00 am    Post subject: Own Java code to D? Reply with quote

Hello,
is it possible to translate own Java code to D?

After translation with Tioport need D a Java Vitual Machine?

Best regard,
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Tue Nov 11, 2008 6:31 am    Post subject: Reply with quote

No you don't need the virtual machine, but the ported code is very ugly and it's a lot better to do the port manually. You can see DWT for example, it's a manual port.
Back to top
View user's profile Send private message
flashdog



Joined: 10 Oct 2008
Posts: 15

PostPosted: Tue Nov 11, 2008 7:09 am    Post subject: Reply with quote

That sounds good.

Does Tioport woks better with DMD or GDC and do I need a Tango?

Exist somewhere a Howto how I can install Tioport under linux?
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Tue Nov 11, 2008 3:19 pm    Post subject: Reply with quote

I think dmd would work best and you need tango. I don't think there is a howto, the tioport project is abandoned. I really think you should do the port manually. The DWT project contains a lot of helper code that makes it easier to port from java to D. http://www.dsource.org/projects/dwt-linux/browser/dwt/dwthelper.
Back to top
View user's profile Send private message
flashdog



Joined: 10 Oct 2008
Posts: 15

PostPosted: Thu Nov 13, 2008 6:48 pm    Post subject: Reply with quote

DMD 1.033, DSSS 0.78-x86-gnuWlinux and Tango tango-0.99.7 works well, but I have problem to understand the installation howto ( http://www.dsource.org/projects/dwt/wiki/Installation ).

I did this
Code:

gedit dsss/etc/rebuild/dmd-posix-tango
search for "oneatatime" and change to "no" (twice!)


But I cannot understand this step:
Code:

export PATH=`pwd`/dsss/bin:`pwd`/tango/bin:$PATH"

Because I have not /tango/bin.

If I tried a HelloWorld1.d from /dwt-samples/examples/helloworld I get this error:
Code:

$ dmd HelloWorld1.d
HelloWorld1.d(14): module Display cannot read file 'dwt/widgets/Display.d'


My all installation steps:
DMD install
Code:

$ unzip dmd.1.033.zip
$ chmod u+x dmd/bin/dmd dmd/bin/obj2asm dmd/bin/dumpobj
$ PATH="/home/flashdog/d/dmd/bin:$PATH"; export PATH


DSSS install
Code:

$ tar -xvjf dsss-0.78-x86-gnuWlinux.tar.bz2
$ mv dsss-0.78-x86-gnuWlinux/ dsss
$ export PATH="/home/flashdog/d/dsss/bin:$PATH"


Tango install
Code:

$ tar -xvzf tango*.tar.gz
$ cd tango*/lib
$ ./build-dmd.sh
$ cp -Rf libtango-base-dmd.a /home/flashdog/d/dmd/lib

$ mkdir /home/flashdog/d/dmd/include/
$ mkdir /home/flashdog/d/dmd/include/d

$ cp -f ../object.di /home/flashdog/d/dmd/include/d
$ cp -Rf ../tango /home/flashdog/d/dmd/include/d
$ cp -Rf ../std /home/flashdog/d/dmd/include/d

/home/flashdog/d/dmd/bin/dmd.conf
[Environment]
DFLAGS=-I/home/flashdog/d/dmd/include/d -defaultlib=tango-base-dmd -debuglib=tango-base-dmd -version=Tango -version=Posix -L-L%@P%/../lib -L-ltango-user-dmd

$ cp -f libtango-user-dmd.a /home/flashdog/d/dmd/lib
$ ./build-tango.sh dmd


What do I wrong?


Last edited by flashdog on Sun Nov 16, 2008 8:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Fri Nov 14, 2008 5:47 am    Post subject: Reply with quote

[quote="flashdog"]But I cannot understand this step:
Code:

export PATH=`pwd`/dsss/bin:`pwd`/tango/bin:$PATH"

Because I have not /tango/bin.[quote]

This step is just to make sure you have dsss and dmd in the PATH but you already have that acording to your installation step.

You have to build DWT first, cd in to the dwt directory and run "dsss build" and then "dsss install" now you should be able to build a dwt app with dsss like this: "dsss build main.d".

If you just want the parts that help you to port java to D then you can copy dwt/dwthelper to a new directory and build with "dsss build dwthelper"
Back to top
View user's profile Send private message
flashdog



Joined: 10 Oct 2008
Posts: 15

PostPosted: Fri Nov 14, 2008 7:55 am    Post subject: Reply with quote

Code:

$ cd dwt-linux/
$ dsss build
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
Error: gdc is not in $PATH
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
Error: gdc is not in $PATH
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
Error: gdc is not in $PATH
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
/home/flashdog/d/dsss/bin/rebuild: /usr/lib/libstdc++.so.6: no version information available (required by /home/flashdog/d/dsss/bin/rebuild)
Error: gdc is not in $PATH
dwt => DO-dwt


Why does dsss looking for gdc? I use dmd.

Code:

$ cd /usr/lib/libstdc++.
libstdc++.a         libstdc++.so        libstdc++.so.6.0.6
libstdc++.la        libstdc++.so.6


What do I wrong?
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Fri Nov 14, 2008 9:15 am    Post subject: Reply with quote

Are D and Tango working as they should, try to build a hello world app first without dwt:
Code:
module main;

import tango.io.Stdout;

void main ()
{
    version (Tango)
        Stdout("Tango").newline;

    else
        Stdout("Not Tango").newline;
}


Save to "main.d" build with "dsss build main.d". Should print "Tango".

You also have to change the rebuild profile, I'm not sure where it is on linux but I think it's in "/usr/etc/rebuild" then open "default" and change to "dmd-posix-tango"

You can also join the irc channel #dwt at freenode to get help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tioport All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group