Re: D1, D2 and the future of libraries

2012-01-22 Thread Masahiro Nakagawa

My existing and developing libraries support only D2 :)


Masahiro

On Sun, 22 Jan 2012 01:07:49 +0900, Stewart Gordon smjg_1...@yahoo.com  
wrote:


For the last however long, I've been still programming mostly in D1, but  
aiming to keep my libraries compatible with both D1 and D2.


But changes in D2 have made this more of a challenge.  I've also been  
put off switching to D2 by the wait for D1 to be finished.


Now the plan to discontinue D1 at the end of the year has been  
announced.  And I'm wondering what to do with my libraries.


How many people here are still using D1?

What are those of you who write libraries mainly doing?
(a) supporting only D1?
(b) supporting only D2?
(c) releasing separate D1 and D2 versions?
(d) using versioning to support both with one set of code files?


If practically everyone's using D2 now, maybe I'll migrate my libraries  
to it.  If, OTOH, there's still real demand for D1 libraries, I'll  
continue to support D1.  I might have to see how supporting D2 as well  
works out.  It seems I'll have to abandon the idea of keeping the code  
compatible with the D spec as of DMD 1.00.  It seems the reasons for  
doing this never happened anyway, and there doesn't seem to be an  
equivalent milestone in D2.


Thoughts?

Stewart.


Re: D1, D2 and the future of libraries

2012-01-22 Thread Stewart Gordon

So far, everyone who's replied is supporting only D2.  A few more questions:

Did you previously write libraries for D1?

If so:

- Did you find translating the code straightforward, or are there bits that you found a 
challenge?


- What triggered you to switch?  For example, D2 just being there, signs that D2 is 
stabilising, the announcement of D1's forthcoming end, stumbling over a limitation of D1


Stewart.


Re: D1, D2 and the future of libraries

2012-01-22 Thread Kiith-Sa
I had a small, ~10kloc project I had to rewrite to D2 (not a 
library).


It wasn't much of a problem to port. First I just tried to compile
the code with DMD2 - there were compiler errors, so I fixed those 
-
that took about 1-2 days. More problematic were things that work 
differently in D2 - the code compiled but it didn't run. Don't

remember what exactly was the problem, but there were some things.
Fixing most/all such bugs took about a week. Only then I started 
to change the code to be more D2-like - that took another week.

The code did get more simple, though.

I moved because D2 had interesting features and stuff in Phobos, 
and because it was getting usable enough. (And because I really

wanted RAII structs.)


On Sunday, 22 January 2012 at 15:18:04 UTC, Stewart Gordon wrote:
So far, everyone who's replied is supporting only D2.  A few 
more questions:


Did you previously write libraries for D1?

If so:

- Did you find translating the code straightforward, or are 
there bits that you found a challenge?


- What triggered you to switch?  For example, D2 just being 
there, signs that D2 is stabilising, the announcement of D1's 
forthcoming end, stumbling over a limitation of D1


Stewart.





Re: D1, D2 and the future of libraries

2012-01-22 Thread Jacob Carlborg

On 2012-01-21 17:07, Stewart Gordon wrote:

For the last however long, I've been still programming mostly in D1, but
aiming to keep my libraries compatible with both D1 and D2.

But changes in D2 have made this more of a challenge. I've also been put
off switching to D2 by the wait for D1 to be finished.

Now the plan to discontinue D1 at the end of the year has been
announced. And I'm wondering what to do with my libraries.

How many people here are still using D1?

What are those of you who write libraries mainly doing?
(a) supporting only D1?
(b) supporting only D2?
(c) releasing separate D1 and D2 versions?
(d) using versioning to support both with one set of code files?


If practically everyone's using D2 now, maybe I'll migrate my libraries
to it. If, OTOH, there's still real demand for D1 libraries, I'll
continue to support D1. I might have to see how supporting D2 as well
works out. It seems I'll have to abandon the idea of keeping the code
compatible with the D spec as of DMD 1.00. It seems the reasons for
doing this never happened anyway, and there doesn't seem to be an
equivalent milestone in D2.

Thoughts?

Stewart.


I have a kind of mix of projects. Most are D1 only, but I'm starting to 
move to D2.


* Orange, DWT - D1 and D2 mixed in the same code base using version 
statements


* DVM - D1, I plan to port this to D2

* Orbit - D1 and D2, separate git branches. I just ported this to D2

* Some other minor projects - D1 only. I'll probably port these to D2 if 
I continue to work on them


* DStep - D2

Supporting both D2 and D1 in the same code base using version statements 
is not recommended and requires extra work and the use of string mixins. 
If you want to support both D2 and D1 I recommend different branches.


I think the reason for why I'm porting my projects to D2 is that now 
Tango is available for D2.


--
/Jacob Carlborg


Re: D1, D2 and the future of libraries

2012-01-22 Thread Jesse Phillips
On Saturday, 21 January 2012 at 16:07:58 UTC, Stewart Gordon 
wrote:
For the last however long, I've been still programming mostly 
in D1, but aiming to keep my libraries compatible with both D1 
and D2.


I haven't built libraries for D1, I have converted a few from D1. 
My things are D2 only, and those I have converted I haven't taken 
much care to maintain the D1 version. D2 is a branch of the D1, 
if you are going to maintain both, always change the D1 branch 
and merge it into D2.


I throw this together a while back:

http://www.prowiki.org/wiki4d/wiki.cgi?PortingFromD1

Feedback is welcome, and changes based on own experience should 
be made :)


Re: D1, D2 and the future of libraries

