June 21, 2010
On 21.06.2010 10:57, Jacob Carlborg wrote:
> On 2010-06-20 17:27, Mengu wrote:
>>  will dwt support phobos in near future?
>
> DWT2 is a work in progress on supporting both tango and D2 (phobos)
>
>

I've got a small example running (Display, Shell and Combo) in D2. There are some things that need to be decided, like what the String alias should be.  Would be nice if could be a Phobos string, ie. immutable(char)[].  That seems to work so far, and is a better match for the Java string semantics that DWT have inherited.

DMD 2's stricter conversion rules have actually caught some bugs in DWT.  In some places, a wchar is implicitly converted to a char, which is not allowed in D 2.

It would be great if DMD 1.x would accept the __gshared keyword, though.  It sucks to have to use string mixins or static this to work around that.
June 21, 2010
On 2010-06-21 22:46, torhu wrote:
> On 21.06.2010 10:57, Jacob Carlborg wrote:
>> On 2010-06-20 17:27, Mengu wrote:
>>> will dwt support phobos in near future?
>>
>> DWT2 is a work in progress on supporting both tango and D2 (phobos)
>>
>>
>
> I've got a small example running (Display, Shell and Combo) in D2. There
> are some things that need to be decided, like what the String alias
> should be. Would be nice if could be a Phobos string, ie.
> immutable(char)[]. That seems to work so far, and is a better match for
> the Java string semantics that DWT have inherited.
>
> DMD 2's stricter conversion rules have actually caught some bugs in DWT.
> In some places, a wchar is implicitly converted to a char, which is not
> allowed in D 2.
>
> It would be great if DMD 1.x would accept the __gshared keyword, though.
> It sucks to have to use string mixins or static this to work around that.

I guess we have to look at all these D2 things. I haven't done any dwt development lately, haven't had time, which I don't like.

-- 
/Jacob Carlborg
June 21, 2010
> I've got a small example running (Display, Shell and Combo) in D2.

Don't suppose you'd like to share?  I started messing with this last night, and the tip of DWT2 in the repo doesn't even appear to compile w/ D2 at the moment.

Speaking of which, who is currently maintaining the branch?  It doesn't appear to have had any changes for some time...

Jeremy (who is just getting back to using D after a few years hiatus)


On Mon, Jun 21, 2010 at 1:46 PM, torhu <no@spam.invalid> wrote:
> On 21.06.2010 10:57, Jacob Carlborg wrote:
>>
>> On 2010-06-20 17:27, Mengu wrote:
>>>
>>>  will dwt support phobos in near future?
>>
>> DWT2 is a work in progress on supporting both tango and D2 (phobos)
>>
>>
>
> I've got a small example running (Display, Shell and Combo) in D2. There are some things that need to be decided, like what the String alias should be.  Would be nice if could be a Phobos string, ie. immutable(char)[].  That seems to work so far, and is a better match for the Java string semantics that DWT have inherited.
>
> DMD 2's stricter conversion rules have actually caught some bugs in DWT.  In some places, a wchar is implicitly converted to a char, which is not allowed in D 2.
>
> It would be great if DMD 1.x would accept the __gshared keyword, though.  It sucks to have to use string mixins or static this to work around that.
>
June 21, 2010
On 2010-06-21 22:46, torhu wrote:
>> On 21.06.2010 10:57, Jacob Carlborg wrote:
>> I've got a small example running (Display, Shell and Combo) in D2. There
>> are some things that need to be decided, like what the String alias
>> should be. Would be nice if could be a Phobos string, ie.
>> immutable(char)[]. That seems to work so far, and is a better match for
>> the Java string semantics that DWT have inherited.
>>
>> DMD 2's stricter conversion rules have actually caught some bugs in DWT.
>> In some places, a wchar is implicitly converted to a char, which is not
>> allowed in D 2.
>>
>> It would be great if DMD 1.x would accept the __gshared keyword, though.
>> It sucks to have to use string mixins or static this to work around that.
>
> I guess we have to look at all these D2 things. I haven't done any dwt
> development lately, haven't had time, which I don't like.

