July 20, 2014
On 2014-07-20 02:46, Mike wrote:

> What do you mean by "native type"?  I thought the only native types in D
> were `size_t` and `ptrdiff_t`.  What's the actual syntax you use in the
> OSX port?

External C functions that take pointers are declared to take int/long in the Java code. I would prefer that the original type is used.

> If you're looking for alternative names for `size_t` and `ptrdiff_t` how
> about:
>
> alias native_int = ptrdiff_t;
> alias native_uint = size_t;

Hmm, I don't know. Perhaps ptrdiff_t is good enough.

-- 
/Jacob Carlborg
July 20, 2014
On 2014-07-20 01:40, Mike wrote:

> Interesting! How was the original port from SWT to DWT done?  Was some
> utility used?

It's manually ported. There was a try to create a tool [1] to automatically port the code but that required a too big part of the Java standard library to be ported as well.

[1] http://dsource.org/projects/tioport

-- 
/Jacob Carlborg
July 20, 2014
On 2014-07-20 15:52, Jacob Carlborg wrote:

> It's manually ported. There was a try to create a tool [1] to
> automatically port the code but that required a too big part of the Java
> standard library to be ported as well.

It might be worth investigation to try and do an automatic port again. I had a look and saw that in Java 6 there's an API for parsing Java. It would be really nice to have completely automatic tool for porting. It could be hard coded for SWT, I think Tioport tried to be usable for other Java projects.

-- 
/Jacob Carlborg
July 21, 2014
On Sunday, 20 July 2014 at 19:33:35 UTC, Jacob Carlborg wrote:
> On 2014-07-20 15:52, Jacob Carlborg wrote:
>
>> It's manually ported. There was a try to create a tool [1] to
>> automatically port the code but that required a too big part of the Java
>> standard library to be ported as well.
>
> It might be worth investigation to try and do an automatic port again. I had a look and saw that in Java 6 there's an API for parsing Java. It would be really nice to have completely automatic tool for porting. It could be hard coded for SWT, I think Tioport tried to be usable for other Java projects.

Well, what's the GUI future of D?  Does DWT have a role to play?

Mike

July 21, 2014
On 21/07/14 03:00, Mike wrote:

> Well, what's the GUI future of D?  Does DWT have a role to play?

I think so. But not so many others do. They either want to use Qt, GTK or create a completely new framework.

* GTK - doesn't native drawing operations. Requires separate download

* Qt - written in C++, hard to interface with. I don't think it uses native drawing on all platforms. Requires separate download

* Completely new framework - huge undertaking, will take a massive amount of time and resources

-- 
/Jacob Carlborg
July 21, 2014
On 21/07/14 03:00, Mike wrote:

> Well, what's the GUI future of D?  Does DWT have a role to play?

If we could make the process completely automatic (or nearly automatic) to make it easy to keep up with SWT. And also create a GUI builder then I think DWT is in a very good position.

-- 
/Jacob Carlborg
July 21, 2014
On Monday, 21 July 2014 at 06:12:29 UTC, Jacob Carlborg wrote:
> On 21/07/14 03:00, Mike wrote:
>
>> Well, what's the GUI future of D?  Does DWT have a role to play?
>
> If we could make the process completely automatic (or nearly automatic) to make it easy to keep up with SWT. And also create a GUI builder then I think DWT is in a very good position.

Well, I've never written any Java code before, and I'm not looking forward to learning yet another language. Is it possible to utilize the java parser from D?

I'm thinking I should probably just get the 64-bit port done for now, but if you can think of a way to write the porting utility in D I'll consider giving it a try.

Mike
July 21, 2014
On Monday, 21 July 2014 at 09:35:30 UTC, Mike wrote:
> On Monday, 21 July 2014 at 06:12:29 UTC, Jacob Carlborg wrote:
>> On 21/07/14 03:00, Mike wrote:
>>
>>> Well, what's the GUI future of D?  Does DWT have a role to play?
>>
>> If we could make the process completely automatic (or nearly automatic) to make it easy to keep up with SWT. And also create a GUI builder then I think DWT is in a very good position.
>
> Well, I've never written any Java code before, and I'm not looking forward to learning yet another language. Is it possible to utilize the java parser from D?

Or, is there a utility out there that can dump Java source to xml or something more consumable by D?  Then I might have some hope.

Mike

July 21, 2014
On 2014-07-21 11:35, Mike wrote:

> Well, I've never written any Java code before, and I'm not looking
> forward to learning yet another language. Is it possible to utilize the
> java parser from D?

In theory it should be possible to access via JNI (Java Native Interface), but that's very cumbersome and it would be easier to write the tool in Java, or any other language that runs on the JVM (Scala, Ruby and so on).

> I'm thinking I should probably just get the 64-bit port done for now,
> but if you can think of a way to write the porting utility in D I'll
> consider giving it a try.

Possibly if there's a parser wirtten in C. But I'm not sure if a parser is enough, I think a full front end is needed, including the semantic analyzer.

-- 
/Jacob Carlborg
July 21, 2014
On 2014-07-21 11:52, Mike wrote:

> Or, is there a utility out there that can dump Java source to xml or
> something more consumable by D?  Then I might have some hope.

No, not that I know of. You might be able to find a Java grammar for some parser generator that could be used. But, as I wrote in the other post, I think semantic analyze is required to do this well enough.

-- 
/Jacob Carlborg