2012-01-22 Thread Nick Sabalausky
Stewart Gordon smjg_1...@yahoo.com wrote in message 
news:jfh9bb$2v3$1...@digitalmars.com...
 So far, everyone who's replied is supporting only D2.  A few more 
 questions:

 Did you previously write libraries for D1?


Yes. Made the switch about a year, year and a half ago.

 If so:

 - Did you find translating the code straightforward, or are there bits 
 that you found a challenge?


Tango - Phobos2 took a bit of time and some elbow grease, but the only real 
challenges were a few things I was using that weren't in Phobos2 (at least 
not at the time). Some of the code actually become much simpler due to 
Phobos's straightforward nature versus Tango's Java-like design.

D1-D2 was quick and easy. There aren't too many breaking changes, and you 
don't have to really D2-ify code just to make it work in D2. (I was annoyed 
though that UFCS was (and still is) much more broken in D2 than D1. That's 
always been one of my favorite features.)

I had been using xfBuild which turned out not to work on D2 code (never was 
sure if it was xfBuild's fault or DMD's, though). But I quickly discovered 
and switched to RDMD which I like better now anyway (after having fixed the 
major issues it used to have).

The conversion certainly wasn't trivial, but all in all, it was much easier 
than I had expected.


 - What triggered you to switch?  For example, D2 just being there, signs 
 that D2 is stabilising, the announcement of D1's forthcoming end, 
 stumbling over a limitation of D1


There were some killer features in D2 I was chomping at the bit for:

- *Actual* constness (not even necessarily transitive const, although that 
is nice. Just simply *having* real const/immutable *at all*).

- String literals are dynamic arrays instead of static array. So no need to 
be slicing them all the time. For instance, no more of this nonsense: 
[string1[], another string]. 'Course, that's another related benefit: 
Types of certain expressions determined by best common type instead of the 
exact type of the first item.

- Traits. God, it's nice to have traits now. Killer feature for 
metaprogramming.

I think those were the main ones. There may have been more, but I've gotten 
so used to D2 I can't remember what D1's limitations were anymore.




Re: D1, D2 and the future of libraries

2012-01-22 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message 
news:jfi071$1dps$1...@digitalmars.com...
 Stewart Gordon smjg_1...@yahoo.com wrote in message 
 news:jfh9bb$2v3$1...@digitalmars.com...
 - What triggered you to switch?  For example, D2 just being there, signs 
 that D2 is stabilising, the announcement of D1's forthcoming end, 
 stumbling over a limitation of D1


 There were some killer features in D2 I was chomping at the bit for:

 - *Actual* constness (not even necessarily transitive const, although that 
 is nice. Just simply *having* real const/immutable *at all*).

 - String literals are dynamic arrays instead of static array. So no need 
 to be slicing them all the time. For instance, no more of this nonsense: 
 [string1[], another string]. 'Course, that's another related benefit: 
 Types of certain expressions determined by best common type instead of 
 the exact type of the first item.

 - Traits. God, it's nice to have traits now. Killer feature for 
 metaprogramming.

 I think those were the main ones. There may have been more, but I've 
 gotten so used to D2 I can't remember what D1's limitations were anymore.


Oh, and ranges, of course (along with std.algorithm). That was another 
killer feature for me.




Re: D1, D2 and the future of libraries

2012-01-21 Thread Kiith-Sa


I'm only supporting D2.

D1 support would require more effort that can be better used
to add more features and create more libraries. New D users are 
unlikely to try D1 since D2 is now rather stable, and even if

the do, they won't stay there for long.

I myself started using D with D1 about 1,5 years ago, then 6 
months ago I moved to D2 and found it to be getting much more 
stable over time.


For a new D2 user, D1 libraries basically don't exist; if half of
the libraries are D1 only, it seems there are only half as many
libraries.

On Saturday, 21 January 2012 at 16:07:58 UTC, Stewart Gordon 
wrote:
For the last however long, I've been still programming mostly 
in D1, but aiming to keep my libraries compatible with both D1 
and D2.


But changes in D2 have made this more of a challenge.  I've 
also been put off switching to D2 by the wait for D1 to be 
finished.


Now the plan to discontinue D1 at the end of the year has been 
announced.  And I'm wondering what to do with my libraries.


How many people here are still using D1?

What are those of you who write libraries mainly doing?
(a) supporting only D1?
(b) supporting only D2?
(c) releasing separate D1 and D2 versions?
(d) using versioning to support both with one set of code files?


If practically everyone's using D2 now, maybe I'll migrate my 
libraries to it.  If, OTOH, there's still real demand for D1 
libraries, I'll continue to support D1.  I might have to see 
how supporting D2 as well works out.  It seems I'll have to 
abandon the idea of keeping the code compatible with the D spec 
as of DMD 1.00.  It seems the reasons for doing this never 
happened anyway, and there doesn't seem to be an equivalent 
milestone in D2.


Thoughts?

Stewart.





Re: D1, D2 and the future of libraries

2012-01-21 Thread Nick Sabalausky
Stewart Gordon smjg_1...@yahoo.com wrote in message 
news:jfenst$av2$1...@digitalmars.com...

 How many people here are still using D1?

 What are those of you who write libraries mainly doing?
 (a) supporting only D1?
 (b) supporting only D2?
 (c) releasing separate D1 and D2 versions?
 (d) using versioning to support both with one set of code files?



My stuff's D2-only.




Re: D1, D2 and the future of libraries

2012-01-21 Thread Trass3r

D2 only.
No point in supporting D1.