I'm considering creating at least a a temporary fork of DWT 2 on bitbucket.org.  Then I can just check in some stuff and see how it turns out.  It's possible that I'll have time to do some work on it this summer, but that might change quickly...
June 22, 2010
On 2010-06-22 01:40, torhu wrote:
> On 2010-06-21 22:46, torhu wrote:
>>> On 21.06.2010 10:57, Jacob Carlborg wrote:
>>> I've got a small example running (Display, Shell and Combo) in D2. There
>>> are some things that need to be decided, like what the String alias
>>> should be. Would be nice if could be a Phobos string, ie.
>>> immutable(char)[]. That seems to work so far, and is a better match for
>>> the Java string semantics that DWT have inherited.
>>>
>>> DMD 2's stricter conversion rules have actually caught some bugs in DWT.
>>> In some places, a wchar is implicitly converted to a char, which is not
>>> allowed in D 2.
>>>
>>> It would be great if DMD 1.x would accept the __gshared keyword, though.
>>> It sucks to have to use string mixins or static this to work around
>>> that.
>>
>> I guess we have to look at all these D2 things. I haven't done any dwt
>> development lately, haven't had time, which I don't like.
>
> I'm considering creating at least a a temporary fork of DWT 2 on
> bitbucket.org. Then I can just check in some stuff and see how it turns
> out. It's possible that I'll have time to do some work on it this
> summer, but that might change quickly...

You can see if Frank can give you access to the repository, try sending him an e-mail. I know we can use some more people on this project. I don't even know if I have commit access to the DWT2 repository, what I do know is that I have at least access to the dwt-mac repository.

-- 
/Jacob Carlborg
July 11, 2010
On 22.06.2010 14:49, Jacob Carlborg wrote:
> On 2010-06-22 01:40, torhu wrote:
[...]
>>  I'm considering creating at least a a temporary fork of DWT 2 on
>>  bitbucket.org. Then I can just check in some stuff and see how it turns
>>  out. It's possible that I'll have time to do some work on it this
>>  summer, but that might change quickly...
>
> You can see if Frank can give you access to the repository, try sending
> him an e-mail. I know we can use some more people on this project. I
> don't even know if I have commit access to the DWT2 repository, what I
> do know is that I have at least access to the dwt-mac repository.
>

I've set up my own project on Bitbucket.  I've made enough changes to build my DWT app on Windows, and it's works like a charm.  A lot of the Phobos code was already there, and I've added what was needed for my use.  Since DWT enforces that all GUI code is run in the same thread (usually the main thread), I didn't need to add shared and __gshared that many places.

I had to add a lot of casts because D2 compilers are stricter about narrowing conversions.  In some places Java's char type was kept as char, and not changed into wchar.  I've changed the ones I came across to wchar, to avoid truncating code points that are outside of ASCII. Some conversions between char[] and wchar had to be added.

The String alias is D2 string, which works just fine.

http://bitbucket.org/torhus/dwt2
July 11, 2010
On 2010-07-11 19.09, torhu wrote:
> On 22.06.2010 14:49, Jacob Carlborg wrote:
>> On 2010-06-22 01:40, torhu wrote:
> [...]
>>> I'm considering creating at least a a temporary fork of DWT 2 on
>>> bitbucket.org. Then I can just check in some stuff and see how it turns
>>> out. It's possible that I'll have time to do some work on it this
>>> summer, but that might change quickly...
>>
>> You can see if Frank can give you access to the repository, try sending
>> him an e-mail. I know we can use some more people on this project. I
>> don't even know if I have commit access to the DWT2 repository, what I
>> do know is that I have at least access to the dwt-mac repository.
>>
>
> I've set up my own project on Bitbucket. I've made enough changes to
> build my DWT app on Windows, and it's works like a charm. A lot of the
> Phobos code was already there, and I've added what was needed for my
> use. Since DWT enforces that all GUI code is run in the same thread
> (usually the main thread), I didn't need to add shared and __gshared
> that many places.
>
> I had to add a lot of casts because D2 compilers are stricter about
> narrowing conversions. In some places Java's char type was kept as char,
> and not changed into wchar. I've changed the ones I came across to
> wchar, to avoid truncating code points that are outside of ASCII. Some
> conversions between char[] and wchar had to be added.
>
> The String alias is D2 string, which works just fine.
>
> http://bitbucket.org/torhus/dwt2

