Re: Just starting out

2011-10-18 Thread Daniel Murphy
getch (or one of the variants) does do this, but you may need to disable 
buffering in the console first.

"Nick Sabalausky"  wrote in message 
news:j7iip8$23qb$1...@digitalmars.com...
> "Sean Kelly"  wrote in message 
> news:mailman.151.1318889150.24802.digitalmar...@puremagic.com...
>> There's a call like this but it's nonstandard. getch() maybe?
>>
>> Sent from my iPhone
>>
>
> IIRC, I think I tried that but there was some problem. Either it still 
> waited for Enter, or it didn't wait at all, or something like that.
>
> ---
> Not sent from an iPhone.
>
> 




Re: Just starting out

2011-10-18 Thread mta`chrono
Feel free to help us porting tango to D2. We've already done a lot and
some parts are quite usable. But don't expect to much.
https://github.com/SiegeLord/Tango-D2


Re: Just starting out

2011-10-18 Thread Kai Meyer

On 10/13/2011 01:37 AM, J Arrizza wrote:

Thanks for all the replies. Seems straightforward enough:

1) Phobos is it.
2) DMD is the clear winner
3) Eclipse is a hog - knew that. I really only like a couple of things
in it. A big one for me is the source formatting. For some reason,
having to hit the space bar 4,000 times every hour just isn't my cup of
tea.

The formatter for java set a nice high standard for configurability that
I was hoping a D plug-in would also have. I had issues with installing
descent on Linux (worked ok in windows for some reason), but I'll give
it another shot on Indigo. If that doesn't play, I'll stick with
UltraEdit (great editor, got a life-time license for it).

John



On Wed, Oct 12, 2011 at 11:42 PM, Jacob Carlborg mailto:d...@me.com>> wrote:

On 2011-10-13 01:43, J Arrizza wrote:

    Hi,

    I'm just starting out in D, read the book, tried a Hello World, and
wrote a few unit tests. I'm ready for the next step.

I'd like to begin writing some more complex D code which I want
to use
not only as a test bed to investigate D itself to a deeper level
but if
it's successful to eventually use it as the beginnings of a
toolkit for
our internal use.

I'm looking for some recommendations from folks with lots of
experience
in D:

1) Which to use: Phobos, Tango, or Tangobos? It makes sense for
us to
use D2 so this seems to preclude Tango for now. Correct?


Most people will definitely say D2 and Phobos. I still think Tango
is better and for the time being that means D1. I also think that
some parts of D2 is not quite ready yet.


Are there plans to merge or standardize on one of these? Phobos and
Tango seem to be incompatible with each other at this point.


Yes, Tango and Phobos are incompatible. There are someone/a couple
of people working on porting Tango to D2. I think that port will use
druntime, meaning it will be compatible with Phobos.

My worry here is if we choose the wrong underlying library we end up
having to re-write a lot of code later on.

2) Which compiler? DMD, GDC or something else?  We use Ubuntu
10.04, 64
bit as our development platform. I'm assuming the gc is in all the D
compilers.


DMD is a good compiler for development. It's the fastest available D
compiler (as far as I know). It's always up to date, LDC and GDC can
be a release behind DMD. I don't know what's best for production. I
usually hear people saying that LDC and GDC is better than DMD but I
haven't done any benchmarking myself.


3) DDT (eclipse plugin) seems relatively green. Any other
suggestions
for an IDE. Not a big deal for us, but it's nice to have source
formatting. The DDT folks indicated that that feature is a long
way off
for them.


There's an older plugin for Eclipse called Descent. It has source
formatting and a couple of more nice and interesting features, like
compile time debugging. I also shows both syntax and semantic errors
(semantic errors are disable by default). I still uses this plugin
but I can be quite slow and unfortunate it's not maintained anymore.
I still recommend you take a look at it.

http://dsource.org/projects/__descent
<http://dsource.org/projects/descent>

Otherwise I use TextMate on Mac OS X. There's also a similar
application called E (text editor) available on Windows (in the
works for Linux too). It's compatible with TextMate's bundles.

Thanks,
John



--
/Jacob Carlborg




--
John
blog: http://arrizza.blogspot.com/
web: http://www.arrizza.com/


VIM + gnu make has done everything I've needed it to do so far, but the 
biggest project I've done so far was only ~10k lines long.


Re: Just starting out

2011-10-18 Thread Sean Kelly
Games too. If all else fails, maybe look at ncurses?

Sent from my iPhone

On Oct 18, 2011, at 8:41 AM, Sean Kelly  wrote:

> It should block until a key is pressed. I used to use it for "press any key 
> to continue" functionality in console apps. 
> 
> Sent from my iPhone
> 
> On Oct 17, 2011, at 5:54 PM, "Nick Sabalausky"  wrote:
> 
>> "Sean Kelly"  wrote in message 
>> news:mailman.151.1318889150.24802.digitalmar...@puremagic.com...
>>> There's a call like this but it's nonstandard. getch() maybe?
>>> 
>>> Sent from my iPhone
>>> 
>> 
>> IIRC, I think I tried that but there was some problem. Either it still 
>> waited for Enter, or it didn't wait at all, or something like that.
>> 
>> ---
>> Not sent from an iPhone.
>> 
>> 


Re: Just starting out

2011-10-18 Thread Sean Kelly
It should block until a key is pressed. I used to use it for "press any key to 
continue" functionality in console apps. 

Sent from my iPhone

On Oct 17, 2011, at 5:54 PM, "Nick Sabalausky"  wrote:

> "Sean Kelly"  wrote in message 
> news:mailman.151.1318889150.24802.digitalmar...@puremagic.com...
>> There's a call like this but it's nonstandard. getch() maybe?
>> 
>> Sent from my iPhone
>> 
> 
> IIRC, I think I tried that but there was some problem. Either it still 
> waited for Enter, or it didn't wait at all, or something like that.
> 
> ---
> Not sent from an iPhone.
> 
> 


Re: Just starting out

2011-10-18 Thread Dmitry Olshansky

On 14.10.2011 4:49, Nick Sabalausky wrote:




That would be neat.

One thing I'd been thinking of adding to mine was an alternate function that
just waited for a single keystroke (rather than a line of text + Enter). I
think I once had it working on Tango, IIRC, but then I switched to D2/Phobos
and couldn't figure out how to use Phobos to wait for a single keystroke w/o
then waiting for Enter.




I used the following trick on Linux, and I think it should work on any 
posix: call select on stdin i.e. fd_set with one descriptor for reading 
- 0 and timeout of 0. This way you'd get something close to a test for 
keypress.


However that will check if there is a data in stream, so it's quite 
possible to hit any number of "press any key" in advance, so some 
flushing of input in the "wait till keypress" function is needed.


--
Dmitry Olshansky


Re: Just starting out

2011-10-17 Thread Nick Sabalausky
"Sean Kelly"  wrote in message 
news:mailman.151.1318889150.24802.digitalmar...@puremagic.com...
> There's a call like this but it's nonstandard. getch() maybe?
>
> Sent from my iPhone
>

IIRC, I think I tried that but there was some problem. Either it still 
waited for Enter, or it didn't wait at all, or something like that.

---
Not sent from an iPhone.




Re: Just starting out

2011-10-17 Thread Sean Kelly
There's a call like this but it's nonstandard. getch() maybe?

Sent from my iPhone

On Oct 17, 2011, at 2:54 PM, "Nick Sabalausky"  wrote:

> "Jesse Phillips"  wrote in message 
> news:j78djv$1sr3$1...@digitalmars.com...
>> On Thu, 13 Oct 2011 20:49:01 -0400, Nick Sabalausky wrote:
>> 
>>> 
>>> One thing I'd been thinking of adding to mine was an alternate function
>>> that just waited for a single keystroke (rather than a line of text +
>>> Enter). I think I once had it working on Tango, IIRC, but then I
>>> switched to D2/Phobos and couldn't figure out how to use Phobos to wait
>>> for a single keystroke w/o then waiting for Enter.
>> 
>> There isn't a C call to do something like this. In windows you can make a
>> call to system("pause"), but that doesn't provide custom text, isn't
>> cross platform, and apparently if you close the terminal it will start
>> executing code for the time it takes to shut down (i.e. unpause).
>> 
>> Linux you have to pull out an curses trick to manipulate the terminal I
>> believe, also not cross platform. It would be nice to get.
> 
> What I meant was to also retreive the key pressed. But it sounds like that 
> would still have the same problem. 
> 
> 


Re: Just starting out

2011-10-17 Thread Nick Sabalausky
"Jesse Phillips"  wrote in message 
news:j78djv$1sr3$1...@digitalmars.com...
> On Thu, 13 Oct 2011 20:49:01 -0400, Nick Sabalausky wrote:
>
>>
>> One thing I'd been thinking of adding to mine was an alternate function
>> that just waited for a single keystroke (rather than a line of text +
>> Enter). I think I once had it working on Tango, IIRC, but then I
>> switched to D2/Phobos and couldn't figure out how to use Phobos to wait
>> for a single keystroke w/o then waiting for Enter.
>
> There isn't a C call to do something like this. In windows you can make a
> call to system("pause"), but that doesn't provide custom text, isn't
> cross platform, and apparently if you close the terminal it will start
> executing code for the time it takes to shut down (i.e. unpause).
>
> Linux you have to pull out an curses trick to manipulate the terminal I
> believe, also not cross platform. It would be nice to get.

What I meant was to also retreive the key pressed. But it sounds like that 
would still have the same problem. 




Re: User packages/libs (Was: Just starting out)

2011-10-17 Thread Jacob Carlborg

On 2011-10-16 18:46, Russel Winder wrote:

On Sat, 2011-10-15 at 13:24 +0200, Jacob Carlborg wrote:
[ . . . ]


I'm working on a package manger for D:


Do the D packages like being stored in a manger?

;-)



Hehe maybe.

--
/Jacob Carlborg


Re: User packages/libs (Was: Just starting out)

2011-10-16 Thread Jacob Carlborg

On 2011-10-16 16:03, J Arrizza wrote:

Jacob,

That's great!

I would like to work on this myself, it sounds like a great project, but
my experience level right now is so low I'd most likely be the opposite
of productive. Perhaps I  can help out on the test side. Let me know if
you want me to try anything out on Ubuntu 10.04.

John


I have no experience with this either but that haven't stopped me before 
:). If you want you could try and and write cucumber tests for the tool.



On Sat, Oct 15, 2011 at 4:24 AM, Jacob Carlborg mailto:d...@me.com>> wrote:

On 2011-10-14 21:30, John Arrizza wrote:

Just curious... any plans to have an official user supplied set
of packages or modules ala CPAN or ruby gems etc.?

Having a central repository of these kinds of things would
probably increase D popularity.

John


I'm working on a package manger for D:

https://github.com/jacob-__carlborg/orbit

https://github.com/jacob-__carlborg/orbit/wiki/Orbit-__Package-Manager-for-D


--
/Jacob Carlborg






--
/Jacob Carlborg


Re: User packages/libs (Was: Just starting out)

2011-10-16 Thread Russel Winder
On Sat, 2011-10-15 at 13:24 +0200, Jacob Carlborg wrote:
[ . . . ]
> 
> I'm working on a package manger for D:

Do the D packages like being stored in a manger?

;-)

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: User packages/libs (Was: Just starting out)

2011-10-16 Thread J Arrizza
Jacob,

That's great!

I would like to work on this myself, it sounds like a great project, but my
experience level right now is so low I'd most likely be the opposite of
productive. Perhaps I  can help out on the test side. Let me know if you
want me to try anything out on Ubuntu 10.04.

John

On Sat, Oct 15, 2011 at 4:24 AM, Jacob Carlborg  wrote:

> On 2011-10-14 21:30, John Arrizza wrote:
>
>> Just curious... any plans to have an official user supplied set of
>> packages or modules ala CPAN or ruby gems etc.?
>>
>> Having a central repository of these kinds of things would probably
>> increase D popularity.
>>
>> John
>>
>
> I'm working on a package manger for D:
>
> https://github.com/jacob-**carlborg/orbit
> https://github.com/jacob-**carlborg/orbit/wiki/Orbit-**
> Package-Manager-for-D
>
> --
> /Jacob Carlborg
>


Re: User packages/libs (Was: Just starting out)

2011-10-15 Thread Jacob Carlborg

On 2011-10-14 21:30, John Arrizza wrote:

Just curious... any plans to have an official user supplied set of packages or 
modules ala CPAN or ruby gems etc.?

Having a central repository of these kinds of things would probably increase D 
popularity.

John


I'm working on a package manger for D:

https://github.com/jacob-carlborg/orbit
https://github.com/jacob-carlborg/orbit/wiki/Orbit-Package-Manager-for-D

--
/Jacob Carlborg


Re: User packages/libs (Was: Just starting out)

2011-10-14 Thread Jesse Phillips
On Fri, 14 Oct 2011 12:30:59 -0700, John Arrizza wrote:

> Just curious... any plans to have an official user supplied set of
> packages or modules ala CPAN or ruby gems etc.?
> 
> Having a central repository of these kinds of things would probably
> increase D popularity.
> 
> John
> 

DSSS was similar to that goal. Dsource is a place to host projects in one 
place. And someone is working on something new.


User packages/libs (Was: Just starting out)

2011-10-14 Thread John Arrizza
Just curious... any plans to have an official user supplied set of packages or 
modules ala CPAN or ruby gems etc.?

Having a central repository of these kinds of things would probably increase D 
popularity.

John

Nick Sabalausky  wrote:

>"Jesse Phillips"  wrote in message 
>news:j77s69$1j3d$1...@digitalmars.com...
>> Nick Sabalausky Wrote:
>>
>>> "Jesse Phillips"  wrote in message
>>> news:j75t0k$2q6m$3...@digitalmars.com...
>>> >
>>> > I created a cmdln library to help with user interaction, which some 
>>> > seem
>>> > to like.
>>> >
>>> > https://github.com/he-the-great/JPDLibs/tree/cmdln
>>> >
>>>
>>> Looks very nice. I have a similar (but probably more basic) thing, too 
>>> (just
>>> one function: "prompt"):
>>>
>>> http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/cmd/plain.d#L216
>>>
>>>
>>> // -- Basic string prompt --
>>> string input1 = prompt("Type some stuff: ");
>>>
>>> // -- String prompt with validation --
>>> // (failureMsg is optional)
>>> string promptMsg = "Do you want 'coffee' or 'tea'? ";
>>> string failureMsg = "Please enter 'coffee' or 'tea', not '%s'";
>>> bool accept(string input)
>>> {
>>> return ["coffee", "tea"].contains(tolower(input));
>>> }
>>>
>>> // This will *not* return until the user enters a valid choice,
>>> // so we don't need to do any more validation.
>>> string input2 = prompt(promptMsg, &accept, failureMsg);
>>
>> Interesting the similarities. I do provide more specialized functions for 
>> some of those:
>>
>> auto input2 = menu(promptMsg, ["coffee", "tea"]);
>>
>> auto input = require!(string, accept)(promptMsg);
>>
>> I haven't provide the option of displaying an error message, but it could 
>> go in the delegate you use in require. And I suppose prompt is a better 
>> name than userInput.
>>
>
>Yea. I think mine is more customizable and generalized, but yours is more 
>batteries-included and ready-to-go (which makes yours very enticing). Maybe 
>we could merge our designs and come up with something suitable for Phobos? I 
>think this is the exactly the sort of thing that's a perfect fit for 
>inclusion in a std lib: Very handy, but for many people not big enough to 
>justify adding an external dependency.
>
>> On thing I've been kind of interested in is getting something set up that 
>> would allow providing the needed information via a config, args, or at 
>> runtime. but haven't done anything with that idea.
>>
>
>That would be neat.
>
>One thing I'd been thinking of adding to mine was an alternate function that 
>just waited for a single keystroke (rather than a line of text + Enter). I 
>think I once had it working on Tango, IIRC, but then I switched to D2/Phobos 
>and couldn't figure out how to use Phobos to wait for a single keystroke w/o 
>then waiting for Enter.
>
>


Re: Just starting out

2011-10-13 Thread Jesse Phillips
On Thu, 13 Oct 2011 20:49:01 -0400, Nick Sabalausky wrote:

>> auto input2 = menu(promptMsg, ["coffee", "tea"]);
>>
>> auto input = require!(string, accept)(promptMsg);
>>
>> I haven't provide the option of displaying an error message, but it
>> could go in the delegate you use in require. And I suppose prompt is a
>> better name than userInput.
>>
>>
> Yea. I think mine is more customizable and generalized, but yours is
> more batteries-included and ready-to-go (which makes yours very
> enticing).

Hmm, maybe I made mine look more complicated. the two lines for input2 
and input accomplish the same thing. Both ask for and only accept input 
of coffee or tea. The only added customization I see is an error message 
which I think is hard to get right and why I built a menu and expect a 
good question.

> Maybe we could merge our designs and come up with something
> suitable for Phobos? I think this is the exactly the sort of thing
> that's a perfect fit for inclusion in a std lib: Very handy, but for
> many people not big enough to justify adding an external dependency.

Well I did bring up the idea in the Phobos group and the only comment I 
got was from Andrei saying that he doesn't think it is a good fit. But 
now with a proper review process I could see good discussion and input on 
if such should be included (that's what voting is for). 

>> On thing I've been kind of interested in is getting something set up
>> that would allow providing the needed information via a config, args,
>> or at runtime. but haven't done anything with that idea.
>>
>>
> That would be neat.
> 
> One thing I'd been thinking of adding to mine was an alternate function
> that just waited for a single keystroke (rather than a line of text +
> Enter). I think I once had it working on Tango, IIRC, but then I
> switched to D2/Phobos and couldn't figure out how to use Phobos to wait
> for a single keystroke w/o then waiting for Enter.

There isn't a C call to do something like this. In windows you can make a 
call to system("pause"), but that doesn't provide custom text, isn't 
cross platform, and apparently if you close the terminal it will start 
executing code for the time it takes to shut down (i.e. unpause).

Linux you have to pull out an curses trick to manipulate the terminal I 
believe, also not cross platform. It would be nice to get.


Re: Just starting out

2011-10-13 Thread Jussi Jumppanen
J Arrizza Wrote:

> If that doesn't play, I'll stick with UltraEdit 

FWIW, Zeus is another Windows based editor and it is D language 
aware.

It does syntax highlighting, class browsing, code folding etc.

http://www.zeusedit.com/d.html

It is also pretty easy to setup Zeus to run the DMD compiler 
inside the Zeus IDE.

http://www.zeusedit.com/zforum/viewtopic.php?t=2645

Cheers Jussi


Re: Just starting out

2011-10-13 Thread Nick Sabalausky
"Jesse Phillips"  wrote in message 
news:j77s69$1j3d$1...@digitalmars.com...
> Nick Sabalausky Wrote:
>
>> "Jesse Phillips"  wrote in message
>> news:j75t0k$2q6m$3...@digitalmars.com...
>> >
>> > I created a cmdln library to help with user interaction, which some 
>> > seem
>> > to like.
>> >
>> > https://github.com/he-the-great/JPDLibs/tree/cmdln
>> >
>>
>> Looks very nice. I have a similar (but probably more basic) thing, too 
>> (just
>> one function: "prompt"):
>>
>> http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/cmd/plain.d#L216
>>
>>
>> // -- Basic string prompt --
>> string input1 = prompt("Type some stuff: ");
>>
>> // -- String prompt with validation --
>> // (failureMsg is optional)
>> string promptMsg = "Do you want 'coffee' or 'tea'? ";
>> string failureMsg = "Please enter 'coffee' or 'tea', not '%s'";
>> bool accept(string input)
>> {
>> return ["coffee", "tea"].contains(tolower(input));
>> }
>>
>> // This will *not* return until the user enters a valid choice,
>> // so we don't need to do any more validation.
>> string input2 = prompt(promptMsg, &accept, failureMsg);
>
> Interesting the similarities. I do provide more specialized functions for 
> some of those:
>
> auto input2 = menu(promptMsg, ["coffee", "tea"]);
>
> auto input = require!(string, accept)(promptMsg);
>
> I haven't provide the option of displaying an error message, but it could 
> go in the delegate you use in require. And I suppose prompt is a better 
> name than userInput.
>

Yea. I think mine is more customizable and generalized, but yours is more 
batteries-included and ready-to-go (which makes yours very enticing). Maybe 
we could merge our designs and come up with something suitable for Phobos? I 
think this is the exactly the sort of thing that's a perfect fit for 
inclusion in a std lib: Very handy, but for many people not big enough to 
justify adding an external dependency.

> On thing I've been kind of interested in is getting something set up that 
> would allow providing the needed information via a config, args, or at 
> runtime. but haven't done anything with that idea.
>

That would be neat.

One thing I'd been thinking of adding to mine was an alternate function that 
just waited for a single keystroke (rather than a line of text + Enter). I 
think I once had it working on Tango, IIRC, but then I switched to D2/Phobos 
and couldn't figure out how to use Phobos to wait for a single keystroke w/o 
then waiting for Enter.




Re: Just starting out

2011-10-13 Thread Jesse Phillips
Nick Sabalausky Wrote:

> "Jesse Phillips"  wrote in message 
> news:j75t0k$2q6m$3...@digitalmars.com...
> >
> > I created a cmdln library to help with user interaction, which some seem
> > to like.
> >
> > https://github.com/he-the-great/JPDLibs/tree/cmdln
> >
> 
> Looks very nice. I have a similar (but probably more basic) thing, too (just 
> one function: "prompt"):
> 
> http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/cmd/plain.d#L216
> 
> 
> // -- Basic string prompt --
> string input1 = prompt("Type some stuff: ");
> 
> // -- String prompt with validation --
> // (failureMsg is optional)
> string promptMsg = "Do you want 'coffee' or 'tea'? ";
> string failureMsg = "Please enter 'coffee' or 'tea', not '%s'";
> bool accept(string input)
> {
> return ["coffee", "tea"].contains(tolower(input));
> }
> 
> // This will *not* return until the user enters a valid choice,
> // so we don't need to do any more validation.
> string input2 = prompt(promptMsg, &accept, failureMsg);

Interesting the similarities. I do provide more specialized functions for some 
of those:

auto input2 = menu(promptMsg, ["coffee", "tea"]);

auto input = require!(string, accept)(promptMsg);

I haven't provide the option of displaying an error message, but it could go in 
the delegate you use in require. And I suppose prompt is a better name than 
userInput.

On thing I've been kind of interested in is getting something set up that would 
allow providing the needed information via a config, args, or at runtime. but 
haven't done anything with that idea.



Re: Just starting out

2011-10-13 Thread Trass3r
1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to  
use D2 so this seems to preclude Tango for now. Correct?


D1 is quite restricting. No struct ctors/dtors, compile-time introspection  
or TLS, etc.

I think using D2 is fine and it's making good progress.



Are there plans to merge or standardize on one of these? Phobos and Tango
seem to be incompatible with each other at this point.


Phobos is the standard library for D2.


2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64  
bit as our development platform. I'm assuming the gc is in all the D  
compilers.


DMD is the easiest compiler to use cause its frontend is always up-to-date  
and a precompiled package is available.
If you need real performance or platforms other than x86 you have to use  
GDC or LDC though.


They produce really good code comparable to C++ but you have to compile  
them yourself (which has been painless, at least for me).
btw, currently LDC is the only way to get LTO (though you still have to do  
it manually with the llvm tools).



3) DDT (eclipse plugin) seems relatively green. Any other suggestions  
for an IDE. Not a big deal for us, but it's nice to have source  
formatting. The DDT folks indicated that that feature is a long way off  
for them.


Descent was really good but unfortunately it's abandoned.
DDT has some nice features but lacks others.


Re: Just starting out

2011-10-13 Thread Kagamin
J Arrizza Wrote:

>  My worry here is if we choose the wrong underlying library we end up
> having to re-write a lot of code later on.

That depends on what you need from it.


Re: Just starting out

2011-10-13 Thread J Arrizza
Thanks for all the replies. Seems straightforward enough:

1) Phobos is it.
2) DMD is the clear winner
3) Eclipse is a hog - knew that. I really only like a couple of things in
it. A big one for me is the source formatting. For some reason, having to
hit the space bar 4,000 times every hour just isn't my cup of tea.

The formatter for java set a nice high standard for configurability that I
was hoping a D plug-in would also have. I had issues with installing descent
on Linux (worked ok in windows for some reason), but I'll give it another
shot on Indigo. If that doesn't play, I'll stick with UltraEdit (great
editor, got a life-time license for it).

John



On Wed, Oct 12, 2011 at 11:42 PM, Jacob Carlborg  wrote:

> On 2011-10-13 01:43, J Arrizza wrote:
>
>> Hi,
>>
>> I'm just starting out in D, read the book, tried a Hello World, and
>> wrote a few unit tests. I'm ready for the next step.
>>
>> I'd like to begin writing some more complex D code which I want to use
>> not only as a test bed to investigate D itself to a deeper level but if
>> it's successful to eventually use it as the beginnings of a toolkit for
>> our internal use.
>>
>> I'm looking for some recommendations from folks with lots of experience
>> in D:
>>
>> 1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to
>> use D2 so this seems to preclude Tango for now. Correct?
>>
>
> Most people will definitely say D2 and Phobos. I still think Tango is
> better and for the time being that means D1. I also think that some parts of
> D2 is not quite ready yet.
>
>
>  Are there plans to merge or standardize on one of these? Phobos and
>> Tango seem to be incompatible with each other at this point.
>>
>
> Yes, Tango and Phobos are incompatible. There are someone/a couple of
> people working on porting Tango to D2. I think that port will use druntime,
> meaning it will be compatible with Phobos.
>
>  My worry here is if we choose the wrong underlying library we end up
>> having to re-write a lot of code later on.
>>
>> 2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64
>> bit as our development platform. I'm assuming the gc is in all the D
>> compilers.
>>
>
> DMD is a good compiler for development. It's the fastest available D
> compiler (as far as I know). It's always up to date, LDC and GDC can be a
> release behind DMD. I don't know what's best for production. I usually hear
> people saying that LDC and GDC is better than DMD but I haven't done any
> benchmarking myself.
>
>
>  3) DDT (eclipse plugin) seems relatively green. Any other suggestions
>> for an IDE. Not a big deal for us, but it's nice to have source
>> formatting. The DDT folks indicated that that feature is a long way off
>> for them.
>>
>
> There's an older plugin for Eclipse called Descent. It has source
> formatting and a couple of more nice and interesting features, like compile
> time debugging. I also shows both syntax and semantic errors (semantic
> errors are disable by default). I still uses this plugin but I can be quite
> slow and unfortunate it's not maintained anymore. I still recommend you take
> a look at it.
>
> http://dsource.org/projects/**descent<http://dsource.org/projects/descent>
>
> Otherwise I use TextMate on Mac OS X. There's also a similar application
> called E (text editor) available on Windows (in the works for Linux too).
> It's compatible with TextMate's bundles.
>
>  Thanks,
>> John
>>
>>
>
> --
> /Jacob Carlborg
>



-- 
John
blog: http://arrizza.blogspot.com/
web: http://www.arrizza.com/


Re: Just starting out

2011-10-12 Thread Jacob Carlborg

On 2011-10-13 01:43, J Arrizza wrote:

Hi,

I'm just starting out in D, read the book, tried a Hello World, and
wrote a few unit tests. I'm ready for the next step.

I'd like to begin writing some more complex D code which I want to use
not only as a test bed to investigate D itself to a deeper level but if
it's successful to eventually use it as the beginnings of a toolkit for
our internal use.

I'm looking for some recommendations from folks with lots of experience
in D:

1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to
use D2 so this seems to preclude Tango for now. Correct?


Most people will definitely say D2 and Phobos. I still think Tango is 
better and for the time being that means D1. I also think that some 
parts of D2 is not quite ready yet.



Are there plans to merge or standardize on one of these? Phobos and
Tango seem to be incompatible with each other at this point.


Yes, Tango and Phobos are incompatible. There are someone/a couple of 
people working on porting Tango to D2. I think that port will use 
druntime, meaning it will be compatible with Phobos.



My worry here is if we choose the wrong underlying library we end up
having to re-write a lot of code later on.

2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64
bit as our development platform. I'm assuming the gc is in all the D
compilers.


DMD is a good compiler for development. It's the fastest available D 
compiler (as far as I know). It's always up to date, LDC and GDC can be 
a release behind DMD. I don't know what's best for production. I usually 
hear people saying that LDC and GDC is better than DMD but I haven't 
done any benchmarking myself.



3) DDT (eclipse plugin) seems relatively green. Any other suggestions
for an IDE. Not a big deal for us, but it's nice to have source
formatting. The DDT folks indicated that that feature is a long way off
for them.


There's an older plugin for Eclipse called Descent. It has source 
formatting and a couple of more nice and interesting features, like 
compile time debugging. I also shows both syntax and semantic errors 
(semantic errors are disable by default). I still uses this plugin but I 
can be quite slow and unfortunate it's not maintained anymore. I still 
recommend you take a look at it.


http://dsource.org/projects/descent

Otherwise I use TextMate on Mac OS X. There's also a similar application 
called E (text editor) available on Windows (in the works for Linux 
too). It's compatible with TextMate's bundles.



Thanks,
John




--
/Jacob Carlborg


Re: Just starting out

2011-10-12 Thread Nick Sabalausky
"Jesse Phillips"  wrote in message 
news:j75t0k$2q6m$3...@digitalmars.com...
>
> I created a cmdln library to help with user interaction, which some seem
> to like.
>
> https://github.com/he-the-great/JPDLibs/tree/cmdln
>

Looks very nice. I have a similar (but probably more basic) thing, too (just 
one function: "prompt"):

http://www.dsource.org/projects/semitwist/browser/trunk/src/semitwist/cmd/plain.d#L216


// -- Basic string prompt --
string input1 = prompt("Type some stuff: ");

// -- String prompt with validation --
// (failureMsg is optional)
string promptMsg = "Do you want 'coffee' or 'tea'? ";
string failureMsg = "Please enter 'coffee' or 'tea', not '%s'";
bool accept(string input)
{
return ["coffee", "tea"].contains(tolower(input));
}

// This will *not* return until the user enters a valid choice,
// so we don't need to do any more validation.
string input2 = prompt(promptMsg, &accept, failureMsg);





Re: Just starting out

2011-10-12 Thread Jesse Phillips
On Wed, 12 Oct 2011 16:43:41 -0700, J Arrizza wrote:

> Hi,
> 
> I'm just starting out in D, read the book, tried a Hello World, and
> wrote a few unit tests. I'm ready for the next step.

Great, hello 2.7? I hear it adds a --version option.

> I'd like to begin writing some more complex D code which I want to use
> not only as a test bed to investigate D itself to a deeper level but if
> it's successful to eventually use it as the beginnings of a toolkit for
> our internal use.

Personally I've used it internally for scripting, especially when needing 
to verify things. Its nice to use a compiled language for this, as you 
don't need an interpreter to use it and it isn't crap (batch).

I created a cmdln library to help with user interaction, which some seem 
to like.

https://github.com/he-the-great/JPDLibs/tree/cmdln

 
> I'm looking for some recommendations from folks with lots of experience
> in D:
> 
> 1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to
> use D2 so this seems to preclude Tango for now. Correct?

Well since you probably read TDPL, you'll likely find D1 restrictive, 
which eliminates Tango and Tangobos.

D2 will still require some maintenance as the compiler is updated. And 
sometimes in bigger chunks than others. There is a little better 
information on what will happen, but still not perfect so you'll have to 
keep an eye out.

www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel#StandardLibraryDevelopment
 
> Are there plans to merge or standardize on one of these? Phobos and
> Tango seem to be incompatible with each other at this point.

Someone started a port of Tango for D2, it completely done and I don't 
know how well the two would work together, but at least there shouldn't 
be an need to pull out the runtime.
 
> My worry here is if we choose the wrong underlying library we end up
> having to re-write a lot of code later on.

As said, D2 will require some maintenance as you update the compiler. 
Depending on what you need the library selection can be slimmer than D1, 
but it can also be better. A needed library is more likely to get created 
for D2 than D1. I chose D2.
 
> 2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64
> bit as our development platform. I'm assuming the gc is in all the D
> compilers.

I use dmd, it is pretty easy to install. But GDC is making headway to get 
into GCC, so that is damn awesome. My understanding is GDC is just as 
Usable a DMD.
 
> 3) DDT (eclipse plugin) seems relatively green. Any other suggestions
> for an IDE. Not a big deal for us, but it's nice to have source
> formatting. The DDT folks indicated that that feature is a long way off
> for them.

Derelict is not maintained anymore, but it was fairly feature rich. 
VisualD sounds really nice. Personally I use Vim.

> 
> Thanks,
> John Hi,

Important things I think one should understand are

* Ranges: These guy's are a major part of Phobos and are so nice to work 
with and create.

* Templates: D makes these so easy to use/create and understand. While 
not required they appear in documentation and are part of things like 
operator overloading.

* Template Constraints: Since you'll be calling a templated function, 
you'll want to understand the error message when it complains the 
template cannot be instantiated.

* Don't design around a cool feature: There are things I would stay away 
from while the community works some things out. Stick with what you know 
and slowly test the waters. I would avoid std.concurrency in my design 
since I don't really know how to and it hasn't had a good trial by those 
that do (or maybe it has and I don't know about).


Re: Just starting out

2011-10-12 Thread Nick Sabalausky
"J Arrizza"  wrote in message 
news:mailman.74.1318463031.24802.digitalmar...@puremagic.com...
>
> 1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to use 
> D2
> so this seems to preclude Tango for now. Correct?
>

Yes.

> Are there plans to merge or standardize on one of these?

Phobos *is* the std lib for D2. Period. It is never going away. The main 
reason Tango ever even happened in the first place was years ago back in the 
pre-D2 days, Phobos was still junk, and wasn't very open, so it didn't get 
much attention (so people came along and made Tango). But with D2, that's 
all changed.

> Phobos and Tango
> seem to be incompatible with each other at this point.
>

No. Only for D1. If Tango ever does end up going D2, it'll be usable 
side-by-side with Phobos (and it would *have* to be simply for the sake of 
it's own adoption.)

> My worry here is if we choose the wrong underlying library we end up 
> having
> to re-write a lot of code later on.
>

If you're going with D2, then there *isn't* any "choosing the wrong 
underlying library". It's Phobos. Period. And nobody who truly is 
knowledgeable about D is ever going to tell you otherwise.

The "Phobos vs Tango" matter is long since dead and buried for years, but 
the ghost of it still seems to haunt us.

> 2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64 
> bit
> as our development platform. I'm assuming the gc is in all the D 
> compilers.
>

The main choices are DMD, GDC and LDC. They all have their pros and cons.

Most people use DMD, DMD has the most support from D users, and DMD is 
always the most up-to-date (simply by virtue of being the official compiler 
where all the main D development happens). If in doubt, it's probably the 
best place to start.

Although I've never used them myself, I've heard that GDC and LDC are good, 
too, and that they've both gotten to the point where they're never far 
behind DMD.

If you think you might want to support Windows, forget LDC (at least for 
now). If you might want to target some CPU other than x86 and x64, then DMD 
is out. OTOH, If you think you might want to rebuild the compiler itself, it 
takes hours to build GCC (and, I assume, GDC as well), while it only takes 
minutes to build DMD (no idea how long it takes to build LDC).

> 3) DDT (eclipse plugin) seems relatively green. Any other suggestions for 
> an
> IDE. Not a big deal for us, but it's nice to have source formatting. The 
> DDT
> folks indicated that that feature is a long way off for them.
>

Eclipse is an enormous resource hog. Don't mean to be a total ass about it, 
but it's one of the biggest pieces of bloatware I've ever seen (YMMV). It's 
also *very* Java-centric. I know it supports many other languages but 
Eclipse really is still designed around Java, and the other langauges are 
just kind of crammed into that mold. If you do want to use Eclipse, an 
alternate to DDT is Descent. Descent is older and no longer maintained 
(AIUI), but last I heard it was still more advances and more mature than DDT 
(I don't know if thet's still true, though).

Personally, I like to use Programmer's Notepad 2. Lean, speedy, 
configurable, and supports all the basics like syntax highlighting, code 
folding, etc... Main downsides IMO are that it's Windows-only (That's going 
to be a real pain when I switch to Linux) and that, being based on 
Scintilla, there's no Elastic Tab(stop)s support.

Some people like Code::Blocks, too, and I used to use it a lot myself, but 
as of the last time I used it (~2-3 years ago) it wasn't quite as lean, 
clean or robust as PN2 (still worlds better than Eclipse, though).




Re: Just starting out

2011-10-12 Thread Sean Kelly
On Oct 12, 2011, at 4:43 PM, J Arrizza wrote:

> Hi,
> 
> I'm just starting out in D, read the book, tried a Hello World, and wrote a 
> few unit tests. I'm ready for the next step.
> 
> I'd like to begin writing some more complex D code which I want to use not 
> only as a test bed to investigate D itself to a deeper level but if it's 
> successful to eventually use it as the beginnings of a toolkit for our 
> internal use.
> 
> I'm looking for some recommendations from folks with lots of experience in D:
> 
> 1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to use D2 
> so this seems to preclude Tango for now. Correct?

Correct.  And Tangobos is just D1 Phobos modified to run on Tango, so it 
recluses that as well.


> Are there plans to merge or standardize on one of these? Phobos and Tango 
> seem to be incompatible with each other at this point. 

One reason Druntime was created as a standalone library was to allow 
compatibility with Tango.  It is effectively the Tango runtime (at the time of 
Druntime's creation) re-branded.  The idea was that for D2, both Phobos and 
Tango could run atop the same runtime library, thus eliminating the 
compatibility problem.  No D2 version of Tango was ever shipped however, so 
that idea never came to fruition.

> My worry here is if we choose the wrong underlying library we end up having 
> to re-write a lot of code later on.

If you're using D1 I suggest Tango.  If D2 then Phobos.  At this point I 
wouldn't start a new project on D1 with the intention of moving to D2 
eventually, as the divergence has really become too great to make the 
transition worthwhile.


> 2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64 bit 
> as our development platform. I'm assuming the gc is in all the D compilers.

DMD is obviously the popular choice, but GDC has gotten quite close recently in 
terms of language support and such.  I believe LDC is fairly close as well.  
The libraries are effectively the same for all three, so the choice is really 
among compilers only.


> 3) DDT (eclipse plugin) seems relatively green. Any other suggestions for an 
> IDE. Not a big deal for us, but it's nice to have source formatting. The DDT 
> folks indicated that that feature is a long way off for them.

I like both UltraEdit and SublimeText2.  SublimeText has support for D out of 
the box, while you'll have to plug it into UltraEdit.  Neither have much in the 
way of debugger support, though.

Just starting out

2011-10-12 Thread J Arrizza
Hi,

I'm just starting out in D, read the book, tried a Hello World, and wrote a
few unit tests. I'm ready for the next step.

I'd like to begin writing some more complex D code which I want to use not
only as a test bed to investigate D itself to a deeper level but if it's
successful to eventually use it as the beginnings of a toolkit for our
internal use.

I'm looking for some recommendations from folks with lots of experience in
D:

1) Which to use: Phobos, Tango, or Tangobos? It makes sense for us to use D2
so this seems to preclude Tango for now. Correct?

Are there plans to merge or standardize on one of these? Phobos and Tango
seem to be incompatible with each other at this point.

My worry here is if we choose the wrong underlying library we end up having
to re-write a lot of code later on.

2) Which compiler? DMD, GDC or something else?  We use Ubuntu 10.04, 64 bit
as our development platform. I'm assuming the gc is in all the D compilers.

3) DDT (eclipse plugin) seems relatively green. Any other suggestions for an
IDE. Not a big deal for us, but it's nice to have source formatting. The DDT
folks indicated that that feature is a long way off for them.

Thanks,
John