So this is working with D2? If that's the case then it's great news. I've also found two other guys who want to work on DWT2 so this is starting to look pretty promising. Are your fork windows only? Have you looked anything on the linux port? I'll try to have a look at your branch and see if I can merge it with the main branch.

I'm also thinking that we may need to organize our self a bit so we don't work on the same things.

-- 
Jacob Carlborg
July 11, 2010
W dniu 2010-07-11 19:09, torhu pisze:
> On 22.06.2010 14:49, Jacob Carlborg wrote:
>> On 2010-06-22 01:40, torhu wrote:
> [...]
>>> I'm considering creating at least a a temporary fork of DWT 2 on
>>> bitbucket.org. Then I can just check in some stuff and see how it turns
>>> out. It's possible that I'll have time to do some work on it this
>>> summer, but that might change quickly...
>>
>> You can see if Frank can give you access to the repository, try sending
>> him an e-mail. I know we can use some more people on this project. I
>> don't even know if I have commit access to the DWT2 repository, what I
>> do know is that I have at least access to the dwt-mac repository.
>>
>
> I've set up my own project on Bitbucket. I've made enough changes to
> build my DWT app on Windows, and it's works like a charm. A lot of the
> Phobos code was already there, and I've added what was needed for my
> use. Since DWT enforces that all GUI code is run in the same thread
> (usually the main thread), I didn't need to add shared and __gshared
> that many places.
>
> I had to add a lot of casts because D2 compilers are stricter about
> narrowing conversions. In some places Java's char type was kept as char,
> and not changed into wchar. I've changed the ones I came across to
> wchar, to avoid truncating code points that are outside of ASCII. Some
> conversions between char[] and wchar had to be added.
>
> The String alias is D2 string, which works just fine.
>
> http://bitbucket.org/torhus/dwt2

Sorry for getting into middle of the thread.

I just would like to say that it is a great news! After discovering that for Java:
----
double sum = 0.0;
for (int i = 0; i < 10; i++) sum += 0.1;
----

sum is equal: 0.9999999999999999

I am looking at D with greater and greater sentiment :-) SWT and good precision of calculations is necessary for my program...

It's also possible that I will be able to help with some smaller things...

BR
Marcin Kuszczak
(aarti_pl)
July 11, 2010
aarti_pl wrote:
> I just would like to say that it is a great news! After discovering that for Java:
> ----
> double sum = 0.0;
> for (int i = 0; i < 10; i++) sum += 0.1;
> ----
> 
> sum is equal: 0.9999999999999999
> 
> I am looking at D with greater and greater sentiment :-) SWT and good precision of calculations is necessary for my program...
> 
	Are you sure D is better? In C, you get 0.99999999999999988898 (not
surprising since 0.1 cannot be represented exactly in base 2) and I
would expect D to give the same result...

		Jerome
-- 
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr



July 11, 2010
W dniu 2010-07-11 22:45, "Jérôme M. Berger" pisze:
> aarti_pl wrote:
>> I just would like to say that it is a great news! After discovering that
>> for Java:
>> ----
>> double sum = 0.0;
>> for (int i = 0; i<  10; i++) sum += 0.1;
>> ----
>>
>> sum is equal: 0.9999999999999999
>>
>> I am looking at D with greater and greater sentiment :-) SWT and good
>> precision of calculations is necessary for my program...
>>
> 	Are you sure D is better? In C, you get 0.99999999999999988898 (not
> surprising since 0.1 cannot be represented exactly in base 2) and I
> would expect D to give the same result...
>
> 		Jerome

On my computer it is exactly 1.0 (one).

I know that there is explanation of why it is like that, as I found article about it. I did not get deeper into it (good few pages of text) as I believe there must better solution for programmers.

My calculator shows proper results, spreadsheet shows proper results and I think that calculations in my program for such a big fractions should also give correct result.

Just thought: maybe calculations in D are done internally in more than 64bits and then casted into 64bits? It's a bit surprising for me that C is also wrong about this sum...

BR
Marcin Kuszczak
(aarti_pl)