www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Multithreaded I/O in the DMD compiler (DDJ article by Walter)

reply Daniel Keep <daniel.keep.lists gmail.com> writes:
http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

  -- Daniel


P.S.  "It really seems barbaric in our digital age that we all have
motors and levers and gears and spinning things in our boxes."  Those
damned spinning things!
Apr 04 2009
next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Daniel Keep wrote:
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

Reddit too: http://www.reddit.com/r/programming/comments/8a2y9/walter_bright_multithreaded_io/
Apr 05 2009
prev sibling next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Daniel Keep:
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

Is this an improvement of the DMD backend? Now I'm curious: isn't DMD a legacy backend? If this is true, isn't improving it a waste of time, and time is better spent improving something like LLVM? (I am not trying to offend anyone here, I am just curious). Bye, bearophile
Apr 05 2009
next sibling parent reply dennis luehring <dl.soluz gmx.net> writes:
bearophile schrieb:
 Daniel Keep:
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

Is this an improvement of the DMD backend? Now I'm curious: isn't DMD a legacy backend? If this is true, isn't improving it a waste of time, and time is better spent improving something like LLVM? (I am not trying to offend anyone here, I am just curious). Bye, bearophile

i don't think that llvm is a good playground for walters ideas in backend and frontend development because he knows is backend very well (for many years now) - its bugs, sleeping features, way to compile and extend it llvm is still missing windows execptions and maybe many others things and it is more that 50% of the whole project (except the language itselfe) even the gcc-guys still mantain there own backend
Apr 05 2009
parent reply dennis luehring <dl.soluz gmx.net> writes:
dennis luehring schrieb:
 bearophile schrieb:
 Daniel Keep:
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

Is this an improvement of the DMD backend? Now I'm curious: isn't DMD a legacy backend? If this is true, isn't improving it a waste of time, and time is better spent improving something like LLVM? (I am not trying to offend anyone here, I am just curious).


bearophile ask yourself - would you throw away your own backend? and not to extend you backend and work on llvm is like throwing it away
Apr 05 2009
parent dennis luehring <dl.soluz gmx.net> writes:
dennis luehring schrieb:
 dennis luehring schrieb:
 bearophile schrieb:
 Daniel Keep:
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

Is this an improvement of the DMD backend? Now I'm curious: isn't DMD a legacy backend? If this is true, isn't improving it a waste of time, and time is better spent improving something like LLVM? (I am not trying to offend anyone here, I am just curious).


bearophile ask yourself - would you throw away your own backend? and not to extend you backend and work on llvm is like throwing it away

that does not mean that i don't want to see an llvm based backend - it seems to be a very good and fast "compiler"
Apr 05 2009
prev sibling next sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
bearophile wrote:
 Daniel Keep:
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29

Is this an improvement of the DMD backend? Now I'm curious: isn't DMD a legacy backend? If this is true, isn't improving it a waste of time, and time is better spent improving something like LLVM? (I am not trying to offend anyone here, I am just curious). Bye, bearophile

DMD still produces better integer code (on x86) than GDC or LLVMDC. And it's fast at generating code. So "legacy" as it may be, it still has some strengths.
Apr 05 2009
prev sibling parent Walter Bright <newshound1 digitalmars.com> writes:
bearophile wrote:
 Is this an improvement of the DMD backend? Now I'm curious: isn't DMD
 a legacy backend? If this is true, isn't improving it a waste of
 time, and time is better spent improving something like LLVM? (I am
 not trying to offend anyone here, I am just curious).

Those changes were to the front end.
Apr 05 2009
prev sibling next sibling parent reply BCS <none anon.com> writes:
Hello Daniel,

 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreade
 d-I-O.html&Itemid=29
 
 -- Daniel
 
 P.S.  "It really seems barbaric in our digital age that we all have
 motors and levers and gears and spinning things in our boxes."  Those
 damned spinning things!
 

Some sort of fixed size thread pool might work better than thread-per-file after the files are loaded as the overhead of threads isn't going to do you any good if you have many more threads than you have cores
Apr 05 2009
parent reply Robert Fraser <fraserofthenight gmail.com> writes:
Brad Roberts wrote:
 BCS wrote:
 Hello Daniel,

 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreade
 d-I-O.html&Itemid=29

 -- Daniel

 P.S.  "It really seems barbaric in our digital age that we all have
 motors and levers and gears and spinning things in our boxes."  Those
 damned spinning things!

thread-per-file after the files are loaded as the overhead of threads isn't going to do you any good if you have many more threads than you have cores

Careful.. that rule of thumb applies to compute bound use of threads. In this example, it's parallelization to achieve file io activity overlapping with compute activity. If we were talking about physical disks, I'd say that one thread dedicated to "while(filetoread) open/read/close" would be sufficient. Two would just add competing seeks. But the picture likely changes once the files are in page cache. And SSD's are closer to memory than spindles, so it's unclear what the 'right' threading model there is too. Regardless, with the model of most compilers today, as long as the data is ready by the time the main thread is ready for it, it's good enough. It's fun to envision a really seriously multi-threaded compiler, but, like for any app, it requires a lot more care.. and dmd would need some cleanup to not use global state, but not a whole lot from the quick glances I've made at the source. The devil, as always, is in the details. There's enough to do and enough bugs to fix already that I can't see it as worth the investment right now, though. Later, Brad

Compilers seem like they'd be easier to parallelize than other applications... but I think the last version of DSSS launches as many DMD processes as there are cores anyway.
Apr 05 2009
parent bearophile <bearophileHUGS lycos.com> writes:
Robert Fraser:
 Compilers seem like they'd be easier to parallelize than other 
 applications...

Because compilers are (almost) pure functions :-) This is less silly than it sounds. Bye, bearophile
Apr 05 2009
prev sibling next sibling parent reply Brad Roberts <braddr puremagic.com> writes:
BCS wrote:
 Hello Daniel,
 
 http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreade
 d-I-O.html&Itemid=29

 -- Daniel

 P.S.  "It really seems barbaric in our digital age that we all have
 motors and levers and gears and spinning things in our boxes."  Those
 damned spinning things!

Some sort of fixed size thread pool might work better than thread-per-file after the files are loaded as the overhead of threads isn't going to do you any good if you have many more threads than you have cores

Careful.. that rule of thumb applies to compute bound use of threads. In this example, it's parallelization to achieve file io activity overlapping with compute activity. If we were talking about physical disks, I'd say that one thread dedicated to "while(filetoread) open/read/close" would be sufficient. Two would just add competing seeks. But the picture likely changes once the files are in page cache. And SSD's are closer to memory than spindles, so it's unclear what the 'right' threading model there is too. Regardless, with the model of most compilers today, as long as the data is ready by the time the main thread is ready for it, it's good enough. It's fun to envision a really seriously multi-threaded compiler, but, like for any app, it requires a lot more care.. and dmd would need some cleanup to not use global state, but not a whole lot from the quick glances I've made at the source. The devil, as always, is in the details. There's enough to do and enough bugs to fix already that I can't see it as worth the investment right now, though. Later, Brad
Apr 05 2009
next sibling parent BCS <none anon.com> writes:
Hello Brad,

 Careful.. that rule of thumb applies to compute bound use of threads.

I did qualify that as "after the files are loaded".
Apr 05 2009
prev sibling parent Brad Roberts <braddr puremagic.com> writes:
BCS wrote:
 Hello Brad,
 
 Careful.. that rule of thumb applies to compute bound use of threads.

I did qualify that as "after the files are loaded".

In the current impl, after files are loaded, it's all one thread still. :)
Apr 05 2009
prev sibling next sibling parent reply "Saaa" <empty needmail.com> writes:
I always thought people who would need to reinstall their windows to keep it 
clean were like the ones that didn't know how computers works.
I haven't reinstalled my windows box in like 6 years and it doesn't startup 
any slower then before.
If only you keep to the simple things like: ccleaner, autoruns, program 
control (online armor) and noscript for firefox you should be able to keep 
it clean.
The only thing I can't really be sure of are rootkits and alike but icesword 
and online scans at least give me the impression it is also ok on that part.
btw. adware normaly doesn't really make your box start up any slower 
Apr 06 2009
next sibling parent "Saaa" <empty needmail.com> writes:
Also, microsoft bootvis. 
Apr 06 2009
prev sibling next sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Saaa wrote:
 I always thought people who would need to reinstall their windows to keep it 
 clean were like the ones that didn't know how computers works.
 I haven't reinstalled my windows box in like 6 years and it doesn't startup 
 any slower then before.
 If only you keep to the simple things like: ccleaner, autoruns, program 
 control (online armor) and noscript for firefox you should be able to keep 
 it clean.
 The only thing I can't really be sure of are rootkits and alike but icesword 
 and online scans at least give me the impression it is also ok on that part.
 btw. adware normaly doesn't really make your box start up any slower 

Wow, that seems like a lot of work.
Apr 06 2009
next sibling parent reply dsimcha <dsimcha yahoo.com> writes:
== Quote from Jarrett Billingsley (jarrett.billingsley gmail.com)'s article
 On Mon, Apr 6, 2009 at 11:07 AM, Christopher Wright <dhasenan gmail.com> wrote:
 Saaa wrote:
 I always thought people who would need to reinstall their windows to keep
 it clean were like the ones that didn't know how computers works.
 I haven't reinstalled my windows box in like 6 years and it doesn't
 startup any slower then before.
 If only you keep to the simple things like: ccleaner, autoruns, program
 control (online armor) and noscript for firefox you should be able to keep
 it clean.
 The only thing I can't really be sure of are rootkits and alike but
 icesword and online scans at least give me the impression it is also ok on
 that part.
 btw. adware normaly doesn't really make your box start up any slower

Wow, that seems like a lot of work.

You _don't go to dangerous websites or download screensavers like the thousands of twits who don't understand computers or malware_. I got my first virus in ten years of using Windows last December, and I don't have anything but a basic virus scanner. It got in through an ad that took advantage of Acrobat Reader. Before that, I was running an install of XP that hadn't been modified for close to four years, which had run in two different computers. My laptop is coming up on its four year mark as well. Surprising, no? That when you know how to use computers, Windows _doesn't actually suck_!

Yeah, I've always wondered why some people put so much emphasis on the 10% of computer security that's highly technical in nature when 90% of the problem of computer security is between the keyboard and the chair.
Apr 06 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 3:31 PM, dsimcha <dsimcha yahoo.com> wrote:
 Yeah, I've always wondered why some people put so much emphasis on the 10% of
 computer security that's highly technical in nature when 90% of the problem of
 computer security is between the keyboard and the chair.

ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my computer? Jarrett: What's it doing? CIF: It's popping up all sorts of dialog boxes telling me I need to get Spyware Aweseom Remover and stuff, and it's running really slow, and my files keep disappearing. Jarrett: And where have you been on the internet? CIF: Oh you know, normal sites. Jarrett: Like? CIF: Porn, more porn, horse porn, warez. I also used Limewire to download *every song and program ever made*, and I make it a habit to click on interesting-looking [read: violently-flashing] ads. Jarrett: ... CIF: What? Did I do something wrong? Seriously. It's like sleeping with every prostitute on the East Coast and acting surprised when you have seventeen STDs.

I think this is a large exaggeration. People of all walks of life are exposed to dangers when using a Windows machine. My father-in-law knows virtually (no, literally) nothing about computers, but I taught him enough to double-click an icon on the desktop to read the news off a reputable site. He virused the computer without typing (he has no notion of address bar etc.). So I moved him to an ubuntu box. Whenever the endless debate of windows vs. linux vs. mac comes up, I repeat my comment: if you are a programmer, you better acquire some experience in each. For Windows/Mac it's not as easy because they may cost money, but now with virtual machines, good distributions etc. I think there is no excuse for a programmer to not seriously looking into Unix. Andrei
Apr 06 2009
next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from Andrei Alexandrescu (SeeWebsiteForEmail erdani.org)'s article
 Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 3:31 PM, dsimcha <dsimcha yahoo.com> wrote:
 Yeah, I've always wondered why some people put so much emphasis on the 10% of
 computer security that's highly technical in nature when 90% of the problem of
 computer security is between the keyboard and the chair.

ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my computer? Jarrett: What's it doing? CIF: It's popping up all sorts of dialog boxes telling me I need to get Spyware Aweseom Remover and stuff, and it's running really slow, and my files keep disappearing. Jarrett: And where have you been on the internet? CIF: Oh you know, normal sites. Jarrett: Like? CIF: Porn, more porn, horse porn, warez. I also used Limewire to download *every song and program ever made*, and I make it a habit to click on interesting-looking [read: violently-flashing] ads. Jarrett: ... CIF: What? Did I do something wrong? Seriously. It's like sleeping with every prostitute on the East Coast and acting surprised when you have seventeen STDs.

exposed to dangers when using a Windows machine.

I followed a link in Firefox on Windows not too long ago, and the simple act of doing so installed a trojan on my computer. I was unable to get rid of it manually so I downloaded a trial copy of Norton AntiVirus and in the process of trying to get rid of the trojan, NAV killed my PC... completely. I was still able to boot it, but login was impossible, as was every attempt to rebuild from the recovery console. Fortunately, I had network shares for most of my important data and I siphoned it all onto a Mac. My Windows machine is now used exclusively for playing games. I have no intention of ever using Windows for anything else again. Games are the only thing the other OSes lack compared to Windows anyway.
 Whenever the endless debate of windows vs. linux vs. mac comes up, I
 repeat my comment: if you are a programmer, you better acquire some
 experience in each. For Windows/Mac it's not as easy because they may
 cost money, but now with virtual machines, good distributions etc. I
 think there is no excuse for a programmer to not seriously looking into
 Unix.

I desperately wish my computer-illiterate family members would move off of Windows as well, since it would eliminate basically every tech- support call I field from them. Perhaps I've simply had good luck with other OSes, but Windows is the only one I've had regular problems with. As for programming specifically... I made a deliberate shift away from Windows years ago because it's a nightmare to develop for (aside from Visual Studio, which is a great debugging environment). Best move I ever made.
Apr 06 2009
next sibling parent "Saaa" <empty needmail.com> writes:
 I desperately wish my computer-illiterate family members would move
 off of Windows as well, since it would eliminate basically every tech-
 support call I field from them.  Perhaps I've simply had good luck with
 other OSes, but Windows is the only one I've had regular problems with.

drivers/Office .. in ubuntu etc.' I'd wish I switched years ago and had the years of experience with linux. But then again, I develop games ;)
Apr 06 2009
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Sean Kelly wrote:
 As for programming specifically... I made a deliberate shift away from
 Windows years ago because it's a nightmare to develop for (aside from
 Visual Studio, which is a great debugging environment).  Best move I
 ever made.

Yah, I too remember my Windows-only days the way I'd remember a temporary disability. (I recall to this day: any little thing I wanted to do, I'd start off a wizard in Dev Studio. It was kind of a surprise for me to find out that all those programs had been written, along with plenty more.) Being a user is one thing, but I think a programmer who only does Windows is seriously impaired. Andrei
Apr 06 2009
parent reply "Saaa" <empty needmail.com> writes:
 Yah, I too remember my Windows-only days the way I'd remember a temporary 
 disability. (I recall to this day: any little thing I wanted to do, I'd 
 start off a wizard in Dev Studio. It was kind of a surprise for me to find 
 out that all those programs had been written, along with plenty more.) 
 Being a user is one thing, but I think a programmer who only does Windows 
 is seriously impaired.

 Andrei

Could you please convince me to add a Linux install again. I'd rather use open source than a commercial os, but until now I don't know what I am missing.
Apr 06 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Saaa wrote:
 Yah, I too remember my Windows-only days the way I'd remember a temporary 
 disability. (I recall to this day: any little thing I wanted to do, I'd 
 start off a wizard in Dev Studio. It was kind of a surprise for me to find 
 out that all those programs had been written, along with plenty more.) 
 Being a user is one thing, but I think a programmer who only does Windows 
 is seriously impaired.

 Andrei

Could you please convince me to add a Linux install again. I'd rather use open source than a commercial os, but until now I don't know what I am missing.

It's not my place to tackle this kind of challenge. Plenty of essays, articles, and entire books have been written about the subject of OS culture and such. Unfortunately, I noticed that that kind of preaching mostly works for the choir and does little to budge anyone in any direction. Said literature reinforces what those in the know already understand, and leaves most others nonplussed. It's a complex phenomenon. If I were to quickly give the most significant bit of my opinion, that would be this: Unix is for programmers and Windows is for end users. As such, even though both ultimately accomplish the task of putting a computer's resources at your disposal, their foci are different. You're a programmer. So the notion that there is an operating system catering to your needs may warrant a closer look. Also - for me at least, learning Unix as an occasional activity (e.g. cygwin, the occasional ssh, trying a couple of things) has had very little value. Didn't work for me in the least. I remember how I installed cygwin for the first time and started it. It was very exciting - I could try Unix in a sandbox! So I started cygwin.bat and there it was - one black window with a "% " prompt. I knew only ls and pwd, so I ran those, and then closed the box. Unix wasn't telling me anything. I had to complete a sizable task before I felt I'd started to get the point. Andrei
Apr 06 2009
next sibling parent reply "Saaa" <empty needmail.com> writes:
 Also - for me at least, learning Unix as an occasional activity (e.g. 
 cygwin, the occasional ssh, trying a couple of things) has had very little 
 value. Didn't work for me in the least. I remember how I installed cygwin 
 for the first time and started it. It was very exciting - I could try Unix 
 in a sandbox! So I started cygwin.bat and there it was - one black window 
 with a "% " prompt. I knew only ls and pwd, so I ran those, and then 
 closed the box. Unix wasn't telling me anything.

 I had to complete a sizable task before I felt I'd started to get the 
 point.

If I were to switch right now it would take me a few days to install all the programs. Most programs I use are open source anyways, so that wouldn't be a problem. Even my old Photoshop is gold or so in wine. But then I would just have a slightly crippled windows box (less games, cs4 and office are garbage on ubuntu). When would I start using things that aren't on windows?
Apr 06 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Saaa wrote:
 Also - for me at least, learning Unix as an occasional activity (e.g. 
 cygwin, the occasional ssh, trying a couple of things) has had very little 
 value. Didn't work for me in the least. I remember how I installed cygwin 
 for the first time and started it. It was very exciting - I could try Unix 
 in a sandbox! So I started cygwin.bat and there it was - one black window 
 with a "% " prompt. I knew only ls and pwd, so I ran those, and then 
 closed the box. Unix wasn't telling me anything.

 I had to complete a sizable task before I felt I'd started to get the 
 point.

If I were to switch right now it would take me a few days to install all the programs. Most programs I use are open source anyways, so that wouldn't be a problem. Even my old Photoshop is gold or so in wine. But then I would just have a slightly crippled windows box (less games, cs4 and office are garbage on ubuntu). When would I start using things that aren't on windows?

When you'd be writing computer programs. Andrei
Apr 06 2009
parent reply "Saaa" <empty needmail.com> writes:
 When you'd be writing computer programs.

But that would go like this: install eclipse, check how to compile under Linux and start programming.
Apr 06 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Saaa wrote:
 When you'd be writing computer programs.

But that would go like this: install eclipse, check how to compile under Linux and start programming.

Nope :o). When you'll figure why not, that's where the fun starts. I'm sure you know about the phenomenon "writing Fortran in C" etc. Installing eclipse and starting programming as you would under windows would be a moral equivalent. (Not that I would advise against using eclipse, which I also like.) Andrei
Apr 06 2009
parent reply "Saaa" <empty needmail.com> writes:
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
news:grduhp$1rk0$1 digitalmars.com...
 Saaa wrote:
 When you'd be writing computer programs.

But that would go like this: install eclipse, check how to compile under Linux and start programming.

Nope :o). When you'll figure why not, that's where the fun starts. I'm sure you know about the phenomenon "writing Fortran in C" etc. Installing eclipse and starting programming as you would under windows would be a moral equivalent. (Not that I would advise against using eclipse, which I also like.) Andrei

Then, how should I start, or: where do I learn how I should start? :D
Apr 06 2009
next sibling parent reply Jason House <jason.james.house gmail.com> writes:
Saaa Wrote:

 
 "Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
 news:grduhp$1rk0$1 digitalmars.com...
 Saaa wrote:
 When you'd be writing computer programs.

But that would go like this: install eclipse, check how to compile under Linux and start programming.

Nope :o). When you'll figure why not, that's where the fun starts. I'm sure you know about the phenomenon "writing Fortran in C" etc. Installing eclipse and starting programming as you would under windows would be a moral equivalent. (Not that I would advise against using eclipse, which I also like.) Andrei

Then, how should I start, or: where do I learn how I should start? :D

That's a really tough question. To use unix effectively requires relearning a lot of things. You have to relearn how to do little things, usually without a mouse, and then start putting it all together. For example, as an emacs user, I can easilly program for an hour without touching my mouse. The problem with GUI interfaces is that common things are easy and uncommon things are impossible. One unix tool you will use over and over again is grep. As a commandline utility, it can be combined with other stuff such as ls, sort, grep, sed, awk, etc... I don't know if I'd start there though...
Apr 06 2009
next sibling parent dsimcha <dsimcha yahoo.com> writes:
== Quote from Jason House (jason.james.house gmail.com)'s article
 The problem with GUI interfaces is that common things are easy and uncommon

a commandline utility, it can be combined with other stuff such as ls, sort, grep, sed, awk, etc... I don't know if I'd start there though... Yes, but often the command line tool has so many switches and tries to be so general and is such a PITA to use that it may as well be its own little programming language. (See inner platform effect.) At that point, for anything non-trivial (i.e. far beyond the default use of said tool), I'd rather just write a small, quick and dirty program in a general-purpose programming language and standard library that I already know than learn the intricacies of these command line tools.
Apr 06 2009
prev sibling parent reply Jussi Jumppanen <jussij zeusedit.com> writes:
Jason House Wrote:

 For example, as an emacs user, I can easilly program for an hour 
 without touching my mouse. 

I would say 'not using the mouse' is clear sign the programmer is coding using a programmer's editor and not a modern day IDE. I would also say many Windows programmers are completely lost without their IDE, and this can makes them less productive as a developer. They could make themselves better programmers by overcoming their addiction to the IDE. http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html But programming on Windows without a mouse driven, language specific IDE, using nothing but the command line and a good editor is possible and really quite easy to do.
 As a commandline utility, it can be combined with other stuff such 
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there 
 though...

Replace ls with dir, download the Win32 version of grep, sed, awk and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.
Apr 06 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Jussi Jumppanen wrote:
 Jason House Wrote:
 
 For example, as an emacs user, I can easilly program for an hour 
 without touching my mouse. 

I would say 'not using the mouse' is clear sign the programmer is coding using a programmer's editor and not a modern day IDE. I would also say many Windows programmers are completely lost without their IDE, and this can makes them less productive as a developer. They could make themselves better programmers by overcoming their addiction to the IDE. http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html But programming on Windows without a mouse driven, language specific IDE, using nothing but the command line and a good editor is possible and really quite easy to do.
 As a commandline utility, it can be combined with other stuff such 
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there 
 though...

Replace ls with dir, download the Win32 version of grep, sed, awk and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

But all else is lacking, starting with a good shell. I guess it's possible with cygwin et al, but then it feels a bit artificial and second-hand. Andrei
Apr 06 2009
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Denis Koroskin wrote:
 On Tue, 07 Apr 2009 04:41:39 +0400, Andrei Alexandrescu 
 <SeeWebsiteForEmail erdani.org> wrote:
 
 Jussi Jumppanen wrote:
 Jason House Wrote:

 For example, as an emacs user, I can easilly program for an hour 
 without touching my mouse.

coding using a programmer's editor and not a modern day IDE. I would also say many Windows programmers are completely lost without their IDE, and this can makes them less productive as a developer. They could make themselves better programmers by overcoming their addiction to the IDE. http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html But programming on Windows without a mouse driven, language specific IDE, using nothing but the command line and a good editor is possible and really quite easy to do.

 As a commandline utility, it can be combined with other stuff such 
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there 
 though...

and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

But all else is lacking, starting with a good shell. I guess it's possible with cygwin et al, but then it feels a bit artificial and second-hand. Andrei

There is FAR, which is an amazing tool. Properly configured, it can do everything you will ever need. An it's Open-Source, too!

I remember having used FAR back in the day... it was fun. But then I feel there's a disconnect somewhere in the dialog. Will, for example, FAR take a text file, create a dictionary with its words, assign a unique number to each word in decreasing order of frequency, and output a file with each word replaced with its number? Andrei
Apr 06 2009
prev sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Bill Baxter wrote:
 Link?  Google gave me this: http://www.helpware.net/FAR/  which
 doesn't seem to be what you are talking about.

http://www.farmanager.com/ Andrei
Apr 06 2009
prev sibling next sibling parent reply Jason House <jason.james.house gmail.com> writes:
Jussi Jumppanen wrote:

 Jason House Wrote:
 
 For example, as an emacs user, I can easilly program for an hour
 without touching my mouse.

I would say 'not using the mouse' is clear sign the programmer is coding using a programmer's editor and not a modern day IDE.

That's true, but that really wasn't the point... I was more trying to make a point about how different some things can be.
 I would also say many Windows programmers are completely lost
 without their IDE, and this can makes them less productive as a
 developer.

As Andrei said, it's likely to take a lot of use to get back to prior productivity levels... It takes a lot of work to shift to unix and be comfortable. I'm not really sure what makes Andrei think unix is so much better for productivity :) Maybe it's something along the lines of learning a new programming language in order to expand your programming skill set...
 They could make themselves better programmers by overcoming their
 addiction to the IDE.
 
   http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html
 
 But programming on Windows without a mouse driven, language specific
 IDE, using nothing but the command line and a good editor is possible
 and really quite easy to do.
 
 As a commandline utility, it can be combined with other stuff such
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there
 though...

Replace ls with dir, download the Win32 version of grep, sed, awk and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

When on windows, that's exactly what I do. After having used them enough, I can't live without them. It's a real shame that my current job tries to provide a unified framework and completely destroyed all utility of the command line. I'm not allowed to download cygwin. ugh...
Apr 06 2009
parent superdan <super dan.org> writes:
http://artlung.com/smorgasborg/C_R_Y_P_T_O_N_O_M_I_C_O_N.shtml

oldie but goldie. 

my take. cygwin on windoze == fuckin' with two condoms.
Apr 06 2009
prev sibling next sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Jussi Jumppanen wrote:
 Replace ls with dir, download the Win32 version of grep, sed, awk 
 and you can run all those tools just fine from the Windows command 
 line, or from within any decent editor.
 
 You don't have to go to Unix to find the command line.

The Windows terminal emulator sucks. This is not subject to debate. I have never seen a terminal emulator that is worse, and I have never seen one that was only slightly better. There is little incentive in Windows to make commandline utilities. If you are using the command line to a significant degree in Windows, you are either going to use [possibly incomplete] ports of Unix utilities or Cygwin. If you go through the trouble of finding each of these utilities individually, whether ports or written specifically for Windows, you are wasting time on a solved problem. A default install of Cygwin or any Unix will include these utilities. Cygwin qualifies as Unix, but it has not been a painless, seamless experience for me. It's far easier for me to work under Linux than with Cygwin. If you need to use the command line, you really should use Unix, if it's reasonable. The Windows filesystem structure is a source of pain, and it's hard to work around. It's hard to get information about interacting with the OS from the command line. Windows and Cygwin just isn't that great a fit.
Apr 06 2009
next sibling parent Rainer Deyke <rainerd eldwood.com> writes:
Christopher Wright wrote:
 If you need to use the command line, you really should use Unix, if it's
 reasonable. The Windows filesystem structure is a source of pain, and
 it's hard to work around. It's hard to get information about interacting
 with the OS from the command line. Windows and Cygwin just isn't that
 great a fit.

I have both Linux and OS X readily available, but I still end up using the Windows command line (without cygwin) most of the time. I won't deny that the Unix-like systems have some nice utilities, but in my day-to-day activities, cmd.exe, Python, and my collection of custom utilities are all I need. -- Rainer Deyke - rainerd eldwood.com
Apr 06 2009
prev sibling next sibling parent Christopher Wright <dhasenan gmail.com> writes:
Adam D. Ruppe wrote:
 On Mon, Apr 06, 2009 at 10:29:57PM -0400, Christopher Wright wrote:
 The Windows terminal emulator sucks. This is not subject to debate.

What terminal emulator? This might be a bit of a nitpick, but Windows doesn't try to emulate a terminal (not in the OS anyway; there are hundreds of third party programs to do such) and it is better off for it.

Yes, that is a nitpick. By "terminal emulator" I mean the GUI program housing the command interpreter.
 Have you ever pressed delete and just got a ~? Pressed home and got a ~[B
 (or whatever the hell it is)? 

The defaults are set up so that you don't get this issue. The exception is when you are logging in on a virtual terminal -- you don't have a shell yet. Fixing this on the rare occasions that it happened (which pretty much only involved using cygwin) was quick and straightforward.
 Tried to use a program with color after
 changing the background color of your window? 

First, very few programs use color. Second, it's rare to change the background color of your window. Third, it's always worked perfectly for me on the rare occasions in which I have done so.
 Resized a window and had
 your text cut off?

No.
 Go up through your history and get corrupted lines?

No.
 The Unix terminal system is barely usable - NOT something anyone should ever
 try to emulate.
 
 The Windows console, on the other hand, is a lot better, though still has its
 warts. At least it is predictable though.

Just speaking of the GUI, there's no competition. Windows sucks.
Apr 06 2009
prev sibling next sibling parent =?UTF-8?B?QWxleGFuZGVyIFDDoW5law==?= writes:
Adam D. Ruppe wrote:
 On Mon, Apr 06, 2009 at 10:29:57PM -0400, Christopher Wright wrote:
 The Windows terminal emulator sucks. This is not subject to debate.

What terminal emulator? This might be a bit of a nitpick, but Windows doesn't try to emulate a terminal (not in the OS anyway; there are hundreds of third party programs to do such) and it is better off for it. Unix hurls chunks for the actual terminal system. The programs are pretty decent, but the terminal itself - TERRIBLE. Tried to write an interactive program that makes full use of the keyboard and mouse? You can't get the shift key's state. It is a whole todo just to get the arrow keys. You can't depend on the escape key. You can't output data and expect it to be reliable (you have to depend on an environment variable to figure out what you're writing to and it often isn't accurate!) It gets worse as a user. Have you ever pressed delete and just got a ~? Pressed home and got a ~[B (or whatever the hell it is)? Tried to use a program with color after changing the background color of your window? Resized a window and had your text cut off? Go up through your history and get corrupted lines? The Unix terminal system is barely usable - NOT something anyone should ever try to emulate. The Windows console, on the other hand, is a lot better, though still has its warts. At least it is predictable though.

I am sincerely puzzled. Do you know vim? It's a console program. It sports all of what you're describing as impossible (ncurses says hi!). Have you ever tried to resize your cmd.exe window on Windows? It's funny since you can only really resize its height with the mouse. Have you ever tried to copy & paste multiple lines *not* as x*y block of characters including whitespace (aka hardcopy), but as multiple lines of text as you would expect it, even though a few might be wrapped? Good luck on that. Tried pasting? Tried... using a proper editor inside cmd.exe? Screen? dvtm? An IRC client? A mail client? Proper tab completion of segments of your argument, not the whole argument? cmd.exe is a severe pain in the ass compared to ANY terminal emulator you would find on any Unix. Even xterm on any Linux or Terminal on OS X work way better. Kind regards, Alex P.S.: No offense intended, I'm just really puzzled. Srsly.
Apr 07 2009
prev sibling next sibling parent reply Yigal Chripun <yigal100 gmail.com> writes:
On 07/04/2009 05:29, Christopher Wright wrote:
 Jussi Jumppanen wrote:
 Replace ls with dir, download the Win32 version of grep, sed, awk and
 you can run all those tools just fine from the Windows command line,
 or from within any decent editor.

 You don't have to go to Unix to find the command line.

The Windows terminal emulator sucks. This is not subject to debate. I have never seen a terminal emulator that is worse, and I have never seen one that was only slightly better. There is little incentive in Windows to make commandline utilities. If you are using the command line to a significant degree in Windows, you are either going to use [possibly incomplete] ports of Unix utilities or Cygwin. If you go through the trouble of finding each of these utilities individually, whether ports or written specifically for Windows, you are wasting time on a solved problem. A default install of Cygwin or any Unix will include these utilities. Cygwin qualifies as Unix, but it has not been a painless, seamless experience for me. It's far easier for me to work under Linux than with Cygwin. If you need to use the command line, you really should use Unix, if it's reasonable. The Windows filesystem structure is a source of pain, and it's hard to work around. It's hard to get information about interacting with the OS from the command line. Windows and Cygwin just isn't that great a fit.

ever heard of powershell? it is in fact a superior design for a shell compared to most unix shells. also, have you ever heard of rush? http://rush.heroku.com/
Apr 07 2009
next sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Yigal Chripun wrote:
 ever heard of powershell? it is in fact a superior design for a shell 
 compared to most unix shells.

I have tried it briefly. Too briefly to give a good analysis of it. The GUI is better than that of cmd.exe, but not anywhere near as good as, say, GNOME Terminal. (It's still fixed width, as I recall; just wider by default.) Another issue is integrating it with existing utilities.
 also, have you ever heard of rush? http://rush.heroku.com/

It's an interesting concept. I think I'll try it out. But it has nothing to do with GUIs for housing shells.
Apr 07 2009
next sibling parent Jussi Jumppanen <jussij zeusedit.com> writes:
Christopher Wright Wrote:

 The GUI is better than that of cmd.exe, but not anywhere near 
 as good as, say, GNOME Terminal. (It's still fixed width, as 
 I recall; just wider by default.)

The cmd.exe terminal window can be resized. With the cmd.exe window visible click on the icon in the top left corner and bring up the Properties window. Select the Layout panel and change the terminal size to what ever width/height combination required and save the changes against the title of the console window. From then on all new console windows with that title will take on those attributes. On a new machine this is usually on of the first things I do, since the default properties are pretty poor.
Apr 07 2009
prev sibling parent reply Yigal Chripun <yigal100 gmail.com> writes:
On 08/04/2009 02:48, Christopher Wright wrote:
 Yigal Chripun wrote:
 ever heard of powershell? it is in fact a superior design for a shell
 compared to most unix shells.

I have tried it briefly. Too briefly to give a good analysis of it. The GUI is better than that of cmd.exe, but not anywhere near as good as, say, GNOME Terminal. (It's still fixed width, as I recall; just wider by default.) Another issue is integrating it with existing utilities.
 also, have you ever heard of rush? http://rush.heroku.com/

It's an interesting concept. I think I'll try it out. But it has nothing to do with GUIs for housing shells.

both options above are shells not terminals. in fact powershell just runs inside a cmd.exe window. both shells are orders of magnitude better than unix standard shells and of course bat files. btw, windows admins use different tools than BAT files for scripting windows - based on VB/js up until XP. now the MS recommended way is powershell. windows as an infrastructure of WMI _objects_ (as opposed to UNIX files) that provide everything you need to manage windows with scripting. Windows has a different design than Unix's "everything is a file" which IMO is a stupid legacy design from the 70's. therefore, trying to do the unix way on windows with BAT files is simply the wrong way. it doesn't work because it is not designed to work like that. my take on all this, I'm not a huge fan of windows and it sure has its own problems, but this specific aspect is done much better than UNIX and all those comments about "windows doesn't support unix's "everything is a file" design and therefore it's crap" just show a lot of ignorance. btw, if you want a different _terminal_ for windows, check out console2 and also the next version of powershell (beta) has a new graphical terminal (iirc, written from scratch with C#)
Apr 08 2009
next sibling parent reply Yigal Chripun <yigal100 gmail.com> writes:
On 08/04/2009 14:34, Steven Schveighoffer wrote:

 My experience with WMI is that it is buggy and very slow, not to mention
 really complicated. I would hate to rely on it for scripting. On the
 other hand, having everything as a file allows me to use all existing
 file processing tools to deal with anything on a UNIX system. The file
 API is simple and doesn't require me to look at an object spec to do
 simple tasks.

well, WMI is supposed to be replaced and enhanced by powershell. So you should check that out. I agree that a uniform and consistent API is important and I'm sure that MS managed to mess that up :) but that's besides the point. "Everything is a file" does not provide a uniform API but rather provides no API. Each unix tool has its own mini-syntax and its own set of command-line arguments and you need to learn how to use each tool separately beyond trivial use cases. At my work, we program in a *nix environment (Solaris) and I also use Linux extensively So I know my way on *nix systems but I simply cannot remember all the different argument for each util. every time I need to find a file I need to ask a co-worker how to use "find". So in my experience there's nothing simple and uniform about unix tools and I use those constantly at work. given that both options suck - I'd prefer dealing with objects rather than raw files that need to be parsed. i.e. someDir.list() which returns an array of files is better than using ls on unix.
 Windows has a different design than Unix's "everything is a file"
 which IMO is a stupid legacy design from the 70's.

The old "technology from the 70's" chestnut. Your opinion varies from 90% of people who actually use scripts. New technology for the sake of being new isn't better.

Was Colombus wrong when he said the world is round and 99.9% of people told him he's a fool? My opinion is that there where better OS designs in the _60s_ than what we use today. "everything is a file" is a complete failure.
 therefore, trying to do the unix way on windows with BAT files is
 simply the wrong way. it doesn't work because it is not designed to
 work like that.
 my take on all this, I'm not a huge fan of windows and it sure has its
 own problems, but this specific aspect is done much better than UNIX
 and all those comments about "windows doesn't support unix's
 "everything is a file" design and therefore it's crap" just show a lot
 of ignorance.

It's not crap, just not as good. It's a poor replacement for the "Everything is the same" design. Having everything use the same API has huge advantages in modularity. One of my hugest pet peeves with Windows is that it has several different APIs for I/O objects, and ony sockets support the select interface. I have no idea what Windows devs were smoking when they decided not to allow select on any object. Making efficient I/O driven apps that use more than just sockets is really difficult.

see above, MS got the it wrong. are you surprised? I'm not.
 -Steve

Apr 08 2009
next sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Steven Schveighoffer wrote:
 [snip]
 
 -Steve

This is getting rather inflammatory, so let me clarify a few things. What Yigal should have said was that when everything is a file, there is no API for the CONTENTS of files. Yes, you can manipulate files, but it's a bit like Variants in D: you can't do anything useful with the contents unless you specifically know what they are. Powershell is designed to work with managed (.NET) objects. It can dynamically introspect these objects and pull them apart, mutate them, convert them, etc. Imagine if every file on a UNIX system also carried around a reference to its own parser, and a description of how to interpret the data. THAT is what Powershell has over UNIX shells. For example, the output of the "ls" equivalent is a table of objects. By default, it gets toString'd and displayed as a table. However, you can pipe this into a command that reorders columns. Or sorts. And you don't have to dick about with ensuring the filenames don't contain whitespace or newlines because the file names are carried around as actual strings that know their own length. Unlike UNIX, where everything is a file, to powershell everything is an object. So the list command can be used on a directory or on an object that is an aggregate of stuff. For example, you can use powershell to browse the registry as if it was just another part of the filesystem. I won't say that "everything is a file" is a failure, but powershell *definitely* exposes a superset of UNIX's functionality. Anything you can do with a UNIX-style environment, powershell can potentially do better. Microsoft really hit one out of the park with powershell, although it remains to be seen if anyone will actually use it. -- Daniel.
Apr 08 2009
next sibling parent Yigal Chripun <yigal100 gmail.com> writes:
On 08/04/2009 17:10, Daniel Keep wrote:
 Steven Schveighoffer wrote:
 [snip]

 -Steve

This is getting rather inflammatory, so let me clarify a few things. What Yigal should have said was that when everything is a file, there is no API for the CONTENTS of files. Yes, you can manipulate files, but it's a bit like Variants in D: you can't do anything useful with the contents unless you specifically know what they are. Powershell is designed to work with managed (.NET) objects. It can dynamically introspect these objects and pull them apart, mutate them, convert them, etc. Imagine if every file on a UNIX system also carried around a reference to its own parser, and a description of how to interpret the data. THAT is what Powershell has over UNIX shells. For example, the output of the "ls" equivalent is a table of objects. By default, it gets toString'd and displayed as a table. However, you can pipe this into a command that reorders columns. Or sorts. And you don't have to dick about with ensuring the filenames don't contain whitespace or newlines because the file names are carried around as actual strings that know their own length. Unlike UNIX, where everything is a file, to powershell everything is an object. So the list command can be used on a directory or on an object that is an aggregate of stuff. For example, you can use powershell to browse the registry as if it was just another part of the filesystem. I won't say that "everything is a file" is a failure, but powershell *definitely* exposes a superset of UNIX's functionality. Anything you can do with a UNIX-style environment, powershell can potentially do better. Microsoft really hit one out of the park with powershell, although it remains to be seen if anyone will actually use it. -- Daniel.

Thank you. You explained this much better than me. :)
Apr 08 2009
prev sibling next sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Daniel Keep wrote:
 Powershell is designed to work with managed (.NET) objects.  It can
 dynamically introspect these objects and pull them apart, mutate them,
 convert them, etc.  Imagine if every file on a UNIX system also carried
 around a reference to its own parser, and a description of how to
 interpret the data.  THAT is what Powershell has over UNIX shells.

You are rarely going to write a program that uses reflection more often than direct calls. It's inefficient in terms of the amount of code you need to write. It's inefficient in terms of running time. And you need to have a very good idea of what you're looking for in the first place. So that doesn't much matter. What *does* matter is standard interfaces. If a command will usually only return, say, a DataTable or an IEnumerable or a string or an integer, then you're down to a manageable range. In this regard, Unix has a standard interface: text. This turns out to be usable >90% of the time. It has the advantage that you can write a program in any language that can process text. But it has disadvantages, too.
 For example, the output of the "ls" equivalent is a table of objects.
 By default, it gets toString'd and displayed as a table.  However, you
 can pipe this into a command that reorders columns.  Or sorts.  And you
 don't have to dick about with ensuring the filenames don't contain
 whitespace or newlines because the file names are carried around as
 actual strings that know their own length.

That's awesome. It's an annoying and unsolvable issue with bash. That would remove issues where you have to escape a string multiple times -- which can result in hard-to-find bugs. Of course, it only helps when you're working within powershell. But that would still be an improvement.
Apr 08 2009
parent reply Christopher Wright <dhasenan gmail.com> writes:
Jarrett Billingsley wrote:
 On Wed, Apr 8, 2009 at 11:09 AM, Christopher Wright <dhasenan gmail.com> wrote:
 
 In this regard, Unix has a standard interface: text. This turns out to be
 usable >90% of the time. It has the advantage that you can write a program
 in any language that can process text. But it has disadvantages, too.

Sure, as long as you're comfortable using a slew of incredibly-hard-to-read (and hard to write) domain-specific languages, e.g. sed, grep, and to a large extent Perl. Even if you're fluent in those languages, you still have to know what the format of the data is that they're parsing, and what all the pieces mean.

Sed? I only know one command, and two options. It uses regular expressions, which I already use everywhere. Grep? I only ever use two or three options. It uses regular expressions. Perl? I don't know it at all. The only other text processing language I've used is awk. I barely use it, and when I do, I only use one command. I could learn all that in an hour. Probably more like ten minutes, but an hour would certainly suffice. With Powershell, you need to be familiar with the tools for dealing with System.Data.DataTable or whatever. Maybe it would only take ten minutes. The most time it could save in that regard is an hour. The cost of learning is not a significant factor here. You might have plenty of other good arguments (and I offered some), but this isn't one of them.
Apr 08 2009
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Christopher Wright wrote:
 With Powershell, you need to be familiar with the tools for dealing with
 System.Data.DataTable or whatever. Maybe it would only take ten minutes.
 The most time it could save in that regard is an hour.

The syntax for these commands is so simple, you don't even really need to learn them. It's stuff like "get-columns" and "sort-list". I don't think I ever ran across a powershell command where I couldn't accurately guess it's purpose. Most of the time, I even got the syntax first try without needing to check the help. What's more, it's the SAME set of tools for EVERY kind of object. If it helps, imagine if in UNIX you could treat any file as a folder of files containing the parsed contents (each of which may, themselves, be folders of files.) You wouldn't need sed or awk for parsing any more because the environment has already done it for you.
 The cost of learning is not a significant factor here. You might have
 plenty of other good arguments (and I offered some), but this isn't one
 of them.

It took me a year or more to become fluent and comfortable with scripting in UNIX. I don't think you CAN learn things like sed or grep straight away because you've got to learn the regex language first (and they're always bloody different in every different environment.) You then have to learn how the program works, and which options are actually useful. And then you need to practice with it. When I first started using sed, I had to constantly check the man page because I forgot which options I wanted to use. Same thing with grep (I only recently started remembering when I needed the -v switch, for example, and I've been using it for years!) Powershell's learning curve is practically non-existent. There are no domain-specific languages; just standard commands with regular, obvious names that all do one thing really well. Within about an hour of first seeing powershell in action, I felt comfortable writing simple scripts to munge data. An hour versus a year+ with UNIX; that's not something you can simply ignore. If you're happy with UNIX, then that's fine. But discounting the things powershell does well is just doing yourself a disservice. What really saddens me is that, assuming powershell is better, UNIX will never match it; at least not for a very long time. UNIX has so much history in its CLI, whereas Windows doesn't. Microsoft can afford to "reboot" the Windows CLI and start from scratch; UNIX can't. Then again, Microsoft could just flub the whole thing anyway. :P -- Daniel
Apr 08 2009
parent =?UTF-8?B?QWxleGFuZGVyIFDDoW5law==?= writes:
Daniel Keep wrote:
 Christopher Wright wrote:
 With Powershell, you need to be familiar with the tools for dealing with
 System.Data.DataTable or whatever. Maybe it would only take ten minutes.
 The most time it could save in that regard is an hour.

The syntax for these commands is so simple, you don't even really need to learn them. It's stuff like "get-columns" and "sort-list". I don't think I ever ran across a powershell command where I couldn't accurately guess it's purpose. Most of the time, I even got the syntax first try without needing to check the help. What's more, it's the SAME set of tools for EVERY kind of object. If it helps, imagine if in UNIX you could treat any file as a folder of files containing the parsed contents (each of which may, themselves, be folders of files.) You wouldn't need sed or awk for parsing any more because the environment has already done it for you.
 The cost of learning is not a significant factor here. You might have
 plenty of other good arguments (and I offered some), but this isn't one
 of them.

It took me a year or more to become fluent and comfortable with scripting in UNIX. I don't think you CAN learn things like sed or grep straight away because you've got to learn the regex language first (and they're always bloody different in every different environment.) You then have to learn how the program works, and which options are actually useful. And then you need to practice with it. When I first started using sed, I had to constantly check the man page because I forgot which options I wanted to use. Same thing with grep (I only recently started remembering when I needed the -v switch, for example, and I've been using it for years!) Powershell's learning curve is practically non-existent. There are no domain-specific languages; just standard commands with regular, obvious names that all do one thing really well. Within about an hour of first seeing powershell in action, I felt comfortable writing simple scripts to munge data. An hour versus a year+ with UNIX; that's not something you can simply ignore. If you're happy with UNIX, then that's fine. But discounting the things powershell does well is just doing yourself a disservice. What really saddens me is that, assuming powershell is better, UNIX will never match it; at least not for a very long time. UNIX has so much history in its CLI, whereas Windows doesn't. Microsoft can afford to "reboot" the Windows CLI and start from scratch; UNIX can't. Then again, Microsoft could just flub the whole thing anyway. :P -- Daniel

The thing is, I don't *want* my _shell_ to be able to parse anything. It's a shell, not a framework with everything and two kitchensinks built in to parse every imaginable file format on my computer. That's the whole point of the UNIX philosophy: small, encapsulated tools that do one or a few tasks very well. So instead of just writing a program that reads text from STDIN or a file, parses the input and spits something about the file out in another form of text, I'd have to write, maintain and distribute that exact program AND an additional .NET "cmdlet". Not only that it's another part of my software I will have to maintain, it only works on one OS with one shell. On any UNIX, I can just use it. Compile it, use it. Pretty straight forward. When I write a sh script, it will work on a multitude of OSes, no matter how old or young it might be, no matter what purpose it serves. Granted, the syntax is a big downside, but you will usually fall back to the scripting language of your (or your project's) choice anyways at some point. E.g. the deploy process of Rails applications is not written using sh. They're simply written in Ruby (as rake/capistrano tasks). I'm not saying the powershell is a bad thing. The bad thing is that it doesn't work everywhere. When the powershell was released I couldn't use it because the Windows I was running was too old. So Microsoft has this awesome shell that only works on their newest OS. What if I wanted to automate something on my grandmother's PC with Windows 98? Or for less suckage, lets say Windows 2000? I can automate processes on *any* UNIX, as long as it provides a shell and every UNIX I could possibly think of does that. So the same automation that I made on my opensolaris server works on my aunt's completely different computer with Linux on it. .02 Alex
Apr 09 2009
prev sibling next sibling parent Yigal Chripun <yigal100 gmail.com> writes:
On 08/04/2009 18:11, Jesse Phillips wrote:

 Ah, then the problem was using the term "everything is a file." $ ls is
 unrelated to that philosophy. "Everything is a file" refers to how you
 communicate to your kernel, not the tools used to manipulate files. That
 is you can open a text file and use a file descriptor, you open a socket
 and use a file descriptor.

 Maybe it would have been better to use the *nix philosophy of "chaining
 tools together." I've never used powershell so I'm not familiar wit the
 alternative.

powershell allows chaining tools together... the big thing is that those tools comunicate via .net objects instead of plain text. powershell provides sets of aliases for cmd.exe user as well as unix users, so stuff like ls | grep exp work out of the box.
Apr 08 2009
prev sibling parent Yigal Chripun <yigal100 gmail.com> writes:
On 08/04/2009 18:10, Steven Schveighoffer wrote:
 This does sound useful. More so than was explained, sorry to Yigal for
 being so inflammatory, but what can you expect when you say Unix is a
 "stupid" design ;) It's just a different design, one that works very
 well for script writers.

Daniel who helped clarify this. :)
 I won't say that "everything is a file" is a failure, but powershell
 *definitely* exposes a superset of UNIX's functionality. Anything you
 can do with a UNIX-style environment, powershell can potentially do
 better.

This kind of thing is useful only for cases where OS objects were converted into strings (such as via ls), actual files still have to be read and parsed I'm guessing. But having .NET at your disposal gives you a lot of potential parsers for things like XML files or whatever. BTW, /proc is a lot like this. You don't need to have a manual to understand what it means, since you can browse through it just like any other directory. However, there are some files that have undescribed values in them, where you do need a manual. But these files are built to be parsed for the most part, so it doesn't take a lot of work to get information out of it. I think the advantage to having everything be represented as files is that you already have a bazillion tools to manipulate and parse files in unix. The same is not for Windows, but it does have .NET which has a great API to OS objects.
 Microsoft really hit one out of the park with powershell, although it
 remains to be seen if anyone will actually use it.

It sounds a lot like it is geared toward .NET programmers rather than script writers. Do you use it? -Steve

powershell has its own syntax specifically designed for scripting. It's integrated with the platform but it is geared towards script writers. powershell allows: a) you can call external programs just like in bash b) you can write scripts in powershell just like you'd do with bash using the powershell language. c) you can extend powershell with cmdlets - cmdlets are .net (C#) classes that implement a _common_ interface. you do not need to parse any files unless you use external programs. fo example, let's look at "ls | grep ..." : ls, grep, etc are just aliases for cmdlets, which are clases that can communicate with objects and no file parsing is required between them.
Apr 08 2009
prev sibling next sibling parent superdan <super dan.org> writes:
Yigal Chripun Wrote:

 I agree that a uniform and consistent API is important and I'm sure that 
 MS managed to mess that up :) but that's besides the point. "Everything 
 is a file" does not provide a uniform API but rather provides no API. 
 Each unix tool has its own mini-syntax and its own set of command-line 
 arguments and you need to learn how to use each tool separately beyond 
 trivial use cases.

was almost feelin' pity fer yer being such an idiot. but then saw this:
 At my work, we program in a *nix environment (Solaris) and I also use 
 Linux extensively So I know my way on *nix systems but I simply cannot 
 remember all the different argument for each util. every time I need to 
 find a file I need to ask a co-worker how to use "find". So in my 
 experience there's nothing simple and uniform about unix tools and I use 
 those constantly at work.

give me a fuckin' break willya. how the motherfuckin' motherfuck can you say yer know yer way on unix but dunno how to use fuckin' find? in the same fuckin' sentence? know how to drive but dunno which pedal is which? doubt u even know whothefuckami. geez what an inbred.
 Was Colombus wrong when he said the world is round and 99.9% of people 
 told him he's a fool?

no. but yer still a fool. bring grandgrandgrandmotherfuckin' columbus now.
 My opinion is that there where better OS designs in the _60s_ than what 
 we use today. "everything is a file" is a complete failure.

yer opinion is worth its weight in shit. hey, pipl, mr yigal d. bagger here sez unix files n pipes are a failure. what? yeah, i heard. nobody gives a flyin' fuck.
Apr 08 2009
prev sibling parent "Joel C. Salomon" <joelcsalomon gmail.com> writes:
Yigal Chripun wrote:
 Windows has a different design than Unix's "everything is a file"
 which IMO is a stupid legacy design from the 70's.



 I agree that a uniform and consistent API is important and I'm sure that
 MS managed to mess that up :) but that's besides the point. "Everything
 is a file" does not provide a uniform API but rather provides no API.
 Each unix tool has its own mini-syntax and its own set of command-line
 arguments and you need to learn how to use each tool separately beyond
 trivial use cases.

You need Plan 9 to really show the power of “everything is a file”. And they’ve removed all the extra option from the little tools, so there aren’t ten trillion languages. Just one language—the shell rc is much more regular than any *sh—with easy-to-read commands. And the terminal window program is *much* better than just about anything else. Line wrap, copy-paste, filename expansion (*not* embedded into individual programs), &c. —Joel Salomon
Apr 08 2009
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Steven Schveighoffer wrote:
 On Wed, 08 Apr 2009 06:38:53 -0400, Yigal Chripun <yigal100 gmail.com> 
 wrote:
 Windows has a different design than Unix's "everything is a file" 
 which IMO is a stupid legacy design from the 70's.

The old "technology from the 70's" chestnut.

I hear the "everything is a file is obsolete" pickup line once in a while. I don't buy it. Clearly there are limitations, but equally clearly it's an extremely powerful paradigm. The sheer fact that other OSs failed, in spite of numerous attempts, to inch ahead of Unix, is very telling. My perception of Windows APIs is that they force programmers to learn new ways of doing the same old things every five years. (I think it has a lot to do with marketing strategies.) There is improvement, but not nearly as marked at they'd want to make it, and the old technology just stays around, accumulates, and hardens like old lava on a volcano's slopes. I wrote Windows programs professionally for about 10 years. Only during that period, the sanctioned way of brokering objects, accessing databases, or writing GUI applications has changed 3-4 times (each). ODBC, ADO, RDO, ..., CrapDO... remember? Then MFC, WTL, and now Windows Forms et al. Then OLE, ActiveX (what a Potemkin village!), DCOM, Transaction Server, and of course many I forgot. At a company we were using MS Transaction Server. I went around and asked my bosses why. Nobody knew. I asked what features of it we need. Nobody knew, and they didn't knew even what the MTS was supposed to do. The fact the company had bought it was a pure marketing trick from MS' part. To continue the anecdote: my boss at the time woke up every morning, came in early, checked out the new code - from Visual Source Safe (another useless make-believe product that has never hold a candle to even the, um, obsolete cvs that uses equally obsolete text files), built it, deregistered each of a dozen objects from the graphical MTS console, and then registered each again. This was the only known way to make our updates work. The task could not be automated. The man wasn't a great programmer and to him coming in early and moving the mouse a few hundred yards a day was a great way of feeling useful. He was rather disquieted by my insistence that something is really flawed in our way of doing things. Andrei
Apr 08 2009
parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from Andrei Alexandrescu (SeeWebsiteForEmail erdani.org)'s article
 At a company we were using MS Transaction Server. I went around and
 asked my bosses why. Nobody knew. I asked what features of it we need.
 Nobody knew, and they didn't knew even what the MTS was supposed to do.
 The fact the company had bought it was a pure marketing trick from MS'
 part. To continue the anecdote: my boss at the time woke up every
 morning, came in early, checked out the new code - from Visual Source
 Safe (another useless make-believe product that has never hold a candle
 to even the, um, obsolete cvs that uses equally obsolete text files),
 built it, deregistered each of a dozen objects from the graphical MTS
 console, and then registered each again. This was the only known way to
 make our updates work.

The registration aspect of MS programming technology has got to be about the most broken concept I've encountered in Windows. It's abstruse, brittle, and incredibly error-prone. In my brief exposure to .NET programming, this feature had me tearing my hair out more often than any other.
Apr 08 2009
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Sean Kelly wrote:
 == Quote from Andrei Alexandrescu (SeeWebsiteForEmail erdani.org)'s article
 At a company we were using MS Transaction Server. I went around and
 asked my bosses why. Nobody knew. I asked what features of it we need.
 Nobody knew, and they didn't knew even what the MTS was supposed to do.
 The fact the company had bought it was a pure marketing trick from MS'
 part. To continue the anecdote: my boss at the time woke up every
 morning, came in early, checked out the new code - from Visual Source
 Safe (another useless make-believe product that has never hold a candle
 to even the, um, obsolete cvs that uses equally obsolete text files),
 built it, deregistered each of a dozen objects from the graphical MTS
 console, and then registered each again. This was the only known way to
 make our updates work.

The registration aspect of MS programming technology has got to be about the most broken concept I've encountered in Windows. It's abstruse, brittle, and incredibly error-prone. In my brief exposure to .NET programming, this feature had me tearing my hair out more often than any other.

Yah, and the anecdote also illustrates the contempt that Windows has towards automation. Back then I didn't know any Unix, but I did have the intuition "it's a computer, so I'm supposed to have it do what I want... right?" Speaking of which, due to my participation in MSR/UW symposia, I happen to know a tad more about MS' server technology than I care. I could summarize that in a thought: MS will have trouble getting on the Net where Google, Yahoo, or Amazon are, simply because they are constrained to using Windows. Even some internal big wigs acknowledge that. It would be terrible PR if they started using Unix technology, so they *have* to use Windows Server. IMHO they'll never get anywhere interesting with it. Andrei
Apr 08 2009
prev sibling parent Christopher Wright <dhasenan gmail.com> writes:
Yigal Chripun wrote:
 ever heard of powershell? it is in fact a superior design for a shell 
 compared to most unix shells.
 
 also, have you ever heard of rush? http://rush.heroku.com/

I tried rush. Its documentation is lacking. The lack of a working directory is annoying. The lack of formatting and color when listing the contents of a directory is a show stopper, especially when combined with no equivalent to less. I have very few directories that have more than one pageful of files when using ls -C, but many of them would go to multiple pages with rush. Maybe in a few years it'll be a good shell, but for now, I don't want to reinvent 'ls --color=always -C' in Ruby.
Apr 08 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Wed, Apr 8, 2009 at 11:09 AM, Christopher Wright <dhasenan gmail.com> wrote:

 In this regard, Unix has a standard interface: text. This turns out to be
 usable >90% of the time. It has the advantage that you can write a program
 in any language that can process text. But it has disadvantages, too.

Sure, as long as you're comfortable using a slew of incredibly-hard-to-read (and hard to write) domain-specific languages, e.g. sed, grep, and to a large extent Perl. Even if you're fluent in those languages, you still have to know what the format of the data is that they're parsing, and what all the pieces mean.
Apr 08 2009
prev sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Thu, 09 Apr 2009 10:52:02 +1000, Daniel Keep wrote:

 Christopher Wright wrote:
 With Powershell, you need to be familiar with the tools for dealing
 with System.Data.DataTable or whatever. Maybe it would only take ten
 minutes. The most time it could save in that regard is an hour.

The syntax for these commands is so simple, you don't even really need to learn them. It's stuff like "get-columns" and "sort-list". I don't think I ever ran across a powershell command where I couldn't accurately guess it's purpose. Most of the time, I even got the syntax first try without needing to check the help. What's more, it's the SAME set of tools for EVERY kind of object. If it helps, imagine if in UNIX you could treat any file as a folder of files containing the parsed contents (each of which may, themselves, be folders of files.) You wouldn't need sed or awk for parsing any more because the environment has already done it for you.
 The cost of learning is not a significant factor here. You might have
 plenty of other good arguments (and I offered some), but this isn't one
 of them.

It took me a year or more to become fluent and comfortable with scripting in UNIX. I don't think you CAN learn things like sed or grep straight away because you've got to learn the regex language first (and they're always bloody different in every different environment.) You then have to learn how the program works, and which options are actually useful. And then you need to practice with it. When I first started using sed, I had to constantly check the man page because I forgot which options I wanted to use. Same thing with grep (I only recently started remembering when I needed the -v switch, for example, and I've been using it for years!) Powershell's learning curve is practically non-existent. There are no domain-specific languages; just standard commands with regular, obvious names that all do one thing really well. Within about an hour of first seeing powershell in action, I felt comfortable writing simple scripts to munge data. An hour versus a year+ with UNIX; that's not something you can simply ignore. If you're happy with UNIX, then that's fine. But discounting the things powershell does well is just doing yourself a disservice. What really saddens me is that, assuming powershell is better, UNIX will never match it; at least not for a very long time. UNIX has so much history in its CLI, whereas Windows doesn't. Microsoft can afford to "reboot" the Windows CLI and start from scratch; UNIX can't. Then again, Microsoft could just flub the whole thing anyway. :P -- Daniel

I'll probably agree powershell is better than bash/other Unix shells. But in truth, it would be easy to replace the shell with one that works like powershell, no one has created one and if they did it wouldn't take off. I liked your note that Windows can completely redo the CLI because it hasn't been the heart, yet most of their issues have come from not being able to redo the Win32 API :) With having to deal with all the backward compatibility and security issues, their users experience has degraded.
Apr 08 2009
prev sibling parent reply Sergey Gromov <snake.scaly gmail.com> writes:
Mon, 06 Apr 2009 20:19:40 -0400, Jussi Jumppanen wrote:

 As a commandline utility, it can be combined with other stuff such 
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there 
 though...

Replace ls with dir, download the Win32 version of grep, sed, awk and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

Windows shell (cmd) sucks. And Windows scripting (BAT-files) suck. Using Cygwin tools is a pain because Cygwin emulates a Unix-like file system view while other tools produce and expect native Windows paths. And FAR, being the best shell available, still doesn't support path auto-completion while even standard CMD does. Windows is my main development platform, and it drives me nuts. I'd move to Linux but I'm afraid of little important things getting in the way, like a requirement to use Outlook for my corporate mail, and Flash CS4 for development. Even if it's possible I can't afford being semi-paralyzed for at least a couple of weeks while all those nuances are being sorted out.
Apr 07 2009
next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from Sergey Gromov (snake.scaly gmail.com)'s article
 Windows is my main development platform, and it drives me nuts.  I'd
 move to Linux but I'm afraid of little important things getting in the
 way, like a requirement to use Outlook for my corporate mail, and Flash
 CS4 for development.  Even if it's possible I can't afford being
 semi-paralyzed for at least a couple of weeks while all those nuances
 are being sorted out.

In the rare instance where I haven't been able to find a native app to do some Windows thing I just use the actual Windows app running in a VM. But there's still a tipping point where if you find yourself using more non-native apps than native apps then there's just no point in using that OS no matter how much better it is. I ran into this problem with OS/2 when one day I realized that I was mostly using it as an execution shell for Windows apps... it was difficult to justify using OS/2 after that, even though it was a million times better than Windows.
Apr 07 2009
parent Don <nospam nospam.com> writes:
Sean Kelly wrote:
 == Quote from Sergey Gromov (snake.scaly gmail.com)'s article
 Windows is my main development platform, and it drives me nuts.  I'd
 move to Linux but I'm afraid of little important things getting in the
 way, like a requirement to use Outlook for my corporate mail, and Flash
 CS4 for development.  Even if it's possible I can't afford being
 semi-paralyzed for at least a couple of weeks while all those nuances
 are being sorted out.

In the rare instance where I haven't been able to find a native app to do some Windows thing I just use the actual Windows app running in a VM. But there's still a tipping point where if you find yourself using more non-native apps than native apps then there's just no point in using that OS no matter how much better it is. I ran into this problem with OS/2 when one day I realized that I was mostly using it as an execution shell for Windows apps... it was difficult to justify using OS/2 after that, even though it was a million times better than Windows.

That was _exactly_ my experience too. I used OS/2 2.1 for about a year. I felt that it genuinely was "a better Windows than Windows", but I didn't have a single OS/2 app...
Apr 08 2009
prev sibling parent Sergey Gromov <snake.scaly gmail.com> writes:
Tue, 07 Apr 2009 19:06:04 -0400, Steven Schveighoffer wrote:

 On Tue, 07 Apr 2009 18:48:19 -0400, Sergey Gromov <snake.scaly gmail.com>  
 wrote:
 
 Using Cygwin tools is a pain because Cygwin emulates a Unix-like file
 system view while other tools produce and expect native Windows paths.

just as an aside, have you looked at cygwin's cygpath tool? Not a complete solution, but it certainly helps.

Great, I didn't know such tool existed. Thanks! Though with as limited stdout capture support as in .BAT files it's a pain anyway.
Apr 07 2009
prev sibling next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Saaa wrote:
 "Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message 
 news:grduhp$1rk0$1 digitalmars.com...
 Saaa wrote:
 When you'd be writing computer programs.

Linux and start programming.

sure you know about the phenomenon "writing Fortran in C" etc. Installing eclipse and starting programming as you would under windows would be a moral equivalent. (Not that I would advise against using eclipse, which I also like.) Andrei

Then, how should I start, or: where do I learn how I should start? :D

I intently stayed vague because there's no simple advice that can be given on a complex phenomenon. The question is about as general and complicated as "how do I get a date", and the problem with short answers is that they can never be meaningful because, well, they are too short and the problem is too large. Think of the "just be yourself" advice, which is completely moronic, but on the surface it does make sense to some extent and with the due qualifications. I'll try my "just be yourself" advice by just telling how it worked for me. I had a real large project to implement on Unix and that's that. Initially Unix ripped my leg and beat me to death with it. Then I've been through a number of exaggerated stages (e.g. writing big shell scripts - there's something to be said about the joy of seeing .bat files done right). Then I got to the point where I was reasonably productive, and finally got to a point where I could occasionally look amused over the shoulder of someone trying to get work done in Windows. It's like watching an accident, and in slow motion. Andrei
Apr 06 2009
prev sibling parent reply "Saaa" <empty needmail.com> writes:
Thanks,
I really do feel impaired. Not so much as in that I don't use unix, but more 
in that I see software lagging behind hardware.
I think maybe this lag is a bit less when using unix but only if I would 
start using the right tools (yes I'm a mouse fanatic and found it 
surprisingly stupid that 'save all' needed a plugin to appear as a gui 
button in eclipse)
At least for my current project I don't see any advantage in using a unix 
based os. Mind you that I've never had the need to write a single .bat file 
for any of my projects.

Maybe I should simple start by using vim :) 
Apr 06 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Saaa wrote:
 Thanks,
 I really do feel impaired. Not so much as in that I don't use unix, but more 
 in that I see software lagging behind hardware.
 I think maybe this lag is a bit less when using unix but only if I would 
 start using the right tools (yes I'm a mouse fanatic and found it 
 surprisingly stupid that 'save all' needed a plugin to appear as a gui 
 button in eclipse)
 At least for my current project I don't see any advantage in using a unix 
 based os. Mind you that I've never had the need to write a single .bat file 
 for any of my projects.

Me neither. Later I realized that of course I wouldn't be thinking of painting the walls when I was living in a yurt. Andrei
Apr 06 2009
parent "Saaa" <empty needmail.com> writes:
 Saaa wrote:
 Thanks,
 I really do feel impaired. Not so much as in that I don't use unix, but 
 more in that I see software lagging behind hardware.
 I think maybe this lag is a bit less when using unix but only if I would 
 start using the right tools (yes I'm a mouse fanatic and found it 
 surprisingly stupid that 'save all' needed a plugin to appear as a gui 
 button in eclipse)
 At least for my current project I don't see any advantage in using a unix 
 based os. Mind you that I've never had the need to write a single .bat 
 file for any of my projects.

Me neither. Later I realized that of course I wouldn't be thinking of painting the walls when I was living in a yurt. Andrei

The analogy is kind of strange :) Which is the painting and which is the yurt? I meant to say that my projects are quite simplistic in that last sentence. So I guess my projects are the yurt :)
Apr 06 2009
prev sibling next sibling parent Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
Jesse Phillips wrote:
 You will find little things that make your life easier, I will state some 
 here, but they don't sound very important and some you may not like. 
 Multiple desktops (If you have tried this on Windows you have been 
 cheated in how it really should work). The middle mouse copy/past (True X-
 Mouse is a poor substitute). Sloppy-Focus (A window is activated for 
 keyboard input, but is not raised when the mouse is over it.)

Middle mouse copy/paste + dodgy KVM switch was fun.
Apr 07 2009
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Jesse Phillips wrote:
 Many people suggest Live-CDs for introduction, but this is only 
 go to show that you have a browser in Linux. It doesn't give a true Linux 
 experience.

I agree. Somehow I'm surprised that the discussion drifted into a pure user-level feature comparison though. Below I'll give another shot at making a point. There's an old joke circulating on the net about "Hello, world" written by programmers in various stages of their career, see e.g. http://www.ariel.com.au/jokes/The_Evolution_of_a_Programmer.html. I've seen that a long time ago. The "Unix guru" program looks like this: echo "Hello, world" I sort of got a chuckle out of it ten years ago "Heh, this guru doesn't even bother to write in C..." But there's a layer in the joke that I'd missed: In Unix you can do quickly and easily a large amount of work that would be routinely considered programming in Windows, without even really programming. You can automate a lot of things that are not even considered candidates for automation under Windows, unless you have some specialized tools that automate the exact problem you care about. Furthermore, the way of doing things in Windows is not conducive to certain sorts of automation - simply because most of Unix is dedicated to you writing programs, whereas in Windows only a handful of specialized tools are dedicated to you writing programs. If your notion of programming is "I plan to write Java" or whichever language and your notion of work is "I fire off the IDE" then you'll get little added value from Unix. If, on the other hand, the plan is "I plan to write programs" then a federation of languages and tools will be readily at your disposal, and you'll laugh at the narrow-mindedness of your former self who thought that if you wanted to index a file you'd have to fire your IDE. I'll risk an example. A while ago my wife was looking for a place for her medical residency. There was an online service that would give her a long webpage with links to all institutions she was interested in. The links were in the hundreds. She had to click each, then a couple of others, then look through their program highlights to see some details she was interested in. Getting back or opening in new window were difficult due to some Javascript (of which disabling messed things up). All in all it was a very tedious task. It took me a couple of minutes to write under her eyes a script that downloaded HTML, scraped the code for links, followed those of interest, and output a concatenation of all pages she was interested in, with details highlighted, that was loadable back in the browser. I'd show her one iteration, get feedback, and get the next iteration within seconds. All without "coding" in any sense as regularly understood by Windows programmers. She was pleasantly surprised as her entire framework of using the computer not only didn't include such tasks, but also didn't include a notion that it's possible to accomplish such tasks on a computer. My point is that I myself, a programmer, would have been surprised if I'd seen the same only five years ago. My only hope back then would have been that some add-on implements what she needs by accident, or that I could fire off my IDE and write a program to do what she needed before she'd actually do it by hand. Andrei
Apr 07 2009
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 It took me a couple of minutes to write under her eyes a script that 
 downloaded HTML, scraped the code for links, followed those of interest, 
 and output a concatenation of all pages she was interested in, with 
 details highlighted, that was loadable back in the browser. I'd show her 
 one iteration, get feedback, and get the next iteration within seconds. 
 All without "coding" in any sense as regularly understood by Windows 
 programmers.

I have no idea how to do that under unix. I obviously have not learned anywhere near enough about it.
Apr 07 2009
next sibling parent =?UTF-8?B?QWxleGFuZGVyIFDDoW5law==?= writes:
Walter Bright wrote:
 Andrei Alexandrescu wrote:
 It took me a couple of minutes to write under her eyes a script that 
 downloaded HTML, scraped the code for links, followed those of 
 interest, and output a concatenation of all pages she was interested 
 in, with details highlighted, that was loadable back in the browser. 
 I'd show her one iteration, get feedback, and get the next iteration 
 within seconds. All without "coding" in any sense as regularly 
 understood by Windows programmers.

I have no idea how to do that under unix. I obviously have not learned anywhere near enough about it.

I suppose you know all the tools you need for that: a POSIX shell, wget, sed, maybe sort, some xargs and pipes!
Apr 07 2009
prev sibling next sibling parent reply grauzone <none example.net> writes:
 But shell scripting in itself is so powerful for this kind of stuff.  
 I've written lots of little scripts to do fantastic things that on 
 Windows would be so painful (without cygwin of course).  Like renaming 
 all files of a certain type to something else, or copying select files 
 to another directory.

Now wouldn't that be much more powerful to use an actual programming language for this, instead of bash? I claim with something like python, bash doesn't really have any right to exist anymore.
Apr 07 2009
next sibling parent reply grauzone <none example.net> writes:
Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 14:35:04 -0400, grauzone <none example.net> wrote:
 
 But shell scripting in itself is so powerful for this kind of stuff.  
 I've written lots of little scripts to do fantastic things that on 
 Windows would be so painful (without cygwin of course).  Like 
 renaming all files of a certain type to something else, or copying 
 select files to another directory.

Now wouldn't that be much more powerful to use an actual programming language for this, instead of bash? I claim with something like python, bash doesn't really have any right to exist anymore.

I can log into ANY Linux, Solaris, BSD, OSX, etc system and have a reasonable /bin/sh that allows at least bourne shell functionality. The same can't be said for almost any other scripting language you can throw at me.

Sure, /bin/sh is the least common denominator. But is there a UNIX that can't run python?
 Of course, aside from that, I hate python syntax...  And can python be 
 used as a user shell?

Don't tell me you hate it more than the clusterfuck that is sh syntax? Reading or writing sh scripts always feels like screwing in bolts into my head. And regarding using it as an user shell: there's an interactive command line interpreter.
 How would you do the same thing in python?  Would it be any clearer or 
 shorter?  Probably not.

Not in all cases. But in general, I'd expect it to be clearer. Python is just more similar to normal programming than sh, which is why I'd prefer it. sh scripts aren't very reliable either. I remember that script that invoked another program. That other program produced some warning, and the script interpreted it as normal output. And escaping. I don't think there are many scripts that still work correctly if they encounter "strange" filenames, like filenames with spaces, special characters, or even line breaks. Yes, \n is a valid character in UNIX filenames.
 I'm sure some would argue that there is no point for python if you can 
 run perl...

Perl doesn't have any right to exist either. It has the same brainfuck quirks like sh. For example, defining magical global variables and such. And clusterfuck syntax. It even has a reputation as read-only language. For that matter, any language better than sh or Perl would be better for a shell.
 -Steve

Apr 07 2009
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
grauzone wrote:
 Sure, /bin/sh is the least common denominator. But is there a UNIX that 
 can't run python?

Well one good part about these tools is that there's plenty of overlap between them. Like stick-shift cars, you can drive at a given speed in two gears without ruining the engine. I use zsh for shell scripting and don't find it half bad for what I ask from it. One good thing about shell scripting is that its paradigm is nicely constrained: you operate at file level. In a general language you open file, process file, close file. In a shell your file is a unit, and a program is a unit. Of course you could also do the same in a general language with the right libs, but the playfield is too vast; in a Python or Perl script you could find pretty much any code. But as soon as I open a shell script, I know where to set my level of expectations. Here's where I operate at file and program level, and for the actual programs I use another language. That nicely modularizes and compartmentalizes my work. Could you have written Steve's script in python? Absolutely. It'd be the same way as driving your car one block to buy a bread - possible, not entirely unreasonable, just a bit inefficacious. There's been a number of experiments to replace the shell with scheme, perl, or python. I'm not sure how successful they were for particular people, but they didn't quite take. My speculation is that general languages are "too powerful" for shell scripting. Andrei
Apr 07 2009
next sibling parent grauzone <none example.net> writes:
About your general point, I think that's only because all the shell 
commands are available by default. To delete a file, there's simply 
"rm". A general purpose language would normally require more code to 
delete a file, and that additional code is perceived as "noise". The 
thing to do would be to reduce that noise to almost nothing.

 There's been a number of experiments to replace the shell with scheme, 
 perl, or python. I'm not sure how successful they were for particular 
 people, but they didn't quite take. My speculation is that general 
 languages are "too powerful" for shell scripting.

First, there's not really a high need for it. There might be many people who dislike sh, but sh works "well enough", and there's no pressure to replace it. And sh is standard and available anywhere. Second, an alternative absolutely had to be standard to be successful, because else you couldn't "compose" the various utilities to write larger programs, like in sh. Or you had to start processes and pass command line arguments and use stdin/stdout, but sh is better at this.
Apr 07 2009
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 There's been a number of experiments to replace the shell with scheme, 
 perl, or python. I'm not sure how successful they were for particular 
 people, but they didn't quite take. My speculation is that general 
 languages are "too powerful" for shell scripting.

rdmd?
Apr 07 2009
parent reply grauzone <none example.net> writes:
Walter Bright wrote:
 Andrei Alexandrescu wrote:
 There's been a number of experiments to replace the shell with scheme, 
 perl, or python. I'm not sure how successful they were for particular 
 people, but they didn't quite take. My speculation is that general 
 languages are "too powerful" for shell scripting.

rdmd?

Some things wouldn't be so beautiful with rdmd: 1. You need a main function, you can't just start typing. 2. You need at least one import statement. This is kind of annoying, because you'd probably always import the same single module, that contains all your favourite D-functions-substituting-shell-stuff. Any suggestions?
Apr 07 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
grauzone wrote:
 Walter Bright wrote:
 rdmd?

Some things wouldn't be so beautiful with rdmd: 1. You need a main function, you can't just start typing. 2. You need at least one import statement. This is kind of annoying, because you'd probably always import the same single module, that contains all your favourite D-functions-substituting-shell-stuff. Any suggestions?

I don't think it's a good idea to remove that stuff from D. I was thinking more of how the body text looks.
Apr 07 2009
prev sibling next sibling parent grauzone <none example.net> writes:
Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 15:03:54 -0400, grauzone <none example.net> wrote:
 
 Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 14:35:04 -0400, grauzone <none example.net> wrote:

 But shell scripting in itself is so powerful for this kind of 
 stuff.  I've written lots of little scripts to do fantastic things 
 that on Windows would be so painful (without cygwin of course).  
 Like renaming all files of a certain type to something else, or 
 copying select files to another directory.

Now wouldn't that be much more powerful to use an actual programming language for this, instead of bash? I claim with something like python, bash doesn't really have any right to exist anymore.

reasonable /bin/sh that allows at least bourne shell functionality. The same can't be said for almost any other scripting language you can throw at me.

Sure, /bin/sh is the least common denominator. But is there a UNIX that can't run python?

I would guess there isn't. But when someone says, "hey, I need a script that does this," I don't ever have to say "oh, you don't have /bin/sh installed? Sorry, can't help you."

You have to distinguish between "what would a perfect system look like" and "how could we improve UNIX". The latter would be replacing sh by python, I'm well aware that this doesn't work in practice.
 Of course, aside from that, I hate python syntax...  And can python 
 be used as a user shell?

Don't tell me you hate it more than the clusterfuck that is sh syntax? Reading or writing sh scripts always feels like screwing in bolts into my head.

Yes, I hate it more. sh is a simple syntax (described in 34 pages, most of which are builtin functions, of my Unix in a Nutshell book), and has no standard library. All the "library" is are standard unix commands. I had to fix some shit in the live CD creator script written in python on Fedora. It took me a long, long time to figure out what it was doing. Does it *really* require you to type self every time you want to access a member? And what's up with all the freakin underscores? You consider that a good programming syntax? The syntax of python is horrendous. The only thing I can think of that's worse is VBScript. It might be a good language, but I can't get past the syntax.

The complete language reference (including index) has 102 pages. Considering that it's probably more formal than the sh description in your Nutshell book, it's not that much compared to sh. Regarding the syntax: OK, that's probably about tastes. But I still like it more than, say, the funny way how you have to use the find program.
 And regarding using it as an user shell: there's an interactive 
 command line interpreter.

if you type ls, does it work, or do you have to type __run__("ls") or whatever?

If you'd go and use python as a shell, you had a ls() function. It would return an array of names. Instead of text garbage like ls does. How can you reliably list all files, without getting incorrect results (like when there's a line break in a file), or falling into the escape trap (your script, that takes the ls output, interprets part of the filename as program)?
 How would you do the same thing in python?  Would it be any clearer 
 or shorter?  Probably not.

Not in all cases. But in general, I'd expect it to be clearer. Python is just more similar to normal programming than sh, which is why I'd prefer it.

You thought my script was unclear? I thought you could know exactly what it's doing without even knowing sh syntax. Maybe the most confusing part was the 'fi' denoting an end of an if statement.

It doesn't really do anything complicated anyway.
 Prove me wrong, show me a python script that does the same thing, and 
 we'll see if it's clearer.

Sorry, I'm not going to write a script to prove someone else wrong over the internet. And my point was anyway to extend a _real_ scripting language by adding simple functions as substitutes for common UNIX programs like rm, ln etc.
 sh scripts aren't very reliable either. I remember that script that 
 invoked another program. That other program produced some warning, and 
 the script interpreted it as normal output.

Oh yeah, that *must* have been the scripting language's fault. I have bugs in my D programs too, must be because D sucks?

Interpreting data as programs are the "buffer overflows" of scripting languages. Nothing to defend here. The script in question was relatively large, and probably written by some guru, if that helps.
 And escaping. I don't think there are many scripts that still work 
 correctly if they encounter "strange" filenames, like filenames with 
 spaces, special characters, or even line breaks. Yes, \n is a valid 
 character in UNIX filenames.

That is what single quoting is for. 'xy *$123' is that string exactly, no interpretation of any special characters. Want to know a good trick to play on a unix newbie? Make a file in their home directory called * touch '*' Not knowing what it is, they try to remove it: rm * hilarity ensues :)

Yeah, or doing something like "rm -rf this/directory /". Or deleting all hidden directories. That demonstrates a particularly disgusting issue with the shell: escape hell. One time, I unzipped a file, and the files were encoded with some weird multibyte garbage. How do I delete the files? I had to start a GUI program to do this. In Python, with an appropriate extension library, that would have been ls() followed by a rm(ls[1]). How to do this in sh?
 I'm sure some would argue that there is no point for python if you 
 can run perl...

Perl doesn't have any right to exist either. It has the same brainfuck quirks like sh. For example, defining magical global variables and such. And clusterfuck syntax. It even has a reputation as read-only language. For that matter, any language better than sh or Perl would be better for a shell.

So basically, you don't like other scripting languages so they don't have a right to exist? Interesting point of view.

Yes. I usually destroy what I dislike.
 -Steve

Apr 07 2009
prev sibling next sibling parent Sergey Gromov <snake.scaly gmail.com> writes:
Tue, 07 Apr 2009 21:03:54 +0200, grauzone wrote:

 I can log into ANY Linux, Solaris, BSD, OSX, etc system and have a 
 reasonable /bin/sh that allows at least bourne shell functionality.  The 
 same can't be said for almost any other scripting language you can throw 
 at me.

Sure, /bin/sh is the least common denominator. But is there a UNIX that can't run python?

Sure there is. My external disk array runs one. It's OS fits on a 16 MiB ram-drive, with 3 MiB free, with almost all the shell commands implemented by an extremely stripped BusyBox. Still I can telnet into it and run scripts which Windows can only dream of.
Apr 07 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Tue, Apr 7, 2009 at 8:21 PM, Steven Schveighoffer
<schveiguy yahoo.com> wrote:

 Might I suggest that this not be the case. =A0I'd rather see a statement =

 the following in the script (if you wish to do miniD by default):

 #!/bin/mdsh
 %shell.setMode(scripted)

 // and to set it back
 shell.setMode(interactive)

Sadly that would make the lexical/semantic passes of the compiler dependent upon the semantic analysis. Beyond that, even - it'd require that the code be compiled and executed before you knew how to parse it. Sounds like Perl. However...
 Just my opinion. =A0I often try out individual lines of a script to see w=

 happening as a form of debugging, it would be maddening to have to insert=

 everywhere (for those cases where my script file is mostly shell-style
 commands).

How about something like: %{ // lots of bash-style commands! } That is, an entire brace-block in which the default parsing mode is bash mo= de?
 My intuition tells me that having things execute differently depending on
 whether it's scripted or interactive is going to cause bug reports...

It's not that it's executing differently; it's just parsed differently, with a different "reasonable default" for interactive vs. batch mode. I'm sure people might complain but meh :P
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 21:55:34 -0400, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 How about something like:

 %{
 // lots of bash-style commands!
 }

That works :) -Steve
Apr 08 2009
prev sibling parent Yigal Chripun <yigal100 gmail.com> writes:
On 07/04/2009 22:03, grauzone wrote:
 Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 14:35:04 -0400, grauzone <none example.net> wrote:

 But shell scripting in itself is so powerful for this kind of stuff.
 I've written lots of little scripts to do fantastic things that on
 Windows would be so painful (without cygwin of course). Like
 renaming all files of a certain type to something else, or copying
 select files to another directory.

Now wouldn't that be much more powerful to use an actual programming language for this, instead of bash? I claim with something like python, bash doesn't really have any right to exist anymore.

I can log into ANY Linux, Solaris, BSD, OSX, etc system and have a reasonable /bin/sh that allows at least bourne shell functionality. The same can't be said for almost any other scripting language you can throw at me.

Sure, /bin/sh is the least common denominator. But is there a UNIX that can't run python?
 Of course, aside from that, I hate python syntax... And can python be
 used as a user shell?

Don't tell me you hate it more than the clusterfuck that is sh syntax? Reading or writing sh scripts always feels like screwing in bolts into my head. And regarding using it as an user shell: there's an interactive command line interpreter.
 How would you do the same thing in python? Would it be any clearer or
 shorter? Probably not.

Not in all cases. But in general, I'd expect it to be clearer. Python is just more similar to normal programming than sh, which is why I'd prefer it. sh scripts aren't very reliable either. I remember that script that invoked another program. That other program produced some warning, and the script interpreted it as normal output. And escaping. I don't think there are many scripts that still work correctly if they encounter "strange" filenames, like filenames with spaces, special characters, or even line breaks. Yes, \n is a valid character in UNIX filenames.
 I'm sure some would argue that there is no point for python if you can
 run perl...

Perl doesn't have any right to exist either. It has the same brainfuck quirks like sh. For example, defining magical global variables and such. And clusterfuck syntax. It even has a reputation as read-only language.

I think you meant "write-only language".
 For that matter, any language better than sh or Perl would be better for
 a shell.

 -Steve


I completely agree with the above, only thing is that my personal preference would be Ruby instead of python nad my second choice would be Javascript. But in general I agree that Perl and all variants of unix shell (csh, ksh, bash, zsh, etc) are obsolete tech. google for Rush, that's a Ruby Shell.
Apr 08 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Tue, Apr 7, 2009 at 7:53 PM, Steven Schveighoffer
<schveiguy yahoo.com> wrote:

 OK, that was *really* confusing, let me re-explain:

 if you are in interactive mode, the default is shell mode, and % turns miniD
 on and off, which continues beyond a single line
 if you are in a script file, then you are always in miniD mode, unless it
 sees %, which turns it to shell mode for a single line.

Close. In either mode, % switches to the other mode for a single *statement*, and statements can span multiple lines. In interactive mode, the interpreter will compile and run your code when you have finished a single statement, no matter if it's a single line or if it's a huge multi-line loop statement.
Apr 07 2009
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 20:02:33 -0400, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 On Tue, Apr 7, 2009 at 7:53 PM, Steven Schveighoffer
 <schveiguy yahoo.com> wrote:

 OK, that was *really* confusing, let me re-explain:

 if you are in interactive mode, the default is shell mode, and % turns  
 miniD
 on and off, which continues beyond a single line
 if you are in a script file, then you are always in miniD mode, unless  
 it
 sees %, which turns it to shell mode for a single line.

Close. In either mode, % switches to the other mode for a single *statement*, and statements can span multiple lines. In interactive mode, the interpreter will compile and run your code when you have finished a single statement, no matter if it's a single line or if it's a huge multi-line loop statement.

Ah HA! Yes, I see that now, interesting idea. Might I suggest that this not be the case. I'd rather see a statement like the following in the script (if you wish to do miniD by default): #!/bin/mdsh %shell.setMode(scripted) // and to set it back shell.setMode(interactive) Just my opinion. I often try out individual lines of a script to see what's happening as a form of debugging, it would be maddening to have to insert % everywhere (for those cases where my script file is mostly shell-style commands). Or, I guess if you gave the ability as stated above, I could insert the shell.setMode(interactive) in such scripts... My intuition tells me that having things execute differently depending on whether it's scripted or interactive is going to cause bug reports... Anyways, looking forward to trying it. -Steve
Apr 07 2009
prev sibling next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Steven Schveighoffer wrote:
 For example, here's a script I wrote to change which D compiler I want 
 to use:

What would be fun is seeing how that script would look written in D, then run using rdmd!
Apr 07 2009
prev sibling parent bearophile <bearophileHUGS lycos.com> writes:
Walter Bright:
 Andrei Alexandrescu:
 It took me a couple of minutes to write under her eyes a script that 
 downloaded HTML, scraped the code for links, followed those of interest, 
 and output a concatenation of all pages she was interested in, with 
 details highlighted, that was loadable back in the browser. I'd show her 
 one iteration, get feedback, and get the next iteration within seconds. 
 All without "coding" in any sense as regularly understood by Windows 
 programmers.

I have no idea how to do that under unix. I obviously have not learned anywhere near enough about it.

You may need some Python, Walter. You can do that with a small enough script, and then it works equally on Win and Linux. Bye, bearophile
Apr 07 2009
prev sibling next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Jarrett Billingsley wrote:
 On Tue, Apr 7, 2009 at 12:38 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:
 I'll risk an example. A while ago my wife was looking for a place for her
 medical residency. There was an online service that would give her a long
 webpage with links to all institutions she was interested in. The links were
 in the hundreds. She had to click each, then a couple of others, then look
 through their program highlights to see some details she was interested in.
 Getting back or opening in new window were difficult due to some Javascript
 (of which disabling messed things up). All in all it was a very tedious
 task.

 It took me a couple of minutes to write under her eyes a script that
 downloaded HTML, scraped the code for links, followed those of interest, and
 output a concatenation of all pages she was interested in, with details
 highlighted, that was loadable back in the browser. I'd show her one
 iteration, get feedback, and get the next iteration within seconds. All
 without "coding" in any sense as regularly understood by Windows
 programmers.

I did pretty much the exact same thing in Python on Windows. For that matter, if it's bash scripting that really sets Unix apart from Windows, well no thanks, I'll have no part in it.

Relax, it ain't. Andrei
Apr 07 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Tue, Apr 7, 2009 at 7:14 PM, Steven Schveighoffer
<schveiguy yahoo.com> wrote:

 (It also follows that if you wrote a full shellscript, in a .mdsh file
 or something, the compiler would, when compiling it, start in MiniD
 mode by default so you wouldn't have to escape every statement with a
 %.)


 I'm a little confused on the escaping. =A0In one example, it looks like %
 turns MiniD alternately on and off, yet you say you'd have to escape ever=

 line in a script file?

I'm sure if you read what I've quoted here, you'll see your mistake ;)
 If you meant the "on/off" style, the escaping should be more like
 open/closing (e.g. %< minid code >% ). =A0Otherwise, it'd be hard to tell=

 the middle of the file whether you're in miniD or bash syntax.

A shellscript would always be compiled in MiniD mode, and you'd have to escape into bash mode with %, and that would only work on a single statement.
 You should also be able to alias any miniD function that takes an array o=

 strings to a shell "command". =A0This would allow you to have a selected
 overlap between miniD and your PATH's namespace. =A0Something like:

 %shell.alias("foo", &foo)
 foo a b "c d e"

which would be equivalent to calling foo("a", "b", "c d e"), even if ther=

 was a foo command in your path.

Oh totally. I've got all sorts of ideas.
 BTW, never used miniD, so I don't know what's already possible.

Anything! ;)
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 19:41:36 -0400, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 On Tue, Apr 7, 2009 at 7:14 PM, Steven Schveighoffer
 <schveiguy yahoo.com> wrote:

 (It also follows that if you wrote a full shellscript, in a .mdsh file
 or something, the compiler would, when compiling it, start in MiniD
 mode by default so you wouldn't have to escape every statement with a
 %.)


 I'm a little confused on the escaping. In one example, it looks like %
 turns MiniD alternately on and off, yet you say you'd have to escape  
 every
 line in a script file?

I'm sure if you read what I've quoted here, you'll see your mistake ;)

What it looks like to me then is: if you are in interactive mode, the default is script mode, and % turns miniD on and off, which continues beyond a single line if you are in a script mode, then you are always in miniD mode, unless it sees %, which turns it to script mode for a single line. This is very confusing to me :) I'm citing your original example: > %foreach(file; shell.ls()) -> clearly % escaped to miniD mode .. { .. writeln("processing file ", file) -> still in miniD mode, right? .. %something $file -> back to shell mode, right? .. } -> um... in shell mode still maybe? or not? If I'm still mistaken, don't worry about trying to help me understand. I'm sure you wouldn't release something like this, so I'll wait until I have mdsh to play with before I complain :) -Steve
Apr 07 2009
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 19:52:12 -0400, Steven Schveighoffer  
<schveiguy yahoo.com> wrote:

 On Tue, 07 Apr 2009 19:41:36 -0400, Jarrett Billingsley  
 <jarrett.billingsley gmail.com> wrote:

 On Tue, Apr 7, 2009 at 7:14 PM, Steven Schveighoffer
 <schveiguy yahoo.com> wrote:

 (It also follows that if you wrote a full shellscript, in a .mdsh file
 or something, the compiler would, when compiling it, start in MiniD
 mode by default so you wouldn't have to escape every statement with a
 %.)


 I'm a little confused on the escaping. In one example, it looks like %
 turns MiniD alternately on and off, yet you say you'd have to escape  
 every
 line in a script file?

I'm sure if you read what I've quoted here, you'll see your mistake ;)

What it looks like to me then is: if you are in interactive mode, the default is script mode, and % turns miniD on and off, which continues beyond a single line if you are in a script mode, then you are always in miniD mode, unless it sees %, which turns it to script mode for a single line.

OK, that was *really* confusing, let me re-explain: if you are in interactive mode, the default is shell mode, and % turns miniD on and off, which continues beyond a single line if you are in a script file, then you are always in miniD mode, unless it sees %, which turns it to shell mode for a single line.
Apr 07 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Tue, Apr 7, 2009 at 3:30 PM, Steven Schveighoffer
<schveiguy yahoo.com> wrote:

 And regarding using it as an user shell: there's an interactive command
 line interpreter.

if you type ls, does it work, or do you have to type __run__("ls") or whatever?

I think it's things like this that are the reason a lot of attempts at turning general-purpose scripting languages into shells has failed. Despite the horrid mess that is bash's syntax, the syntax for simple commands is.. simple. Elegant, to a point. So what I've been considering is creating a modified version of MiniD. All that would be required is some modifications to the syntactic analyzer and a small library of functionality for very common shell tasks. The important part is the modifications to the syntactic analyzer. So suppose you started up this minishell or mdsh or whatever it's called. $ mdsh
 _

OK, go ahead and type some stuff.
 ls

 ls -a

 grep "hello" | sort

b: hello!
 _

Uh, ok, so it looks just like bash. What's happening under the hood is that when in interactive mode, the compiler is in "bash mode." It parses each line as a bash statement. But it's not actually bash: all it's doing is parsing the line and turning it into some kind of MiniD code under the hood. so `grep "hello" | sort` becomes instead "shell.exec("grep", "hello").pipe("sort")", or something like that. Then that is compiled into MiniD code and executed. The shell.exec function just spawns a new process and returns some process object which can be piped to another one. Then you have a simple "escaping" mechanism to switch between MiniD mode and bash mode. Something like %.
 %foreach(file; shell.ls())

.. writeln("processing file ", file) .. %something $file .. } processing file foo.d processing file bar.d processing file baz.d
 _

There. Now you have sane syntax for complex language constructs, but it's still simple to escape into bash mode to do shell-y stuff. Notice the "$file", which is a signal to the compiler to convert 'file' as a variable reference rather than as a string argument to the command. (It also follows that if you wrote a full shellscript, in a .mdsh file or something, the compiler would, when compiling it, start in MiniD mode by default so you wouldn't have to escape every statement with a %.) I know Alex wants to see this happen :P
Apr 07 2009
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 18:17:12 -0400, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 On Tue, Apr 7, 2009 at 3:30 PM, Steven Schveighoffer
 <schveiguy yahoo.com> wrote:

 And regarding using it as an user shell: there's an interactive command
 line interpreter.

if you type ls, does it work, or do you have to type __run__("ls") or whatever?

I think it's things like this that are the reason a lot of attempts at turning general-purpose scripting languages into shells has failed. Despite the horrid mess that is bash's syntax, the syntax for simple commands is.. simple. Elegant, to a point. So what I've been considering is creating a modified version of MiniD. All that would be required is some modifications to the syntactic analyzer and a small library of functionality for very common shell tasks. The important part is the modifications to the syntactic analyzer. So suppose you started up this minishell or mdsh or whatever it's called. $ mdsh
 _

OK, go ahead and type some stuff.
 ls

 ls -a

 grep "hello" | sort

b: hello!
 _

Uh, ok, so it looks just like bash. What's happening under the hood is that when in interactive mode, the compiler is in "bash mode." It parses each line as a bash statement. But it's not actually bash: all it's doing is parsing the line and turning it into some kind of MiniD code under the hood. so `grep "hello" | sort` becomes instead "shell.exec("grep", "hello").pipe("sort")", or something like that. Then that is compiled into MiniD code and executed. The shell.exec function just spawns a new process and returns some process object which can be piped to another one. Then you have a simple "escaping" mechanism to switch between MiniD mode and bash mode. Something like %. > %foreach(file; shell.ls()) .. { .. writeln("processing file ", file) .. %something $file .. } processing file foo.d processing file bar.d processing file baz.d > _ There. Now you have sane syntax for complex language constructs, but it's still simple to escape into bash mode to do shell-y stuff. Notice the "$file", which is a signal to the compiler to convert 'file' as a variable reference rather than as a string argument to the command. (It also follows that if you wrote a full shellscript, in a .mdsh file or something, the compiler would, when compiling it, start in MiniD mode by default so you wouldn't have to escape every statement with a %.) I know Alex wants to see this happen :P

This reminds me of jsp, where java is intermixed into html. When you want HTML, it's there, when you want java, you simply escape into java. It's not a bad idea. Not sure I'd use it, but I'd certainly try it :) I certainly could deal with D-like syntax more than python syntax. I'm a little confused on the escaping. In one example, it looks like % turns MiniD alternately on and off, yet you say you'd have to escape every line in a script file? If you meant the "on/off" style, the escaping should be more like open/closing (e.g. %< minid code >% ). Otherwise, it'd be hard to tell in the middle of the file whether you're in miniD or bash syntax. You should also be able to alias any miniD function that takes an array of strings to a shell "command". This would allow you to have a selected overlap between miniD and your PATH's namespace. Something like:
 %shell.alias("foo", &foo)
 foo a b "c d e"

which would be equivalent to calling foo("a", "b", "c d e"), even if there was a foo command in your path. BTW, never used miniD, so I don't know what's already possible. -Steve
Apr 07 2009
prev sibling next sibling parent Bill Baxter <wbaxter gmail.com> writes:
On Tue, Apr 7, 2009 at 9:47 AM, Denis Koroskin <2korden gmail.com> wrote:
 On Tue, 07 Apr 2009 04:41:39 +0400, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:

 Jussi Jumppanen wrote:
 Jason House Wrote:

 For example, as an emacs user, I can easilly program for an hour witho=




 touching my mouse.

=A0I would say 'not using the mouse' is clear sign the programmer is coding using a programmer's editor and not a modern day IDE. =A0I would also say many Windows programmers are completely lost without their IDE=



 this can makes them less productive as a developer.
 =A0They could make themselves better programmers by overcoming their
 addiction to the IDE.
 =A0 http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html
 =A0But programming on Windows without a mouse driven, language specific
 IDE, using nothing but the command line and a good editor is possible a=



 really quite easy to do.

=A0>
 As a commandline utility, it can be combined with other stuff such as
 ls, sort, grep, sed, awk, etc... I don't know if I'd start there thoug=




 =A0Replace ls with dir, download the Win32 version of grep, sed, awk an=



 you can run all those tools just fine from the Windows command line, or=



 within any decent editor.
 =A0You don't have to go to Unix to find the command line.

But all else is lacking, starting with a good shell. I guess it's possib=


 with cygwin et al, but then it feels a bit artificial and second-hand.

 Andrei

There is FAR, which is an amazing tool. Properly configured, it can do everything you will ever need. An it's Open-Source, too!

Link? Google gave me this: http://www.helpware.net/FAR/ which doesn't seem to be what you are talking about. --bb
Apr 06 2009
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Tue, Apr 07, 2009 at 11:11:44AM -0700, Walter Bright wrote:
 Andrei Alexandrescu wrote:
It took me a couple of minutes to write under her eyes a script that 
downloaded HTML, scraped the code for links, followed those of interest, 
and output a concatenation of all pages she was interested in, with 
details highlighted, that was loadable back in the browser. I'd show her 
one iteration, get feedback, and get the next iteration within seconds. 
All without "coding" in any sense as regularly understood by Windows 
programmers.

I have no idea how to do that under unix. I obviously have not learned anywhere near enough about it.

Load up vi, write the program, compile it with dmd, run it :P The command line is great for one line programs, but for anything complex, it gets to be really hard to follow. Writing D is no harder and much safer. -- Adam D. Ruppe http://arsdnet.net
Apr 07 2009
prev sibling next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Mon, Apr 06, 2009 at 10:29:57PM -0400, Christopher Wright wrote:
 The Windows terminal emulator sucks. This is not subject to debate.

What terminal emulator? This might be a bit of a nitpick, but Windows doesn't try to emulate a terminal (not in the OS anyway; there are hundreds of third party programs to do such) and it is better off for it. Unix hurls chunks for the actual terminal system. The programs are pretty decent, but the terminal itself - TERRIBLE. Tried to write an interactive program that makes full use of the keyboard and mouse? You can't get the shift key's state. It is a whole todo just to get the arrow keys. You can't depend on the escape key. You can't output data and expect it to be reliable (you have to depend on an environment variable to figure out what you're writing to and it often isn't accurate!) It gets worse as a user. Have you ever pressed delete and just got a ~? Pressed home and got a ~[B (or whatever the hell it is)? Tried to use a program with color after changing the background color of your window? Resized a window and had your text cut off? Go up through your history and get corrupted lines? The Unix terminal system is barely usable - NOT something anyone should ever try to emulate. The Windows console, on the other hand, is a lot better, though still has its warts. At least it is predictable though. -- Adam D. Ruppe http://arsdnet.net
Apr 06 2009
prev sibling next sibling parent Kagamin <spam here.lot> writes:
Andrei Alexandrescu Wrote:

 So the notion that there is a kernel catering 
 to your needs may warrant a closer look.

fix
Apr 07 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Tue, Apr 7, 2009 at 12:38 PM, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:
 I'll risk an example. A while ago my wife was looking for a place for her
 medical residency. There was an online service that would give her a long
 webpage with links to all institutions she was interested in. The links were
 in the hundreds. She had to click each, then a couple of others, then look
 through their program highlights to see some details she was interested in.
 Getting back or opening in new window were difficult due to some Javascript
 (of which disabling messed things up). All in all it was a very tedious
 task.

 It took me a couple of minutes to write under her eyes a script that
 downloaded HTML, scraped the code for links, followed those of interest, and
 output a concatenation of all pages she was interested in, with details
 highlighted, that was loadable back in the browser. I'd show her one
 iteration, get feedback, and get the next iteration within seconds. All
 without "coding" in any sense as regularly understood by Windows
 programmers.

I did pretty much the exact same thing in Python on Windows. For that matter, if it's bash scripting that really sets Unix apart from Windows, well no thanks, I'll have no part in it. It's a horrible language. I rank it lower than PHP. Virtually any other scripting language is better, and they're all cross-platform.
Apr 07 2009
prev sibling parent reply Ralf Schneider <lists gestaltgeber.com> writes:
 If I were to quickly give the most significant bit of my opinion, that 
 would be this: Unix is for programmers and Windows is for end users. As 
 such, even though both ultimately accomplish the task of putting a 
 computer's resources at your disposal, their foci are different. You're 
 a programmer. So the notion that there is an operating system catering 
 to your needs may warrant a closer look.

Well, to have at least one different opinion: I'm playing around with Linux since the first year when Linus released the source code. I have hacked the kernel for fun. I'm usix AIX, HP-UX, Red Hat, Solaris and Windows at work as a programmer. And my opinion is: *NIX sucks. Linux was great comapred to DOS and Windows 3.11. But since Windows NT4.0 - Linux (POSIX) just seems outdated. Quality and stability of APIs, general Architecture, documentation, etc. I prefer Windows any time. I hate emacs and vi. The command line tools are OK, but nothing compared to a modern IDE with a stable debugger and analysis tools like "Source Insight". Everything on Unix feels like it was 20 years ago. Nothing seems to change, the old poor tools. No progress, just stagnation. Oh I forgot to mention "Shell scripts!" - UAHHHHH! Ever tried python or ruby? I seriously think Unix fetishists are masochists... Yes I can programm in vi and compile on the command line - if necessary. But I expect more after 20 years of tools development!!! To be fair: I think AIX and HP-UX are really rock solid! But I would never use a server os as a desktop os! What I want from an OS as a progammer: Performance! High responsive GUI. Powerfull professional tools, like a modern IDE. Stable APIs. Good documentation. Windows can deliver. I have never touched OSX. So I don't know. Linux as a desktop is a kindergarten of wannabe design archtiects: Wobbling windows, KDE disaster, permanent changing APIs, slow performance (ever compared Eclipse on Windows and Linux?). Linux as a server: Is OK. I mean it's free! I don't expect the same reliability as AIX... - Ralf
Apr 07 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Ralf Schneider wrote:
 If I were to quickly give the most significant bit of my opinion, that 
 would be this: Unix is for programmers and Windows is for end users. 
 As such, even though both ultimately accomplish the task of putting a 
 computer's resources at your disposal, their foci are different. 
 You're a programmer. So the notion that there is an operating system 
 catering to your needs may warrant a closer look.

Well, to have at least one different opinion: I'm playing around with Linux since the first year when Linus released the source code. I have hacked the kernel for fun. I'm usix AIX, HP-UX, Red Hat, Solaris and Windows at work as a programmer. And my opinion is: *NIX sucks. Linux was great comapred to DOS and Windows 3.11. But since Windows NT4.0 - Linux (POSIX) just seems outdated. Quality and stability of APIs, general Architecture, documentation, etc. I prefer Windows any time. I hate emacs and vi. The command line tools are OK, but nothing compared to a modern IDE with a stable debugger and analysis tools like "Source Insight". Everything on Unix feels like it was 20 years ago. Nothing seems to change, the old poor tools. No progress, just stagnation. Oh I forgot to mention "Shell scripts!" - UAHHHHH! Ever tried python or ruby? I seriously think Unix fetishists are masochists... Yes I can programm in vi and compile on the command line - if necessary. But I expect more after 20 years of tools development!!! To be fair: I think AIX and HP-UX are really rock solid! But I would never use a server os as a desktop os! What I want from an OS as a progammer: Performance! High responsive GUI. Powerfull professional tools, like a modern IDE. Stable APIs. Good documentation. Windows can deliver. I have never touched OSX. So I don't know. Linux as a desktop is a kindergarten of wannabe design archtiects: Wobbling windows, KDE disaster, permanent changing APIs, slow performance (ever compared Eclipse on Windows and Linux?). Linux as a server: Is OK. I mean it's free! I don't expect the same reliability as AIX... - Ralf

Well at least you've got to make up your mind. It's amazing how you mention instability in three instances and stagnation in two instances, without ever noticing the irony. What's happening? Andrei
Apr 07 2009
next sibling parent Don <nospam nospam.com> writes:
Andrei Alexandrescu wrote:
 Ralf Schneider wrote:
 If I were to quickly give the most significant bit of my opinion, 
 that would be this: Unix is for programmers and Windows is for end 
 users. As such, even though both ultimately accomplish the task of 
 putting a computer's resources at your disposal, their foci are 
 different. You're a programmer. So the notion that there is an 
 operating system catering to your needs may warrant a closer look.

Well, to have at least one different opinion: I'm playing around with Linux since the first year when Linus released the source code. I have hacked the kernel for fun. I'm usix AIX, HP-UX, Red Hat, Solaris and Windows at work as a programmer. And my opinion is: *NIX sucks. Linux was great comapred to DOS and Windows 3.11. But since Windows NT4.0 - Linux (POSIX) just seems outdated. Quality and stability of APIs, general Architecture, documentation, etc. I prefer Windows any time. I hate emacs and vi. The command line tools are OK, but nothing compared to a modern IDE with a stable debugger and analysis tools like "Source Insight". Everything on Unix feels like it was 20 years ago. Nothing seems to change, the old poor tools. No progress, just stagnation. Oh I forgot to mention "Shell scripts!" - UAHHHHH! Ever tried python or ruby? I seriously think Unix fetishists are masochists... Yes I can programm in vi and compile on the command line - if necessary. But I expect more after 20 years of tools development!!! To be fair: I think AIX and HP-UX are really rock solid! But I would never use a server os as a desktop os! What I want from an OS as a progammer: Performance! High responsive GUI. Powerfull professional tools, like a modern IDE. Stable APIs. Good documentation. Windows can deliver. I have never touched OSX. So I don't know. Linux as a desktop is a kindergarten of wannabe design archtiects: Wobbling windows, KDE disaster, permanent changing APIs, slow performance (ever compared Eclipse on Windows and Linux?).


Is Eclipse SLOWER on Linux than Windows? It's notoriously slow on Windows!
 Linux as a server: Is OK. I mean it's free! I don't expect the same 
 reliability as AIX...

 - Ralf

Well at least you've got to make up your mind. It's amazing how you mention instability in three instances and stagnation in two instances, without ever noticing the irony. What's happening? Andrei

The instability seemed to be about "Linux as a desktop".
Apr 07 2009
prev sibling parent reply Ralf Schneider <lists gestaltgeber.com> writes:
 Well at least you've got to make up your mind. It's amazing how you 
 mention instability in three instances and stagnation in two instances, 
 without ever noticing the irony. What's happening?

Instability: Red hat crashes most often. AIX, Solaris and HP-UX just run. Windows crashes sometimes. (Very personal observation, of course) Instable APIs: POSIX is stable. Most other *NIX APIs regarding Audio, GUI, Graphics and others are constantly changing, with very little visible progress. What is not covered by POSIX is different on ever Unix flavour: Hot do you get the peak virtual memory usage on AIX, Linux and Solaris? Windows: APIs are usually stable. New APIs with new concepts are introduced beside existsing APIs. Yes there is a lot of cruft. And windows is defintetly not "perfect"!!! In no way! It just sucks less (TM) Stagnation: On *NIX: same (command line) tools, same concepts (everything is a file) as decades ago. New ideas are usually copied badly from Apple or Windows years later. So, again: As a desktop and programming environment I prefer Windows. May be I would prefer OS X if I knew it. As a server: I would use and suggest UNIX. May be even Red Hat is OK and the crashes we experience is a temporary problem and are hardware related.
Apr 07 2009
parent reply grauzone <none example.net> writes:
 Stagnation: On *NIX: same (command line) tools, same concepts 
 (everything is a file) as decades ago. New ideas are usually copied 
 badly from Apple or Windows years later.

What exciting new concepts are there under Windows? Drive letters?
Apr 07 2009
parent superdan <super dan.org> writes:
grauzone Wrote:

 Stagnation: On *NIX: same (command line) tools, same concepts 
 (everything is a file) as decades ago. New ideas are usually copied 
 badly from Apple or Windows years later.

What exciting new concepts are there under Windows? Drive letters?

fuckin' ole. bill gates deserves a double dry fisting only for ole. fuck windows. cant believe theres actual windows fans out there. its like pedophilia or sum'th'n'. "windows delivers." eat shit. at least keep the dirt to yerself so i dun puke my funckin' lunch. what a moron.
Apr 07 2009
prev sibling parent Sean Kelly <sean invisibleduck.org> writes:
Saaa wrote:
 Yah, I too remember my Windows-only days the way I'd remember a temporary 
 disability. (I recall to this day: any little thing I wanted to do, I'd 
 start off a wizard in Dev Studio. It was kind of a surprise for me to find 
 out that all those programs had been written, along with plenty more.) 
 Being a user is one thing, but I think a programmer who only does Windows 
 is seriously impaired.

 Andrei

Could you please convince me to add a Linux install again. I'd rather use open source than a commercial os, but until now I don't know what I am missing.

Ubuntu is the easiest OS install I've ever done. Assuming you've got the drive space or some VM software there's no reason not to at least try it.
Apr 07 2009
prev sibling next sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Warning: semi-rant ahead.  Feel free to ignore.  :)

Sean Kelly wrote:
 My
 Windows machine is now used exclusively for playing games.  I have no
 intention of ever using Windows for anything else again.  Games are
 the only thing the other OSes lack compared to Windows anyway.

Winamp. More specifically, Winamp 5 + the DSP plugins I use; without that, all my music sounds *wrong*. Wine just can't seem to run Winamp properly. And please don't anyone "recommend" any of the linux-specific players... they're either too bare-bones to be usable, or are pretending to be iTunes. I HATE iTunes. That and general usability. It's likely I'm just biased because I've used Windows for so long, but there seems to be a long stream of things that don't work "right" in Linux. Little things like mounting media, keyboard shortcuts on GUI widgets, navigating folders in the GUI with the keyboard, or that every second application uses different dialogs. :S
 Whenever the endless debate of windows vs. linux vs. mac comes up, I
 repeat my comment: if you are a programmer, you better acquire some
 experience in each. For Windows/Mac it's not as easy because they may
 cost money, but now with virtual machines, good distributions etc. I
 think there is no excuse for a programmer to not seriously looking into
 Unix.


I have an Ubuntu VM lying around somewhere. Aside from being broken, I could never find any reason to use the thing.
 I desperately wish my computer-illiterate family members would move
 off of Windows as well, since it would eliminate basically every tech-
 support call I field from them.  Perhaps I've simply had good luck with
 other OSes, but Windows is the only one I've had regular problems with.

It's funny, but for me it's exactly the opposite. I make an effort to switch to linux about once a year. There's always, ALWAYS, something that goes horribly wrong that just can't be fixed. Up until about two/three years ago, it was sound; I simply could not make noise come out of the speakers [1]. Weird thing was that it would sometimes work with the Live CD, but once installed it would stop working. I only got it working when I accidentally discovered that the open-source drivers for my Creative card DISABLE SOUND BY DEFAULT. I'm hard pressed to think of a stupider default setting. Currently, the major technical issue with linux is that it's seemingly incapable of doing multiple monitors properly. I've got two monitors in a specific physical arrangement with different resolutions. This causes no end of issues, since X or Gnome or something seems to assume all monitors are the same size. But it IS improving. The previous time I tried it, I had one LCD and one CRT. The built-in multi-monitor config applet ended up rendering my machine unbootable. And if nothing else, at least it isn't showing new windows up between the two monitors, although it still has trouble working out WHICH monitor to show any given window on. Let's not even touch goddamn graphics drivers. Windows is a pain in the arse, and there isn't a day that goes by where I don't wish I could get rid of it from my life. But the fact is that it's STILL better than Linux. Andrei said that Windows is for users, and unix is for programmers. That's fine; I'm a programmer! But I'm also a user. I shouldn't have to spend all day to work out how to do something in linux that's trivial in Windows. I'd almost be tempted to switch to Mac OSX if it weren't for the entire machine, hardware and software (sans BSD), driving me up the wall...
 As for programming specifically... I made a deliberate shift away from
 Windows years ago because it's a nightmare to develop for (aside from
 Visual Studio, which is a great debugging environment).  Best move I
 ever made.

I don't really see this. From the last several years of using Cygwin, I'm not sure what it is that would be markedly better. I WANT to get off Windows. But whatever I switch to would have to be better by a fair margin to offset the cost of re-learning how to do stuff. And as far as I've been able to discern, Linux isn't it. -- Daniel [1] Which is sad when you consider the last time I had sound problems was with Win 95; by Win 98SE, sound always just worked.
Apr 06 2009
next sibling parent "Saaa" <empty needmail.com> writes:
Ignoring the rant way of putting things this is exactly my experience :D
plus: I'd ike to be able to run every tiny indiegame out there.

 Warning: semi-rant ahead.  Feel free to ignore.  :)

 Sean Kelly wrote:
 My
 Windows machine is now used exclusively for playing games.  I have no
 intention of ever using Windows for anything else again.  Games are
 the only thing the other OSes lack compared to Windows anyway.

Winamp. More specifically, Winamp 5 + the DSP plugins I use; without that, all my music sounds *wrong*. Wine just can't seem to run Winamp properly. And please don't anyone "recommend" any of the linux-specific players... they're either too bare-bones to be usable, or are pretending to be iTunes. I HATE iTunes. That and general usability. It's likely I'm just biased because I've used Windows for so long, but there seems to be a long stream of things that don't work "right" in Linux. Little things like mounting media, keyboard shortcuts on GUI widgets, navigating folders in the GUI with the keyboard, or that every second application uses different dialogs. :S
 Whenever the endless debate of windows vs. linux vs. mac comes up, I
 repeat my comment: if you are a programmer, you better acquire some
 experience in each. For Windows/Mac it's not as easy because they may
 cost money, but now with virtual machines, good distributions etc. I
 think there is no excuse for a programmer to not seriously looking into
 Unix.


I have an Ubuntu VM lying around somewhere. Aside from being broken, I could never find any reason to use the thing.
 I desperately wish my computer-illiterate family members would move
 off of Windows as well, since it would eliminate basically every tech-
 support call I field from them.  Perhaps I've simply had good luck with
 other OSes, but Windows is the only one I've had regular problems with.

It's funny, but for me it's exactly the opposite. I make an effort to switch to linux about once a year. There's always, ALWAYS, something that goes horribly wrong that just can't be fixed. Up until about two/three years ago, it was sound; I simply could not make noise come out of the speakers [1]. Weird thing was that it would sometimes work with the Live CD, but once installed it would stop working. I only got it working when I accidentally discovered that the open-source drivers for my Creative card DISABLE SOUND BY DEFAULT. I'm hard pressed to think of a stupider default setting. Currently, the major technical issue with linux is that it's seemingly incapable of doing multiple monitors properly. I've got two monitors in a specific physical arrangement with different resolutions. This causes no end of issues, since X or Gnome or something seems to assume all monitors are the same size. But it IS improving. The previous time I tried it, I had one LCD and one CRT. The built-in multi-monitor config applet ended up rendering my machine unbootable. And if nothing else, at least it isn't showing new windows up between the two monitors, although it still has trouble working out WHICH monitor to show any given window on. Let's not even touch goddamn graphics drivers. Windows is a pain in the arse, and there isn't a day that goes by where I don't wish I could get rid of it from my life. But the fact is that it's STILL better than Linux. Andrei said that Windows is for users, and unix is for programmers. That's fine; I'm a programmer! But I'm also a user. I shouldn't have to spend all day to work out how to do something in linux that's trivial in Windows. I'd almost be tempted to switch to Mac OSX if it weren't for the entire machine, hardware and software (sans BSD), driving me up the wall...
 As for programming specifically... I made a deliberate shift away from
 Windows years ago because it's a nightmare to develop for (aside from
 Visual Studio, which is a great debugging environment).  Best move I
 ever made.

I don't really see this. From the last several years of using Cygwin, I'm not sure what it is that would be markedly better. I WANT to get off Windows. But whatever I switch to would have to be better by a fair margin to offset the cost of re-learning how to do stuff. And as far as I've been able to discern, Linux isn't it. -- Daniel [1] Which is sad when you consider the last time I had sound problems was with Win 95; by Win 98SE, sound always just worked.

Apr 06 2009
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Daniel Keep wrote:
 Warning: semi-rant ahead.  Feel free to ignore.  :)

 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life.  But the fact is that
 it's STILL better than Linux.
 
 Andrei said that Windows is for users, and unix is for programmers.
 That's fine; I'm a programmer!  But I'm also a user.  I shouldn't have
 to spend all day to work out how to do something in linux that's trivial
 in Windows.

What you don't realize is that you spend all day to work out how to do something in Windows that's trivial in Unix. And that "something" is writing computer programs. I agree that winamp, games, ..., are much more polished in Windows. I mean, it's a foregone conclusion. It's the core market of Windows! Now here's the thing: mono-culturalism is worse than either Windows or Unix bigotry. If you know the OS, go ahead, rant all you want about it. But I have little consideration for rants against some OS from people who don't know it. And the situation isn't symmetric, which is liable to raise an eyebrow. I only know two persons who know Unix and prefer Windows. One worked for Microsoft, the other loves every big American company and is in fact a Microsoft fan (nothing wrong with that). All others I know disliking Unix actually don't know it. On the other hand, I know plenty of programmers who know both Unix and Windows programming and can't bring themselves to think seriously about getting work done in Windows. I also know Unix zealots who have no idea about Windows, and their rants are pretty damaging (Richard Stallman only tried to use Word once and was unable to do anything with it - too many confusing menus and buttons... a sad case of monoculture.) Finally, programmers who only know Windows kind of just don't know better so they take it as a given without becoming fans and that's that.
 I'd almost be tempted to switch to Mac OSX if it weren't for the entire
 machine, hardware and software (sans BSD), driving me up the wall...
 
 As for programming specifically... I made a deliberate shift away from
 Windows years ago because it's a nightmare to develop for (aside from
 Visual Studio, which is a great debugging environment).  Best move I
 ever made.

I don't really see this. From the last several years of using Cygwin, I'm not sure what it is that would be markedly better. I WANT to get off Windows. But whatever I switch to would have to be better by a fair margin to offset the cost of re-learning how to do stuff. And as far as I've been able to discern, Linux isn't it.

I guess it sort of depends what "it" is. I agree that getting Unix to install with drivers and all can be a bitch, even with Ubuntu. Even beyond installation, all OSs have annoying quirks that take getting used to. And for someone with the attitude "I'll give you this long to impress me" the initial hurdles can be a deal breaker. Andrei
Apr 06 2009
parent Christopher Wright <dhasenan gmail.com> writes:
Andrei Alexandrescu wrote:
 Daniel Keep wrote:
 Warning: semi-rant ahead.  Feel free to ignore.  :)

 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life.  But the fact is that
 it's STILL better than Linux.

 Andrei said that Windows is for users, and unix is for programmers.
 That's fine; I'm a programmer!  But I'm also a user.  I shouldn't have
 to spend all day to work out how to do something in linux that's trivial
 in Windows.

What you don't realize is that you spend all day to work out how to do something in Windows that's trivial in Unix. And that "something" is writing computer programs.

I disagree. While it is easier to write small programs in Unix, non-trivial programs are nearly always written with IDEs, and IDEs tend to try to take over most of the tasks for which you would typically use a command line. Non-trivial programs need semantics-aware refactoring rather than simple sed-style replacements. Still, I think vim + screen makes a pretty good IDE.
Apr 06 2009
prev sibling next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Daniel Keep wrote:
 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life.  But the fact is that
 it's STILL better than Linux.

What I've found about Windows is it consistently renders things better on the same display. In other words, text is more readable and easier on the eyes. I've spent a lot of time tweaking settings on Ubuntu, but it's still not as good (especially in firefox). I was recently told that the trouble must be the graphics driver. I haven't spent any effort yet trying to track that one down. On the other hand, I've found Ubuntu to be far smoother at multitasking than Windows, which frequently freezes for several seconds for no obvious reason. I find myself more and more switching back and forth between the two for specific tasks (I use a KVM switch to go back and forth). For example, my music files are hosted on a windows share but the player is running on Ubuntu.
Apr 06 2009
next sibling parent reply Christopher Wright <dhasenan gmail.com> writes:
Walter Bright wrote:
 Daniel Keep wrote:
 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life.  But the fact is that
 it's STILL better than Linux.

What I've found about Windows is it consistently renders things better on the same display. In other words, text is more readable and easier on the eyes. I've spent a lot of time tweaking settings on Ubuntu, but it's still not as good (especially in firefox).

This is a matter of opinion and particular fonts. I have found fonts that render horribly on Ubuntu and wonderfully on Windows, and I have found fonts that render wonderfully on Ubuntu and horribly on Windows. But another person might have the opposite opinions of the same fonts. The fonts I end up using on Windows are the MS ClearType designed fonts. The ones I use on Linux are Chaparral Pro and Cronos Pro. (I use Droid Sans Mono on both platforms as a monospace font.) I have never gotten MS core fonts to look good on Linux. This is all assuming that you turned on subpixel rendering in Linux.
Apr 06 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Christopher Wright wrote:
 This is all assuming that you turned on subpixel rendering in Linux.

Yes, I turned it on <g>.
Apr 06 2009
prev sibling next sibling parent reply grauzone <none example.net> writes:
Walter Bright wrote:
 Daniel Keep wrote:
 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life.  But the fact is that
 it's STILL better than Linux.

What I've found about Windows is it consistently renders things better on the same display. In other words, text is more readable and easier on the eyes. I've spent a lot of time tweaking settings on Ubuntu, but it's still not as good (especially in firefox).

The free fonts suck, and I still use some Microsoft fonts on Linux. Especially Courier New and Verdana. I also used Microsoft Sans Serif, but somehow the freetype renderer (which all applications use nowadays) had problems with this particular font.
Apr 07 2009
parent reply bearophile <bearophileHUGS lycos.com> writes:
grauzone:
The free fonts suck, and I still use some Microsoft fonts on Linux.<

Have you tried my version of Inconsolata? :-) http://www.fantascienza.net/leonardo/ar/inconsolatag/inconsolata-g_font.zip Bye, bearophile
Apr 07 2009
parent reply grauzone <none example.net> writes:
bearophile wrote:
 grauzone:
 The free fonts suck, and I still use some Microsoft fonts on Linux.<

Have you tried my version of Inconsolata? :-) http://www.fantascienza.net/leonardo/ar/inconsolatag/inconsolata-g_font.zip

Will try later. Success depends from how well freetype renders it at low resolutions.
 Bye,
 bearophile

Apr 07 2009
parent reply bearophile <bearophileHUGS lycos.com> writes:
grauzone:
 Will try later. Success depends from how well freetype renders it at low 
 resolutions.

I use it as my default programming font on my Ubuntu (for Python, D, etc), it's nonproportional. But I use it at high enough sizes, to spot bugs better. Bye, bearophile
Apr 07 2009
parent reply grauzone <none example.net> writes:
bearophile wrote:
 grauzone:
 Will try later. Success depends from how well freetype renders it at low 
 resolutions.

I use it as my default programming font on my Ubuntu (for Python, D, etc), it's nonproportional. But I use it at high enough sizes, to spot bugs better.

The font rendering is very very ugly. At which point size/DPI is this font supposed to be displayed?
 Bye,
 bearophile

Apr 07 2009
parent reply bearophile <bearophileHUGS lycos.com> writes:
grauzone:
 The font rendering is very very ugly. At which point size/DPI is this 
 font supposed to be displayed?

I use it at about this size, and I find it the most readable among all the ones I have tried so far: http://www.fantascienza.net/leonardo/ar/inconsolatag/two_inconsolata_20090213.png Bye, bearophile
Apr 07 2009
parent grauzone <none example.net> writes:
bearophile wrote:
 grauzone:
 The font rendering is very very ugly. At which point size/DPI is this 
 font supposed to be displayed?

I use it at about this size, and I find it the most readable among all the ones I have tried so far: http://www.fantascienza.net/leonardo/ar/inconsolatag/two_inconsolata_20090213.png

Maybe my text editor (kate) is screwing up. And normally, I'm using a much smaller font. Courier New 9 pt at (I think) 96 DPI, without anti-aliasing, on a CRT.
 Bye,
 bearophile

Apr 07 2009
prev sibling parent reply Lutger <lutger.blijdestijn gmail.com> writes:
Walter Bright wrote:
...
 I find myself more and more switching back and forth between the two for 
 specific tasks (I use a KVM switch to go back and forth).

Have you ever tried virtualbox? It has a seamless mode, which tears out windows apps in the virtual instance and make them behave just as if you started them under linux. It's very pleasant, you don't have to switch anything anymore and just run those windows userthings next to your gnome / kde applications.
Apr 07 2009
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Lutger wrote:
 Have you ever tried virtualbox? It has a seamless mode, which tears out 
 windows apps in the virtual instance and make them behave just as if you 
 started them under linux. It's very pleasant, you don't have to switch 
 anything anymore and just run those windows userthings next to your gnome / 
 kde applications.

Nope, never tried it! I just have a bad experience with multiboot systems in the past, and have tended to avoid them.
Apr 07 2009
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Jarrett Billingsley wrote:
 VMs have nothing to do with multiboot.  I have Ubuntu in a Sun
 Virtualbox on my desktop and it's wonderful.  It's fun to watch an OS
 start in a window.  I can also share a folder across the boundary; the
 clipboard works seamlessly; input grabbing is nearly seamless.  And
 since I can share folders, I can do fun things like work on a DS
 project in my favorite Windows code editor, make graphics for it in
 CS2, compile it using GDC on the Linux side, and run it in an emulator
 on the Windows side.  I have the best of both worlds without any need
 to have multiple partitions or reboot.

I know. I really must try it!
Apr 07 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Walter Bright wrote:
 Jarrett Billingsley wrote:
 VMs have nothing to do with multiboot.  I have Ubuntu in a Sun
 Virtualbox on my desktop and it's wonderful.  It's fun to watch an OS
 start in a window.  I can also share a folder across the boundary; the
 clipboard works seamlessly; input grabbing is nearly seamless.  And
 since I can share folders, I can do fun things like work on a DS
 project in my favorite Windows code editor, make graphics for it in
 CS2, compile it using GDC on the Linux side, and run it in an emulator
 on the Windows side.  I have the best of both worlds without any need
 to have multiple partitions or reboot.

I know. I really must try it!

sudo apt-get install virtualbox Highly recommended. Andrei
Apr 07 2009
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 sudo apt-get install virtualbox

That's too hard for me. Can you make it easier?
Apr 07 2009
next sibling parent Michel Fortin <michel.fortin michelf.com> writes:
On 2009-04-07 16:55:05 -0400, Walter Bright <newshound1 digitalmars.com> said:

 Andrei Alexandrescu wrote:
 sudo apt-get install virtualbox

That's too hard for me. Can you make it easier?

alias please="sudo apt-get" then please install virtualbox -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Apr 07 2009
prev sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Walter Bright wrote:
 Andrei Alexandrescu wrote:
 sudo apt-get install virtualbox

That's too hard for me. Can you make it easier?

apt://virtualbox-ose You would still need your administrator password, and to have "apturl" installed (http://apturl.net) and it doesn't handle virtual packages very well. But it still is "easier"... ? See also PackageKit. --anders
Apr 08 2009
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 sudo apt-get install virtualbox
 
 Highly recommended.

Ok, gave it a try. The install worked. So, I set up a virtual box per instructions, and tried to boot my netbsd CD in it. (netbsd because it's small so I can get a quick test.) I get this message (copied from the internet as it's the same someone else got): ==================================================== FuLio says: December 12, 2008 at 3:05 am VirtualBox kernel driver not installed. The vboxdrv kernel module was either not loaded or /dev/vboxdrv was not created for some reason. Please install the virtualbox-ose-modules package for your kernel, e.g. virtualbox-ose-modules-generic.. VBox status code: -1908 (VERR_VM_DRIVER_NOT_INSTALLED). Result Code: 080004005 Component: Console Interface: IConsole {1dea5c4b-0753-4193-b909-22330f64ec45} Reply ===================================================== The helpful reply is: ===================================================== Damien Reply: December 12th, 2008 at 3:22 am There is a conflict in kernels in the latest Ubuntu Intrepid kernel update. Try to rebuild the vbox kernel: sudo /etc/init.d/vboxdrv setup Reply ==================================================== So, I "try" it: ==================================================== ~> sudo /etc/init.d/vboxdrv setup * Usage: /etc/init.d/vboxdrv {start|stop|restart|status} ~> sudo /etc/init.d/vboxdrv status * VirtualBox kernel module is not loaded. ~> sudo /etc/init.d/vboxdrv start * Starting VirtualBox kernel module vboxdrv * No suitable module for running kernel found. ~> ===================================================== Oh well.
Apr 08 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
I saw another 'fix' on another forum that listed some commands to 
rebuild the vbox. That dies with compilation errors.
Apr 08 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Walter Bright wrote:
 I saw another 'fix' on another forum that listed some commands to 
 rebuild the vbox. That dies with compilation errors.

What happens is that the release in the apt repository lagged behind updates in the kernel. You may want to go to www.virtualbox.org and install the latest and greatest straight from there (their .deb package which you need to also integrate in the build proces for dmd). Andrei
Apr 08 2009
next sibling parent torhu <no spam.invalid> writes:
On 09.04.2009 03:53, Andrei Alexandrescu wrote:
 Walter Bright wrote:
  I saw another 'fix' on another forum that listed some commands to
  rebuild the vbox. That dies with compilation errors.

What happens is that the release in the apt repository lagged behind updates in the kernel. You may want to go to www.virtualbox.org and install the latest and greatest straight from there (their .deb package which you need to also integrate in the build proces for dmd). Andrei

Virtualbox works like charm on Windows. ;)
Apr 08 2009
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 Walter Bright wrote:
 I saw another 'fix' on another forum that listed some commands to 
 rebuild the vbox. That dies with compilation errors.

What happens is that the release in the apt repository lagged behind updates in the kernel. You may want to go to www.virtualbox.org and install the latest and greatest straight from there (their .deb package which you need to also integrate in the build proces for dmd).

Downloaded it. First, it refused to install because it conflicted with "virtualbox-ose". So I did: sudo apt-get purge virtualbox-ose Tried again to install it. Now I get: Error: Dependency is not satisfiable: libqt4-core So I tried: sudo apt-get libqt4-core but apt-get said it couldn't find it. Just for fun, I now tried: sudo apt-get install virtualbox and apt-get replies with: "Couldn't find package virtualbox" Evidently, my system is completely hosed now.
Apr 08 2009
next sibling parent dsimcha <dsimcha yahoo.com> writes:
== Quote from Adam D. Ruppe (destructionator gmail.com)'s article
 On Wed, Apr 08, 2009 at 08:33:11PM -0700, Walter Bright wrote:
 and apt-get replies with: "Couldn't find package virtualbox"

 Evidently, my system is completely hosed now.

Waste of bloody time that would better be spent on solving the underlying problem: too damn many combinations of options and dependencies. What works for one person is unlikely to work for another. This is one reason why I rather like Phobos being statically linked like it is. If you download a D binary, it is going to run; it is self contained. (I also really love dmc and dmd for being self-contained too.) If it was dynamically linked, someone would be tempted to package it up separately and you'd get into all kinds of dependency hell. And for what? 300k in the binary? Not worth it.

Yeah, it seems like in this age of dirt cheap storage and memory, dynamic linking is often more trouble than it's worth. It definitely makes things more complicated. When _is_ the tradeoff worth it for dynamic linking? Also, as far as Phobos being dynamically linked, that would never work well anyhow because so much of it is templates.
Apr 08 2009
prev sibling next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
Adam D. Ruppe wrote:
 On Wed, Apr 08, 2009 at 08:33:11PM -0700, Walter Bright wrote:
 and apt-get replies with: "Couldn't find package virtualbox"

 Evidently, my system is completely hosed now.

Aren't package managers swell? Waste of bloody time that would better be spent on solving the underlying problem: too damn many combinations of options and dependencies. What works for one person is unlikely to work for another. This is one reason why I rather like Phobos being statically linked like it is. If you download a D binary, it is going to run; it is self contained. (I also really love dmc and dmd for being self-contained too.) If it was dynamically linked, someone would be tempted to package it up separately and you'd get into all kinds of dependency hell. And for what? 300k in the binary? Not worth it.

I've always felt the same way about dynamic libraries. They're useful for solving certain problems like plug-ins, but for simply saving app memory the problems vastly outweigh the benefits.
Apr 08 2009
parent reply Christopher Wright <dhasenan gmail.com> writes:
Sean Kelly wrote:
 Adam D. Ruppe wrote:
 On Wed, Apr 08, 2009 at 08:33:11PM -0700, Walter Bright wrote:
 and apt-get replies with: "Couldn't find package virtualbox"

 Evidently, my system is completely hosed now.

Aren't package managers swell? Waste of bloody time that would better be spent on solving the underlying problem: too damn many combinations of options and dependencies. What works for one person is unlikely to work for another. This is one reason why I rather like Phobos being statically linked like it is. If you download a D binary, it is going to run; it is self contained. (I also really love dmc and dmd for being self-contained too.) If it was dynamically linked, someone would be tempted to package it up separately and you'd get into all kinds of dependency hell. And for what? 300k in the binary? Not worth it.

I've always felt the same way about dynamic libraries. They're useful for solving certain problems like plug-ins, but for simply saving app memory the problems vastly outweigh the benefits.

On the other hand, I don't want every application to include its own libssl or libpam; I want to be able to get security updates to those without updating every individual program. And then I think of all the times that there have been buffer overflow issues in jpg libraries and the like, and I want those to share security updates. I wouldn't mind updating every application that depends on said libraries normally, but I'm usually on a very good internet connection (30Mbps). Right now, I'm on 2Mbps, and that would suck.
Apr 09 2009
parent Sean Kelly <sean invisibleduck.org> writes:
Christopher Wright wrote:
 Sean Kelly wrote:
 I've always felt the same way about dynamic libraries.  They're useful 
 for solving certain problems like plug-ins, but for simply saving app 
 memory the problems vastly outweigh the benefits.

On the other hand, I don't want every application to include its own libssl or libpam; I want to be able to get security updates to those without updating every individual program.

Yeah true, that's a good reason for using them.
Apr 09 2009
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Walter Bright wrote:
 Evidently, my system is completely hosed now.

I took this opportunity to upgrade from 8.04 to 8.10. This seems to have gotten it working again.
Apr 08 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Walter Bright wrote:
 I took this opportunity to upgrade from 8.04 to 8.10. This seems to have 
 gotten it working again.

I tried to install netbsd under it, and it repeatedly failed with "disk write" errors, different every time. I finally gave up. Then I tries to install Red Hat, which would fail on CD #2 with a message about the CD being corrupted. So I burned a new CD #2 from the iso, which failed in the same way in the same place. Next I tried mounting the .iso's directly instead, and that worked. Go figure. Anyhow, the R.H. install works fine.
Apr 09 2009
prev sibling parent Tomas Lindquist Olsen <tomas.l.olsen gmail.com> writes:
On Thu, Apr 9, 2009 at 7:42 AM, Walter Bright
<newshound1 digitalmars.com> wrote:
 Walter Bright wrote:
 Evidently, my system is completely hosed now.

I took this opportunity to upgrade from 8.04 to 8.10. This seems to have gotten it working again.

I always wondered why Ubuntu got so popular with the surprisingly crappy package management it provides. More users should try ArchLinux ;) -Tomas
Apr 09 2009
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Wed, Apr 08, 2009 at 08:33:11PM -0700, Walter Bright wrote:
 and apt-get replies with: "Couldn't find package virtualbox"
 
 Evidently, my system is completely hosed now.

Aren't package managers swell? Waste of bloody time that would better be spent on solving the underlying problem: too damn many combinations of options and dependencies. What works for one person is unlikely to work for another. This is one reason why I rather like Phobos being statically linked like it is. If you download a D binary, it is going to run; it is self contained. (I also really love dmc and dmd for being self-contained too.) If it was dynamically linked, someone would be tempted to package it up separately and you'd get into all kinds of dependency hell. And for what? 300k in the binary? Not worth it. -- Adam D. Ruppe http://arsdnet.net
Apr 08 2009
prev sibling next sibling parent reply Olli Aalto <oaalto gmail.com> writes:
Check out Portable Ubuntu for Windows: 
http://portableubuntu.sourceforge.net/index.php

I haven't done any extensive testing yet, but the short session I had 
yesterday worked just fine.

Daniel Keep wrote:
 Warning: semi-rant ahead.  Feel free to ignore.  :)
 
 Sean Kelly wrote:
 My
 Windows machine is now used exclusively for playing games.  I have no
 intention of ever using Windows for anything else again.  Games are
 the only thing the other OSes lack compared to Windows anyway.

Winamp. More specifically, Winamp 5 + the DSP plugins I use; without that, all my music sounds *wrong*. Wine just can't seem to run Winamp properly. And please don't anyone "recommend" any of the linux-specific players... they're either too bare-bones to be usable, or are pretending to be iTunes. I HATE iTunes. That and general usability. It's likely I'm just biased because I've used Windows for so long, but there seems to be a long stream of things that don't work "right" in Linux. Little things like mounting media, keyboard shortcuts on GUI widgets, navigating folders in the GUI with the keyboard, or that every second application uses different dialogs. :S
 Whenever the endless debate of windows vs. linux vs. mac comes up, I
 repeat my comment: if you are a programmer, you better acquire some
 experience in each. For Windows/Mac it's not as easy because they may
 cost money, but now with virtual machines, good distributions etc. I
 think there is no excuse for a programmer to not seriously looking into
 Unix.


I have an Ubuntu VM lying around somewhere. Aside from being broken, I could never find any reason to use the thing.
 I desperately wish my computer-illiterate family members would move
 off of Windows as well, since it would eliminate basically every tech-
 support call I field from them.  Perhaps I've simply had good luck with
 other OSes, but Windows is the only one I've had regular problems with.

It's funny, but for me it's exactly the opposite. I make an effort to switch to linux about once a year. There's always, ALWAYS, something that goes horribly wrong that just can't be fixed. Up until about two/three years ago, it was sound; I simply could not make noise come out of the speakers [1]. Weird thing was that it would sometimes work with the Live CD, but once installed it would stop working. I only got it working when I accidentally discovered that the open-source drivers for my Creative card DISABLE SOUND BY DEFAULT. I'm hard pressed to think of a stupider default setting. Currently, the major technical issue with linux is that it's seemingly incapable of doing multiple monitors properly. I've got two monitors in a specific physical arrangement with different resolutions. This causes no end of issues, since X or Gnome or something seems to assume all monitors are the same size. But it IS improving. The previous time I tried it, I had one LCD and one CRT. The built-in multi-monitor config applet ended up rendering my machine unbootable. And if nothing else, at least it isn't showing new windows up between the two monitors, although it still has trouble working out WHICH monitor to show any given window on. Let's not even touch goddamn graphics drivers. Windows is a pain in the arse, and there isn't a day that goes by where I don't wish I could get rid of it from my life. But the fact is that it's STILL better than Linux. Andrei said that Windows is for users, and unix is for programmers. That's fine; I'm a programmer! But I'm also a user. I shouldn't have to spend all day to work out how to do something in linux that's trivial in Windows. I'd almost be tempted to switch to Mac OSX if it weren't for the entire machine, hardware and software (sans BSD), driving me up the wall...
 As for programming specifically... I made a deliberate shift away from
 Windows years ago because it's a nightmare to develop for (aside from
 Visual Studio, which is a great debugging environment).  Best move I
 ever made.

I don't really see this. From the last several years of using Cygwin, I'm not sure what it is that would be markedly better. I WANT to get off Windows. But whatever I switch to would have to be better by a fair margin to offset the cost of re-learning how to do stuff. And as far as I've been able to discern, Linux isn't it. -- Daniel [1] Which is sad when you consider the last time I had sound problems was with Win 95; by Win 98SE, sound always just worked.

Apr 06 2009
parent reply grauzone <none example.net> writes:
Why does everyone think "Ubuntu" when talking about Linux? I find the 
Ubuntu desktop almost as annoying as the Windows one. Even worse, Ubuntu 
feels like a Windows clone. Most of this is because it uses GNOME by 
default.

If you really want to use Linux, don't use a crappy desktop environment 
(they're all crappy), pick a small window manager (like fluxbox), and 
live in the command line.

Neither user nor programmers should pretend that Linux is a Windows 
replacement. It's different. You will be disappointed if you expect a 
replacement. Actually, using Windows is better in this case.
Apr 07 2009
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
grauzone:
 Why does everyone think "Ubuntu" when talking about Linux?

I am ignorant about this topic, but I think the answers to your questions are: 1) Because it's one of the very few distros that seem designed by people that care a bit about ergonomics, usability studies, user interfaces, etc. 2) Because in it things seems to mostly work. It's able to recognize most of my hardware. I have tried few other distros with worse results. 3) Because it's famous. And the more famous you are, the more famous you get. Having a single famous linux distro is very good, because more people will try it, find its bugs, fix the bugs and improve the user interfaces, compile things for it, give server space for it for the updates, and so on. Bye, bearophile
Apr 07 2009
parent reply grauzone <none example.net> writes:
bearophile wrote:
 grauzone:
 Why does everyone think "Ubuntu" when talking about Linux?

I am ignorant about this topic, but I think the answers to your questions are: 1) Because it's one of the very few distros that seem designed by people that care a bit about ergonomics, usability studies, user interfaces, etc.

Forget about this. Look at GNOME and what happened to it because of that usability crap. Not to say that usability is a bad thing, but they just don't get it right. Look at the file open dialog in GNOME/GTK, and see how frustrating it is. I'm not expecting anything from Linux GUIs anymore. Seriously, Linux on the desktop sucks. God, does it suck!
 2) Because in it things seems to mostly work. It's able to recognize most of
my hardware. I have tried few other distros with worse results.

It's not like Ubuntu has additional drivers in the kernel. Maybe it's slightly better at hardware detection than other distros (I don't know), but with some _work_, any other distro should work equally well. You don't like "work"? Linux is not for you, even Ubuntu won't be able to safe you. Actually, Ubuntu discourages you to find out how the system _really_ works, and how things are actually done. What do you do if the automatisms of Ubuntu crap up? Reinstall the system?
 3) Because it's famous. And the more famous you are, the more famous you get.
Having a single famous linux distro is very good, because more people will try
it, find its bugs, fix the bugs and improve the user interfaces, compile things
for it, give server space for it for the updates, and so on.

Because it's "Linux for Windows users". That's not a bad thing per se, but I fear it will degrade into something that shares both disadvantages of Windows and Linux. It might be that I'm not really in the position to criticize Ubuntu, because it's been a long time since I last tried it. (Yeah, with real arguments this post would be actually worthwhile.) I can just say, that even though I'd like to have a good desktop, and although I'm someone who switched from Windows to Linux only some years ago, I never could get used to GNOME or Ubuntu. Even though they're supposed to be better at the desktop. Then again, Ubuntu is derived from the glorious, superior Debian. I'm sure Ubuntu is still better than crap like Red Hat. xD
 Bye,
 bearophile

Apr 07 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
grauzone wrote:
 I'm not expecting anything from Linux GUIs anymore. Seriously, Linux on 
 the desktop sucks. God, does it suck!

What standard are you holding it against? The Mac GUI is snappier, but overall the Mac is still not as stable as Ubuntu. I don't miss anything from the Windows GUI. Andrei
Apr 07 2009
parent reply grauzone <none example.net> writes:
Andrei Alexandrescu wrote:
 grauzone wrote:
 I'm not expecting anything from Linux GUIs anymore. Seriously, Linux 
 on the desktop sucks. God, does it suck!

What standard are you holding it against? The Mac GUI is snappier, but

First, I didn't ever use a Mac. Hell, these things even require special hardware. Generally, the look and feel "style" of the popular Linux toolkits GTK and QT is almost the same as Windows. They look the same. They use the same keyboard shortcuts. They regularly clone Windows GUI controls (just look at the "tabbed notebook" controls). GTK2 was more like Win32 than GTK1. Konqueror is (was) basically an Explorer clone. The GNOME control center is a clone of Window's control panel. The taskbar doesn't really exist in classic X11 window managers, but KDE and GNOME have it and insist on it. It's obvious the Linux desktop is cloning from Windows (and maybe Mac), but they are bad at it. I always get this feeling when using Windows. Of course it could be because I was used to Windows. But hey, there are dozens of things GTK/QT/GNOME/KDE cloned from Windows _after_ I switched to Linux.
 overall the Mac is still not as stable as Ubuntu. I don't miss anything 
 from the Windows GUI.

Me too. Without doubt, there are cases where Linux GUIs do better than Windows. And then there's the fact that some parts I used to do in a GUI moved to the command line. Although I normally prefer GUIs. Seriously, Linux GUI file managers suck. Here I prefer bash.
 Andrei

Apr 07 2009
next sibling parent Lutger <lutger.blijdestijn gmail.com> writes:
grauzone wrote:

 Andrei Alexandrescu wrote:
 grauzone wrote:
 I'm not expecting anything from Linux GUIs anymore. Seriously, Linux 
 on the desktop sucks. God, does it suck!

What standard are you holding it against? The Mac GUI is snappier, but

First, I didn't ever use a Mac. Hell, these things even require special hardware. Generally, the look and feel "style" of the popular Linux toolkits GTK and QT is almost the same as Windows. They look the same. They use the same keyboard shortcuts. They regularly clone Windows GUI controls (just look at the "tabbed notebook" controls). GTK2 was more like Win32 than GTK1. Konqueror is (was) basically an Explorer clone. The GNOME control center is a clone of Window's control panel. The taskbar doesn't really exist in classic X11 window managers, but KDE and GNOME have it and insist on it. It's obvious the Linux desktop is cloning from Windows (and maybe Mac), but they are bad at it. I always get this feeling when using Windows. Of course it could be because I was used to Windows. But hey, there are dozens of things GTK/QT/GNOME/KDE cloned from Windows _after_ I switched to Linux.

That's funny, because I have the opposite experience. Whenever I use windows explorer now, it feels so crippled compared to konqueror and that is the case in general with windows vs kde for me. Now I'm starting to use KDE apps under windows whenever I have to...
Apr 07 2009
prev sibling parent reply Don <nospam nospam.com> writes:
grauzone wrote:
 Andrei Alexandrescu wrote:
 grauzone wrote:
 I'm not expecting anything from Linux GUIs anymore. Seriously, Linux 
 on the desktop sucks. God, does it suck!

What standard are you holding it against? The Mac GUI is snappier, but

First, I didn't ever use a Mac. Hell, these things even require special hardware. Generally, the look and feel "style" of the popular Linux toolkits GTK and QT is almost the same as Windows. They look the same. They use the same keyboard shortcuts. They regularly clone Windows GUI controls (just look at the "tabbed notebook" controls). GTK2 was more like Win32 than GTK1. Konqueror is (was) basically an Explorer clone. The GNOME control center is a clone of Window's control panel. The taskbar doesn't really exist in classic X11 window managers, but KDE and GNOME have it and insist on it. It's obvious the Linux desktop is cloning from Windows (and maybe Mac), but they are bad at it. I always get this feeling when using Windows.

I agree. OS's copy even incredibly crappy ideas from each other. (My pet hate is the way Windows copied the 'folder' idea from the Mac as an analogy for a directory structure, and also got the insane idea that you could associate a file with ONE application????). It's really sad when poor designs get imitated. Nearly always, the copy is even worse than the original.
 Of course it could be because I was used to Windows. But hey, there are 
 dozens of things GTK/QT/GNOME/KDE cloned from Windows _after_ I switched 
 to Linux.
 
 overall the Mac is still not as stable as Ubuntu. I don't miss 
 anything from the Windows GUI.

Me too. Without doubt, there are cases where Linux GUIs do better than Windows. And then there's the fact that some parts I used to do in a GUI moved to the command line. Although I normally prefer GUIs. Seriously, Linux GUI file managers suck. Here I prefer bash.
 Andrei


Apr 07 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Don wrote:
(My pet 
 hate is the way Windows copied the 'folder' idea from the Mac as an 
 analogy for a directory structure,

I agree. It is especially annoying when trying to help someone with their Windows box, and you say "go to this directory" and they say "what's a directory"? I learned this lesson long ago when writing technical documentation. To confuse people, keep changing the name of the contents of an array. Switch randomly between "elements", "members", "items", etc. They'll never get comfortable with it.
Apr 07 2009
parent Don <nospam nospam.com> writes:
Walter Bright wrote:
 Don wrote:
 (My pet hate is the way Windows copied the 'folder' idea from the Mac 
 as an analogy for a directory structure,

I agree. It is especially annoying when trying to help someone with their Windows box, and you say "go to this directory" and they say "what's a directory"?

And manilla folders aren't even nestable! A manilla folder is a simple container for storing pieces of paper. I find it mind-boggling that so many people thought it was a good analogy for a tree structure.
 I learned this lesson long ago when writing technical documentation. To 
 confuse people, keep changing the name of the contents of an array. 
 Switch randomly between "elements", "members", "items", etc. They'll 
 never get comfortable with it.

Applies to APIs, too.
Apr 08 2009
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
grauzone wrote:
 Why does everyone think "Ubuntu" when talking about Linux? I find the 
 Ubuntu desktop almost as annoying as the Windows one. Even worse, Ubuntu 
 feels like a Windows clone. Most of this is because it uses GNOME by 
 default.
 
 If you really want to use Linux, don't use a crappy desktop environment 
 (they're all crappy), pick a small window manager (like fluxbox), and 
 live in the command line.
 
 Neither user nor programmers should pretend that Linux is a Windows 
 replacement. It's different. You will be disappointed if you expect a 
 replacement. Actually, using Windows is better in this case.

Well obviously Windows is the best if you're looking for something exactly like Windows. Other than that it's a matter of opinion. I use KDE on one laptop and Gnome on another, and I like both miles better than Windows. Use what you like. There's no canonical way to use a Unix machine. Andrei
Apr 07 2009
parent grauzone <none example.net> writes:
Andrei Alexandrescu wrote:
 grauzone wrote:
 Why does everyone think "Ubuntu" when talking about Linux? I find the 
 Ubuntu desktop almost as annoying as the Windows one. Even worse, 
 Ubuntu feels like a Windows clone. Most of this is because it uses 
 GNOME by default.

 If you really want to use Linux, don't use a crappy desktop 
 environment (they're all crappy), pick a small window manager (like 
 fluxbox), and live in the command line.

 Neither user nor programmers should pretend that Linux is a Windows 
 replacement. It's different. You will be disappointed if you expect a 
 replacement. Actually, using Windows is better in this case.

Well obviously Windows is the best if you're looking for something exactly like Windows. Other than that it's a matter of opinion. I use

People, who used only Windows in their life, seem to expect all OSes to be like Windows. Even if they're aware that the system is supposed to be different, they might unconsciously prefer the Windows way. Of course, this is only natural.
 KDE on one laptop and Gnome on another, and I like both miles better 
 than Windows. Use what you like. There's no canonical way to use a Unix 
 machine.

This is what's good about Unix. I'm not forced to use GNOME or KDE. At least not their window managers and root window thingies (aka desktops).
 Andrei

Apr 07 2009
prev sibling next sibling parent reply grauzone <none example.net> writes:
 only thing it lacks is iTunes (yeah, screw you, I like iTunes :) and it 

There are lots of iTunes clones. Maybe you should try to get used to one of them? (Personally, I'm still looking for a decent music player, now that xmms got removed from Debian. xmms was very crappy, but useable.)
Apr 07 2009
next sibling parent grauzone <none example.net> writes:
Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 13:56:34 -0400, grauzone <none example.net> wrote:
 
 only thing it lacks is iTunes (yeah, screw you, I like iTunes :) and it

There are lots of iTunes clones. Maybe you should try to get used to one of them?

I'm sorry, but I'm ignorant of such issues. Do they allow downloading music from iTunes, and syncing with an iPod?

Oh, that's what you want. With all that DRM crap, I guess the probability of any open source software supporting this is very low. Sorry about my non-advice before.
 -Steve

Apr 07 2009
prev sibling parent Lutger <lutger.blijdestijn gmail.com> writes:
Steven Schveighoffer wrote:

 On Tue, 07 Apr 2009 13:56:34 -0400, grauzone <none example.net> wrote:
 
 only thing it lacks is iTunes (yeah, screw you, I like iTunes :) and it

There are lots of iTunes clones. Maybe you should try to get used to one of them?

I'm sorry, but I'm ignorant of such issues. Do they allow downloading music from iTunes, and syncing with an iPod? -Steve

Amarok is the big one, it does have ipod support of sorts but I wouldn't know what that means exactly. What's really awesome though is that it has wikipedia support ;)
Apr 08 2009
prev sibling next sibling parent Christopher Wright <dhasenan gmail.com> writes:
Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 13:02:34 -0400, Steven Schveighoffer 
 <schveiguy yahoo.com> wrote:
 
 The only thing it lacks is iTunes (yeah, screw you, I like iTunes :)

The probability of iTunes on Linux just got a whole lot higher http://tech.yahoo.com/news/macworld/20090407/tc_macworld/itunesisdrmfreea dsvariablepricing_1

I doubt it will happen within the next five years. Apple admits that Windows exists because it has to; it won't ignore >85% of the market. But it will never admit that any other desktop operating system exists, if there is any choice in the matter.
Apr 07 2009
prev sibling parent Lars Kyllingstad <public kyllingen.NOSPAMnet> writes:
Steven Schveighoffer wrote:
 BTW, does anyone know how to 
 make nautilus NOT pop up a new window when you open another folder?  
 That drives me nuts!

I don't know if this works on Fedora, because I suspect it may be an Ubuntu-specific feature, but, in a Nautilus window: Edit -> Preferences -> Behaviour -> Always open in browser windows (should be checked) If this isn't applicable to your Nautilus build, there's the following, slightly hackish, way: 1. Run 'gconf-editor'. 2. Navigate to /apps/nautilus/preferences 3. Turn on the always_use_browser property. -Lars
Apr 08 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 15:58:34 -0400, grauzone <none example.net> wrote:

 The complete language reference (including index) has 102 pages.  
 Considering that it's probably more formal than the sh description in  
 your Nutshell book, it's not that much compared to sh.

The nutshell description is formal and complete for bourne/korn shell (it does not have any bash extensions), which mostly sufficient for everything.
 Regarding the syntax: OK, that's probably about tastes. But I still like  
 it more than, say, the funny way how you have to use the find program.

It depends on what you want to get used to. I agree it's about tastes.
 And regarding using it as an user shell: there's an interactive  
 command line interpreter.

whatever?

If you'd go and use python as a shell, you had a ls() function. It would return an array of names. Instead of text garbage like ls does. How can you reliably list all files, without getting incorrect results (like when there's a line break in a file), or falling into the escape trap (your script, that takes the ls output, interprets part of the filename as program)?

You can use the shell's filename wildcard feature to get an array of filenames that are properly delineated. For example: for file in * do echo filename is: $file done Will print out individual files, including ones that have escape sequences or spaces. echo re-interprets newlines as spaces, so you won't see those exactly, but the file variable does contain the exact characters.
 Prove me wrong, show me a python script that does the same thing, and  
 we'll see if it's clearer.

Sorry, I'm not going to write a script to prove someone else wrong over the internet. And my point was anyway to extend a _real_ scripting language by adding simple functions as substitutes for common UNIX programs like rm, ln etc.

what happens when you want to run non-standard programs, then do you have to run them using a python function? I imagine that simply interpreting any symbol that doesn't match a library function as a command to run might result in a lot more collisions in python than in sh.
 sh scripts aren't very reliable either. I remember that script that  
 invoked another program. That other program produced some warning, and  
 the script interpreted it as normal output.

bugs in my D programs too, must be because D sucks?

Interpreting data as programs are the "buffer overflows" of scripting languages. Nothing to defend here. The script in question was relatively large, and probably written by some guru, if that helps.

All I was saying is that bugs can occur in any programming or scripting language. Blaming the language isn't the answer (although complicated scripts in any language you are not familiar with certainly can be hard to debug).
 Yeah, or doing something like "rm -rf this/directory /". Or deleting all  
 hidden directories.

 That demonstrates a particularly disgusting issue with the shell: escape  
 hell.

 One time, I unzipped a file, and the files were encoded with some weird  
 multibyte garbage. How do I delete the files? I had to start a GUI  
 program to do this. In Python, with an appropriate extension library,  
 that would have been ls() followed by a rm(ls[1]). How to do this in sh?

I'm assuming you had an issue because those files were intermixed with files you wanted to keep? for file in * do echo Do you want to remove file $file? read answer if [ "$answer" = "y" ] then rm "$file" fi done or something like that would have worked. -Steve
Apr 07 2009
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 08 Apr 2009 10:10:29 -0400, Daniel Keep  
<daniel.keep.lists gmail.com> wrote:

 Steven Schveighoffer wrote:
 [snip]

 -Steve

This is getting rather inflammatory, so let me clarify a few things. What Yigal should have said was that when everything is a file, there is no API for the CONTENTS of files. Yes, you can manipulate files, but it's a bit like Variants in D: you can't do anything useful with the contents unless you specifically know what they are. Powershell is designed to work with managed (.NET) objects. It can dynamically introspect these objects and pull them apart, mutate them, convert them, etc. Imagine if every file on a UNIX system also carried around a reference to its own parser, and a description of how to interpret the data. THAT is what Powershell has over UNIX shells. For example, the output of the "ls" equivalent is a table of objects. By default, it gets toString'd and displayed as a table. However, you can pipe this into a command that reorders columns. Or sorts. And you don't have to dick about with ensuring the filenames don't contain whitespace or newlines because the file names are carried around as actual strings that know their own length. Unlike UNIX, where everything is a file, to powershell everything is an object. So the list command can be used on a directory or on an object that is an aggregate of stuff. For example, you can use powershell to browse the registry as if it was just another part of the filesystem.

This does sound useful. More so than was explained, sorry to Yigal for being so inflammatory, but what can you expect when you say Unix is a "stupid" design ;) It's just a different design, one that works very well for script writers.
 I won't say that "everything is a file" is a failure, but powershell
 *definitely* exposes a superset of UNIX's functionality.  Anything you
 can do with a UNIX-style environment, powershell can potentially do  
 better.

This kind of thing is useful only for cases where OS objects were converted into strings (such as via ls), actual files still have to be read and parsed I'm guessing. But having .NET at your disposal gives you a lot of potential parsers for things like XML files or whatever. BTW, /proc is a lot like this. You don't need to have a manual to understand what it means, since you can browse through it just like any other directory. However, there are some files that have undescribed values in them, where you do need a manual. But these files are built to be parsed for the most part, so it doesn't take a lot of work to get information out of it. I think the advantage to having everything be represented as files is that you already have a bazillion tools to manipulate and parse files in unix. The same is not for Windows, but it does have .NET which has a great API to OS objects.
 Microsoft really hit one out of the park with powershell, although it
 remains to be seen if anyone will actually use it.

It sounds a lot like it is geared toward .NET programmers rather than script writers. Do you use it? -Steve
Apr 08 2009
prev sibling next sibling parent reply grauzone <none example.net> writes:
Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad sites, and my computer never broke.
Apr 06 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
grauzone wrote:
 Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad sites, and my computer never broke.

You can replace "sites" and "computer" with different words and keep the meaning of the sentence intact! Andrei
Apr 06 2009
parent reply grauzone <none example.net> writes:
Andrei Alexandrescu wrote:
 grauzone wrote:
 Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad sites, and my computer never broke.

You can replace "sites" and "computer" with different words and keep the meaning of the sentence intact!

Let's see... Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad bananas, and my compiler never broke. Nope. Doesn't work.
 Andrei

Apr 06 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
grauzone wrote:
 Andrei Alexandrescu wrote:
 grauzone wrote:
 Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad sites, and my computer never broke.

You can replace "sites" and "computer" with different words and keep the meaning of the sentence intact!

Let's see... Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad bananas, and my compiler never broke. Nope. Doesn't work.
 Andrei


I meant it in the wake of the comment about prostitutes and STDs. Andrei
Apr 06 2009
parent grauzone <none example.net> writes:
Andrei Alexandrescu wrote:
 grauzone wrote:
 Andrei Alexandrescu wrote:
 grauzone wrote:
 Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad sites, and my computer never broke.

You can replace "sites" and "computer" with different words and keep the meaning of the sentence intact!

Let's see... Mankind sure sucks. Is that what we need to tell people? I mean I've went to quite some bad bananas, and my compiler never broke. Nope. Doesn't work.
 Andrei


I meant it in the wake of the comment about prostitutes and STDs.

<insert witty response> But seriously, computers ought to be secure.
 Andrei

Apr 06 2009
prev sibling parent Christopher Wright <dhasenan gmail.com> writes:
Jarrett Billingsley wrote:
 On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

That's sufficient reason, I think, to use Unix: you can claim that you don't know enough about Windows to help these people.
Apr 06 2009
prev sibling next sibling parent "Saaa" <empty needmail.com> writes:
"Christopher Wright" <dhasenan gmail.com> wrote in message 
news:grd5rq$f7g$1 digitalmars.com...
 Saaa wrote:
 I always thought people who would need to reinstall their windows to keep 
 it clean were like the ones that didn't know how computers works.
 I haven't reinstalled my windows box in like 6 years and it doesn't 
 startup any slower then before.
 If only you keep to the simple things like: ccleaner, autoruns, program 
 control (online armor) and noscript for firefox you should be able to 
 keep it clean.
 The only thing I can't really be sure of are rootkits and alike but 
 icesword and online scans at least give me the impression it is also ok 
 on that part.
 btw. adware normaly doesn't really make your box start up any slower

Wow, that seems like a lot of work.

keeping my windows clean. But then again I had (as a linux beginner) no control over the ubuntu box, so its not really a fair comparison. Autoruns after install Ccleaner after uninstall. And a get a lot more questions from my computer because of program control and noscript. Disabled as many services as possible etc. But, I will only search for a rootkit when I think I got something strange happening. So especially 3 takes a bit of extra time. btw. I want to be able to click on any link and until now this has never been a problem. (noScript works perfectly for tht purpose) I will probably start using sandboxie the moment I get paranoid about the internets.
Apr 06 2009
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Tue, 07 Apr 2009 04:55:43 +0400, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:

 Denis Koroskin wrote:
 On Tue, 07 Apr 2009 04:41:39 +0400, Andrei Alexandrescu  
 <SeeWebsiteForEmail erdani.org> wrote:

 Jussi Jumppanen wrote:
 Jason House Wrote:

 For example, as an emacs user, I can easilly program for an hour  
 without touching my mouse.

coding using a programmer's editor and not a modern day IDE. I would also say many Windows programmers are completely lost without their IDE, and this can makes them less productive as a developer. They could make themselves better programmers by overcoming their addiction to the IDE. http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html But programming on Windows without a mouse driven, language specific IDE, using nothing but the command line and a good editor is possible and really quite easy to do.

 As a commandline utility, it can be combined with other stuff such  
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there  
 though...

and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

But all else is lacking, starting with a good shell. I guess it's possible with cygwin et al, but then it feels a bit artificial and second-hand. Andrei

everything you will ever need. An it's Open-Source, too!

I remember having used FAR back in the day... it was fun. But then I feel there's a disconnect somewhere in the dialog. Will, for example, FAR take a text file, create a dictionary with its words, assign a unique number to each word in decreasing order of frequency, and output a file with each word replaced with its number? Andrei

Yes, given a cygwin installed and present in PATH. You can use your favorite unix tools then.
Apr 06 2009
prev sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Jarrett Billingsley wrote:
 It's not.  It's actually quite simple to keep a clean Windows box.
 You _don't go to dangerous websites or download screensavers like the
 thousands of twits who don't understand computers or malware_.  I got
 my first virus in ten years of using Windows last December, and I
 don't have anything but a basic virus scanner.  It got in through an
 ad that took advantage of Acrobat Reader.

The problem is not knowing if your computer is compromised or not.
Apr 06 2009
prev sibling next sibling parent reply Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Apr 6, 2009 at 11:07 AM, Christopher Wright <dhasenan gmail.com> wrote:
 Saaa wrote:
 I always thought people who would need to reinstall their windows to keep
 it clean were like the ones that didn't know how computers works.
 I haven't reinstalled my windows box in like 6 years and it doesn't
 startup any slower then before.
 If only you keep to the simple things like: ccleaner, autoruns, program
 control (online armor) and noscript for firefox you should be able to keep
 it clean.
 The only thing I can't really be sure of are rootkits and alike but
 icesword and online scans at least give me the impression it is also ok on
 that part.
 btw. adware normaly doesn't really make your box start up any slower

Wow, that seems like a lot of work.

It's not. It's actually quite simple to keep a clean Windows box. You _don't go to dangerous websites or download screensavers like the thousands of twits who don't understand computers or malware_. I got my first virus in ten years of using Windows last December, and I don't have anything but a basic virus scanner. It got in through an ad that took advantage of Acrobat Reader. Before that, I was running an install of XP that hadn't been modified for close to four years, which had run in two different computers. My laptop is coming up on its four year mark as well. Surprising, no? That when you know how to use computers, Windows _doesn't actually suck_!
Apr 06 2009
parent reply BCS <none anon.com> writes:
Hello Jarrett,

 Before that, I was running an install of XP that hadn't been modified
 for close to four years, which had run in two different computers.  My
 laptop is coming up on its four year mark as well.

I have a XP install that's comeing up on 6 or 7 years old. It's just now starting to have problems (of the BSOD type). That said, it doesn't /have/ a net connection so...
Apr 06 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
BCS wrote:
 I have a XP install that's comeing up on 6 or 7 years old. It's just now 
 starting to have problems (of the BSOD type). That said, it doesn't 
 /have/ a net connection so...

My main XP dev machine is 7 years old now. I've reinstalled XP from scratch 3 times, once because I got rootkitted, once because the hard disk failed, and I forgot the third.
Apr 06 2009
parent BCS <none anon.com> writes:
Hello Walter,

 BCS wrote:
 
 I have a XP install that's comeing up on 6 or 7 years old. It's just
 now starting to have problems (of the BSOD type). That said, it
 doesn't /have/ a net connection so...
 

scratch 3 times, once because I got rootkitted, once because the hard disk failed, and I forgot the third.

My issues started when I installed more RAM and the video drives flaked out. Disable them and stuff works, unistall the drives so I can install the new ones and like magic, the old one auto reinstall befor I can run the installer (thanks Dell) I now have had "issues" with both nVidia and ATI chipsets. On that note, I've heard good thing about Matrox for it-just-work non-gamer performance: anyone have any experence. http://www.matrox.com/graphics/en/products/graphics_cards/g_series/g550dualdvi/
Apr 06 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Apr 6, 2009 at 3:31 PM, dsimcha <dsimcha yahoo.com> wrote:
 Yeah, I've always wondered why some people put so much emphasis on the 10% of
 computer security that's highly technical in nature when 90% of the problem of
 computer security is between the keyboard and the chair.

ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my computer? Jarrett: What's it doing? CIF: It's popping up all sorts of dialog boxes telling me I need to get Spyware Aweseom Remover and stuff, and it's running really slow, and my files keep disappearing. Jarrett: And where have you been on the internet? CIF: Oh you know, normal sites. Jarrett: Like? CIF: Porn, more porn, horse porn, warez. I also used Limewire to download *every song and program ever made*, and I make it a habit to click on interesting-looking [read: violently-flashing] ads. Jarrett: ... CIF: What? Did I do something wrong? Seriously. It's like sleeping with every prostitute on the East Coast and acting surprised when you have seventeen STDs.
Apr 06 2009
prev sibling next sibling parent reply Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Apr 6, 2009 at 4:13 PM, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:

 ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my
 computer?
 Jarrett: What's it doing?
 CIF: It's popping up all sorts of dialog boxes telling me I need to
 get Spyware Aweseom Remover and stuff, and it's running really slow,
 and my files keep disappearing.
 Jarrett: And where have you been on the internet?
 CIF: Oh you know, normal sites.
 Jarrett: Like?
 CIF: Porn, more porn, horse porn, warez. =A0I also used Limewire to
 download *every song and program ever made*, and I make it a habit to
 click on interesting-looking [read: violently-flashing] ads.
 Jarrett: ...
 CIF: What? =A0Did I do something wrong?

 Seriously. =A0It's like sleeping with every prostitute on the East Coast
 and acting surprised when you have seventeen STDs.

I think this is a large exaggeration.

Except this has actually happened to me, modulo a couple details. Three or four times.
Apr 06 2009
next sibling parent reply superdan <super dan.org> writes:
Jarrett Billingsley Wrote:

 On Mon, Apr 6, 2009 at 4:13 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:
 
 ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my
 computer?
 Jarrett: What's it doing?
 CIF: It's popping up all sorts of dialog boxes telling me I need to
 get Spyware Aweseom Remover and stuff, and it's running really slow,
 and my files keep disappearing.
 Jarrett: And where have you been on the internet?
 CIF: Oh you know, normal sites.
 Jarrett: Like?
 CIF: Porn, more porn, horse porn, warez. I also used Limewire to
 download *every song and program ever made*, and I make it a habit to
 click on interesting-looking [read: violently-flashing] ads.
 Jarrett: ...
 CIF: What? Did I do something wrong?

 Seriously. It's like sleeping with every prostitute on the East Coast
 and acting surprised when you have seventeen STDs.

I think this is a large exaggeration.

Except this has actually happened to me, modulo a couple details. Three or four times.

browsin' porn or fuckin' hookers?
Apr 06 2009
next sibling parent "Saaa" <empty needmail.com> writes:
"superdan" <super dan.org> wrote in message 
news:grdoag$1hdn$1 digitalmars.com...
 Jarrett Billingsley Wrote:

 On Mon, Apr 6, 2009 at 4:13 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:

 ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my
 computer?
 Jarrett: What's it doing?
 CIF: It's popping up all sorts of dialog boxes telling me I need to
 get Spyware Aweseom Remover and stuff, and it's running really slow,
 and my files keep disappearing.
 Jarrett: And where have you been on the internet?
 CIF: Oh you know, normal sites.
 Jarrett: Like?
 CIF: Porn, more porn, horse porn, warez. I also used Limewire to
 download *every song and program ever made*, and I make it a habit to
 click on interesting-looking [read: violently-flashing] ads.
 Jarrett: ...
 CIF: What? Did I do something wrong?

 Seriously. It's like sleeping with every prostitute on the East Coast
 and acting surprised when you have seventeen STDs.

I think this is a large exaggeration.

Except this has actually happened to me, modulo a couple details. Three or four times.

browsin' porn or fuckin' hookers?

I read an ior there
Apr 06 2009
prev sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
superdan wrote:
 Jarrett Billingsley Wrote:
 
 On Mon, Apr 6, 2009 at 4:13 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:

 ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my
 computer?
 Jarrett: What's it doing?
 CIF: It's popping up all sorts of dialog boxes telling me I need to
 get Spyware Aweseom Remover and stuff, and it's running really slow,
 and my files keep disappearing.
 Jarrett: And where have you been on the internet?
 CIF: Oh you know, normal sites.
 Jarrett: Like?
 CIF: Porn, more porn, horse porn, warez.  I also used Limewire to
 download *every song and program ever made*, and I make it a habit to
 click on interesting-looking [read: violently-flashing] ads.
 Jarrett: ...
 CIF: What?  Did I do something wrong?

 Seriously.  It's like sleeping with every prostitute on the East Coast
 and acting surprised when you have seventeen STDs.


Three or four times.

browsin' porn or fuckin' hookers?

Ouch. pwn of the year. Andrei
Apr 06 2009
prev sibling parent "Saaa" <empty needmail.com> writes:
Except this has actually happened to me, modulo a couple details.
Three or four times.
You should install noscript or maybe better: sandboxie 
Apr 06 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Apr 6, 2009 at 4:22 PM, superdan <super dan.org> wrote:
 Jarrett Billingsley Wrote:

 On Mon, Apr 6, 2009 at 4:13 PM, Andrei Alexandrescu
 <SeeWebsiteForEmail erdani.org> wrote:

 ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my
 computer?
 Jarrett: What's it doing?
 CIF: It's popping up all sorts of dialog boxes telling me I need to
 get Spyware Aweseom Remover and stuff, and it's running really slow,
 and my files keep disappearing.
 Jarrett: And where have you been on the internet?
 CIF: Oh you know, normal sites.
 Jarrett: Like?
 CIF: Porn, more porn, horse porn, warez. =A0I also used Limewire to
 download *every song and program ever made*, and I make it a habit to
 click on interesting-looking [read: violently-flashing] ads.
 Jarrett: ...
 CIF: What? =A0Did I do something wrong?

 Seriously. =A0It's like sleeping with every prostitute on the East Co=




 and acting surprised when you have seventeen STDs.

I think this is a large exaggeration.

Except this has actually happened to me, modulo a couple details. Three or four times.

browsin' porn or fuckin' hookers?

lol
Apr 06 2009
prev sibling next sibling parent reply Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Mon, Apr 6, 2009 at 4:41 PM, Saaa <empty needmail.com> wrote:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.
Apr 06 2009
parent "Saaa" <empty needmail.com> writes:
 Except this has actually happened to me, modulo a couple details.
 Three or four times.
 You should install noscript or maybe better: sandboxie

/facepalm, I'm not talking about getting viruses, I'm talking about dealing with morons who don't realize that going to bad sites make their computer break.

But going to sites shouldn't be a problem, being a moron when you get there might.
Apr 06 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Mon, 06 Apr 2009 15:53:56 -0400, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 On Mon, Apr 6, 2009 at 3:31 PM, dsimcha <dsimcha yahoo.com> wrote:
 Yeah, I've always wondered why some people put so much emphasis on the  
 10% of
 computer security that's highly technical in nature when 90% of the  
 problem of
 computer security is between the keyboard and the chair.

ComputerIlliterateFriend: Hey Jarrett, can you come over and fix my computer? Jarrett: What's it doing? CIF: It's popping up all sorts of dialog boxes telling me I need to get Spyware Aweseom Remover and stuff, and it's running really slow, and my files keep disappearing. Jarrett: And where have you been on the internet? CIF: Oh you know, normal sites. Jarrett: Like? CIF: Porn, more porn, horse porn, warez. I also used Limewire to download *every song and program ever made*, and I make it a habit to click on interesting-looking [read: violently-flashing] ads. Jarrett: ... CIF: What? Did I do something wrong? Seriously. It's like sleeping with every prostitute on the East Coast and acting surprised when you have seventeen STDs.

Windows' security is wrong from the ground up. Consider that without having any anti-virus installed, your computer would be at risk from the conficker worm unless you have all latest windows updates installed. Just the other day we shipped a system to a customer with a 6-year old worm on it. Because the customer's image is that old, and we have other systems running test images that are that old that can propogate the worm around (still don't know where the source is). The "let everyone have free access to my system for the sake of productivity, then try to patch holes later" mentality of Microsoft is seriously flawed. The number of Linux/Mac/FreeBSD installs out there is getting to (or has gotten to) the point where the whole "there's no viruses for Unix because it isn't as popular" argument is moot. Then on top of that, you are required to run your system as an administrator to get any work done. Windows is the equivalent of a rest-area bathroom toilet seat with no ass gaskets avialable as far as breeding malware. The only way they can fix it is to dump backwards compatibility and start over (which will never happen IMO). And yeah, I've had those friends too. Not running as Administrator would be a better solution to those idiots ;) My $.02 -Steve
Apr 06 2009
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Tue, 07 Apr 2009 04:19:40 +0400, Jussi Jumppanen <jussij zeusedit.com> wrote:

 Jason House Wrote:

 For example, as an emacs user, I can easilly program for an hour
 without touching my mouse.

I would say 'not using the mouse' is clear sign the programmer is coding using a programmer's editor and not a modern day IDE. I would also say many Windows programmers are completely lost without their IDE, and this can makes them less productive as a developer. They could make themselves better programmers by overcoming their addiction to the IDE. http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html But programming on Windows without a mouse driven, language specific IDE, using nothing but the command line and a good editor is possible and really quite easy to do.
 As a commandline utility, it can be combined with other stuff such
 as ls, sort, grep, sed, awk, etc... I don't know if I'd start there
 though...

Replace ls with dir, download the Win32 version of grep, sed, awk and you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

IDE has nothing to do with mouse. I am programming with both Visual Studio 2008 and Notepad++ (50/50) and almost never use a mouse. Visual Studio is nothing, it's Visual Assist that boosts my performance. I use it very extensively, and all of its functionality is short-cut'ed.
Apr 06 2009
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Tue, 07 Apr 2009 04:41:39 +0400, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:

 Jussi Jumppanen wrote:
 Jason House Wrote:

 For example, as an emacs user, I can easilly program for an hour  
 without touching my mouse.

coding using a programmer's editor and not a modern day IDE. I would also say many Windows programmers are completely lost without their IDE, and this can makes them less productive as a developer. They could make themselves better programmers by overcoming their addiction to the IDE. http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html But programming on Windows without a mouse driven, language specific IDE, using nothing but the command line and a good editor is possible and really quite easy to do.

 As a commandline utility, it can be combined with other stuff such as  
 ls, sort, grep, sed, awk, etc... I don't know if I'd start there  
 though...

you can run all those tools just fine from the Windows command line, or from within any decent editor. You don't have to go to Unix to find the command line.

But all else is lacking, starting with a good shell. I guess it's possible with cygwin et al, but then it feels a bit artificial and second-hand. Andrei

There is FAR, which is an amazing tool. Properly configured, it can do everything you will ever need. An it's Open-Source, too!
Apr 06 2009
prev sibling next sibling parent reply Bill Baxter <wbaxter gmail.com> writes:
On Tue, Apr 7, 2009 at 9:36 AM, Andrei Alexandrescu
<SeeWebsiteForEmail erdani.org> wrote:
 Daniel Keep wrote:
 Warning: semi-rant ahead. =A0Feel free to ignore. =A0:)

[...]
 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life. =A0But the fact is that
 it's STILL better than Linux.

 Andrei said that Windows is for users, and unix is for programmers.
 That's fine; I'm a programmer! =A0But I'm also a user. =A0I shouldn't ha=


 to spend all day to work out how to do something in linux that's trivial
 in Windows.

What you don't realize is that you spend all day to work out how to do something in Windows that's trivial in Unix. And that "something" is writ=

 computer programs. I agree that winamp, games, ..., are much more polishe=

 in Windows. I mean, it's a foregone conclusion. It's the core market of
 Windows!

 Now here's the thing: mono-culturalism is worse than either Windows or Un=

 bigotry. If you know the OS, go ahead, rant all you want about it. But I
 have little consideration for rants against some OS from people who don't
 know it.

 And the situation isn't symmetric, which is liable to raise an eyebrow. I
 only know two persons who know Unix and prefer Windows. One worked for
 Microsoft, the other loves every big American company and is in fact a
 Microsoft fan (nothing wrong with that). All others I know disliking Unix
 actually don't know it. On the other hand, I know plenty of programmers w=

 know both Unix and Windows programming and can't bring themselves to thin=

 seriously about getting work done in Windows. I also know Unix zealots wh=

 have no idea about Windows, and their rants are pretty damaging (Richard
 Stallman only tried to use Word once and was unable to do anything with i=

 too many confusing menus and buttons... a sad case of monoculture.) Final=

 programmers who only know Windows kind of just don't know better so they
 take it as a given without becoming fans and that's that.

I think your "for users" vs "for programmers" distinction is quite apt. Overall I would prefer to program under Unix (although I'd still like to keep the Visual Studio debugger :-P), but to do user things under Windows. Problem is those user-things sort of happen intermittently throughout the day, and in the end I find that with Cygwin, emacs, etc. the programming environment under Windows is more tolerable to me than the user environment under Linux. So I'm happier overall under Windows. I do keep a VMware Ubuntu handy, though, and fire it up once a week or so. Usually to play around with some 3rd party code that hasn't been ported to Windows, or use some tool that I couldn't get to work easily under cygwin. As for pathetic little cmd.com, Microsoft seems to be trying to do something new in the shell area with the PowerShell. I tried it out a bit, but it's quite a change from a typical command line shell. Not sure how long it would take to get the hang of it. The impression I get is that the main point of it is to give you a way to control everything about Windows using scripts, which is good. Kind of reminiscent of AppleScript in that sense. I think it also has a not-so-brain-dead programming language for scripting. The fact that they are at least attempting to do something to improve the shell under Windows is promising, at least. --bb
Apr 06 2009
parent BCS <none anon.com> writes:
Hello Bill,

 Overall I would prefer to program under Unix (although I'd still
 like to keep the Visual Studio debugger :-P), but to do user things
 under Windows.  Problem is those user-things sort of happen
 intermittently throughout the day,

My solution is to have a windows desktop and a linux server sitting side by side, NFS and SSH keep me happy.
Apr 06 2009
prev sibling next sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Tue, 07 Apr 2009 01:10:38 +0200, Saaa wrote:

 Thanks,
 I really do feel impaired. Not so much as in that I don't use unix, but
 more in that I see software lagging behind hardware. I think maybe this
 lag is a bit less when using unix but only if I would start using the
 right tools (yes I'm a mouse fanatic and found it surprisingly stupid
 that 'save all' needed a plugin to appear as a gui button in eclipse)
 At least for my current project I don't see any advantage in using a
 unix based os. Mind you that I've never had the need to write a single
 .bat file for any of my projects.
 
 Maybe I should simple start by using vim :)

Actually if all you are programming with is Java and Eclipse that might be the best time to switch. Since that combination is the same for both Windows and Linux, you be able to familiarize yourself with the OS without hindering your performance in coding. You will find little things that make your life easier, I will state some here, but they don't sound very important and some you may not like. Multiple desktops (If you have tried this on Windows you have been cheated in how it really should work). The middle mouse copy/past (True X- Mouse is a poor substitute). Sloppy-Focus (A window is activated for keyboard input, but is not raised when the mouse is over it.) When I when exclusively Linux I had some relapse where I'd end up in Windows for months without touching Linux (Wanted quick access to games). This happened several times, and each time the initial switch to Windows was a pain, I'd get use to it. Then when I'd go back in Linux, no pain. I wasn't using the "little things" but it didn't hurt. (Now I only run Windows games on the weekends, if even that) Linux's power really comes from how configurable it is, for many people Windows is configured to what they need/want, others not so much. There isn't any way to say Linux is good for you until you try and decide for yourself. Many people suggest Live-CDs for introduction, but this is only go to show that you have a browser in Linux. It doesn't give a true Linux experience. Also since Linux is so customizable there are lots of default setups that you will hate, which means there is lots of experimentation/ reading to find the right one. I say choose one, if you struggle at an early stage (installation) try another. Once you get most of what you want, ie not wine, stick to that distro. Also, always place your /home on a different partition than /
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Mon, 06 Apr 2009 19:36:11 -0400, Daniel Keep  
<daniel.keep.lists gmail.com> wrote:

 I desperately wish my computer-illiterate family members would move
 off of Windows as well, since it would eliminate basically every tech-
 support call I field from them.  Perhaps I've simply had good luck with
 other OSes, but Windows is the only one I've had regular problems with.

It's funny, but for me it's exactly the opposite. I make an effort to switch to linux about once a year. There's always, ALWAYS, something that goes horribly wrong that just can't be fixed.

I had the same experience. Recently, I switched my laptop from XP pro to Fedora 10, and was pleasantly surprised: 1. The graphics look better than Windows, it's almost MAC like. better Anti-aliasing of fonts. 2. The sound just "worked". I've not had a problem from the beginning. 3. It automatically detected my wireless network card and the little applet that is used to configure it is better than the windows one. 4. I was disappointed in the lack of media playing support, but I found that there was a yum repository that has "questionably" licensed packages, which include support for playing almost all media formats, including WMV (rpmfusion.org). 5. The updates work just as cleanly as windows. Once I had that, I'm not finding much missing. I use Firefox in windows, and firefox works just fine in Linux. It's faster, uses less memory for apps (my antivirus "guard" uses 70MB of virtual memory on my windows PC, does that make any sense at all?), and looks better. The only thing it lacks is iTunes (yeah, screw you, I like iTunes :) and it doesn't support my printer properly (but it looks like it supports a ton of other printers). I also don't really like nautilus, but I'm too lazy to try and install another file manager :) BTW, does anyone know how to make nautilus NOT pop up a new window when you open another folder? That drives me nuts! It's been about 8 months now, and I'm still using Linux, haven't had any major issues. Maybe eventually I can kill the windows install on my other box, and just put it on a virtual machine for games. -Steve
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 13:02:34 -0400, Steven Schveighoffer  
<schveiguy yahoo.com> wrote:

 The only thing it lacks is iTunes (yeah, screw you, I like iTunes :)

The probability of iTunes on Linux just got a whole lot higher http://tech.yahoo.com/news/macworld/20090407/tc_macworld/itunesisdrmfreeaddsvariablepricing_1 :D -Steve
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 13:56:34 -0400, grauzone <none example.net> wrote:

 only thing it lacks is iTunes (yeah, screw you, I like iTunes :) and it

There are lots of iTunes clones. Maybe you should try to get used to one of them?

I'm sorry, but I'm ignorant of such issues. Do they allow downloading music from iTunes, and syncing with an iPod? -Steve
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 14:11:44 -0400, Walter Bright  
<newshound1 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 It took me a couple of minutes to write under her eyes a script that  
 downloaded HTML, scraped the code for links, followed those of  
 interest, and output a concatenation of all pages she was interested  
 in, with details highlighted, that was loadable back in the browser.  
 I'd show her one iteration, get feedback, and get the next iteration  
 within seconds. All without "coding" in any sense as regularly  
 understood by Windows programmers.

I have no idea how to do that under unix. I obviously have not learned anywhere near enough about it.

Probably start with wget, but I wouldn't know even close to enough about information in that HTML to be able to do something like this :) But shell scripting in itself is so powerful for this kind of stuff. I've written lots of little scripts to do fantastic things that on Windows would be so painful (without cygwin of course). Like renaming all files of a certain type to something else, or copying select files to another directory. For example, here's a script I wrote to change which D compiler I want to use: #!/bin/bash dir=$1 if [ "$2" = "" ] then mode=dmd else mode=$2 fi if [ "$dir" = "" ] then echo please provide dmd directory argument fi if [ ! -f $dir/$mode.conf ] then echo invalid mode specified -- $mode fi rm -f ~/bin/dmd/* ln -s $dir/dmd ~/bin/dmd/dmd ln -s $dir/$mode.conf ~/bin/dmd/dmd.conf hash -d dmd 2>/dev/null just run it like: . setupd ~/dmd2.021/dmd/bin And now from now on, running dmd runs the right dmd with the right config file (which is optionally specified). Stuff like that is so painfully difficult on Windows. -Steve
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 14:26:21 -0400, Christopher Wright wrote:

 Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 13:02:34 -0400, Steven Schveighoffer  
 <schveiguy yahoo.com> wrote:

 The only thing it lacks is iTunes (yeah, screw you, I like iTunes :)

http://tech.yahoo.com/news/macworld/20090407/tc_macworld/itunesisdrmfreeaddsvariablepricing_1

I doubt it will happen within the next five years. Apple admits that Windows exists because it has to; it won't ignore >85% of the market. But it will never admit that any other desktop operating system exists, if there is any choice in the matter.

OK, so maybe the probability went up from 1/1000000 to 1/100000 :) But still, the sole purpose of iTunes is to support the iPod/iPhone and to make money through music downloads. Not to sell Macs. It makes logical sense to port iTunes to other platforms. Or even open the protocol for open source development. And porting from OSX to Linux has got to be a hell of a lot easier than porting to Windows... -Steve
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 18:48:19 -0400, Sergey Gromov <snake.scaly gmail.com>  
wrote:

 Using Cygwin tools is a pain because Cygwin emulates a Unix-like file
 system view while other tools produce and expect native Windows paths.

just as an aside, have you looked at cygwin's cygpath tool? Not a complete solution, but it certainly helps. -Steve
Apr 07 2009
prev sibling next sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Tue, 07 Apr 2009 22:12:07 +0200, Ralf Schneider wrote:

 Well at least you've got to make up your mind. It's amazing how you
 mention instability in three instances and stagnation in two instances,
 without ever noticing the irony. What's happening?

Instability: Red hat crashes most often. AIX, Solaris and HP-UX just run. Windows crashes sometimes. (Very personal observation, of course) Instable APIs: POSIX is stable. Most other *NIX APIs regarding Audio, GUI, Graphics and others are constantly changing, with very little visible progress. What is not covered by POSIX is different on ever Unix flavour: Hot do you get the peak virtual memory usage on AIX, Linux and Solaris? Windows: APIs are usually stable. New APIs with new concepts are introduced beside existsing APIs. Yes there is a lot of cruft. And windows is defintetly not "perfect"!!! In no way! It just sucks less (TM) Stagnation: On *NIX: same (command line) tools, same concepts (everything is a file) as decades ago. New ideas are usually copied badly from Apple or Windows years later. So, again: As a desktop and programming environment I prefer Windows. May be I would prefer OS X if I knew it. As a server: I would use and suggest UNIX. May be even Red Hat is OK and the crashes we experience is a temporary problem and are hardware related.

The only thing I'm interested in is, what new ideas are badly copied from Apple and _Microsoft_?
Apr 07 2009
prev sibling next sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Tue, 07 Apr 2009 22:39:03 -0400, Jussi Jumppanen wrote:

 Christopher Wright Wrote:
 
 The GUI is better than that of cmd.exe, but not anywhere near as good
 as, say, GNOME Terminal. (It's still fixed width, as I recall; just
 wider by default.)

The cmd.exe terminal window can be resized. With the cmd.exe window visible click on the icon in the top left corner and bring up the Properties window. Select the Layout panel and change the terminal size to what ever width/height combination required and save the changes against the title of the console window. From then on all new console windows with that title will take on those attributes. On a new machine this is usually on of the first things I do, since the default properties are pretty poor.

In his previous post he specifically talked about resizing with the mouse, which I believe was to carry over into the last one. In any case, going to the settings to resize the window is troubling if it is something commonly done. (may not be for you, but others do)
Apr 07 2009
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 08 Apr 2009 05:55:51 -0400, Lars Kyllingstad  
<public kyllingen.nospamnet> wrote:

 Steven Schveighoffer wrote:
 BTW, does anyone know how to make nautilus NOT pop up a new window when  
 you open another folder?  That drives me nuts!

I don't know if this works on Fedora, because I suspect it may be an Ubuntu-specific feature, but, in a Nautilus window: Edit -> Preferences -> Behaviour -> Always open in browser windows (should be checked) If this isn't applicable to your Nautilus build, there's the following, slightly hackish, way: 1. Run 'gconf-editor'. 2. Navigate to /apps/nautilus/preferences 3. Turn on the always_use_browser property. -Lars

Awesome! thanks (BTW, worked as you said in Fedora 10) -Steve
Apr 08 2009
prev sibling next sibling parent reply "Saaa" <empty needmail.com> writes:
I'm not really sure about this, but doesn't running the error check tool 
clean the cache? 
Apr 06 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Saaa wrote:
 I'm not really sure about this, but doesn't running the error check tool 
 clean the cache? 

I have no idea.
Apr 06 2009
prev sibling next sibling parent Brad Roberts <braddr puremagic.com> writes:
Walter Bright wrote:
 Daniel Keep wrote:
 Windows is a pain in the arse, and there isn't a day that goes by where
 I don't wish I could get rid of it from my life.  But the fact is that
 it's STILL better than Linux.

What I've found about Windows is it consistently renders things better on the same display. In other words, text is more readable and easier on the eyes. I've spent a lot of time tweaking settings on Ubuntu, but it's still not as good (especially in firefox). I was recently told that the trouble must be the graphics driver. I haven't spent any effort yet trying to track that one down. On the other hand, I've found Ubuntu to be far smoother at multitasking than Windows, which frequently freezes for several seconds for no obvious reason. I find myself more and more switching back and forth between the two for specific tasks (I use a KVM switch to go back and forth). For example, my music files are hosted on a windows share but the player is running on Ubuntu.

For me, I just use windows as the portal to the linux machines. That way I get the nicer user level apps but do all my development on my preferred platform for code. That said, exactly none of my development work involves GUIs. Best of both worlds. Later, Brad
Apr 06 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 14:35:04 -0400, grauzone <none example.net> wrote:

 But shell scripting in itself is so powerful for this kind of stuff.   
 I've written lots of little scripts to do fantastic things that on  
 Windows would be so painful (without cygwin of course).  Like renaming  
 all files of a certain type to something else, or copying select files  
 to another directory.

Now wouldn't that be much more powerful to use an actual programming language for this, instead of bash? I claim with something like python, bash doesn't really have any right to exist anymore.

I can log into ANY Linux, Solaris, BSD, OSX, etc system and have a reasonable /bin/sh that allows at least bourne shell functionality. The same can't be said for almost any other scripting language you can throw at me. Of course, aside from that, I hate python syntax... And can python be used as a user shell? How would you do the same thing in python? Would it be any clearer or shorter? Probably not. I'm sure some would argue that there is no point for python if you can run perl... -Steve
Apr 07 2009
prev sibling next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Tue, Apr 7, 2009 at 2:26 PM, Walter Bright
<newshound1 digitalmars.com> wrote:
 Lutger wrote:
 Have you ever tried virtualbox? It has a seamless mode, which tears out
 windows apps in the virtual instance and make them behave just as if you
 started them under linux. It's very pleasant, you don't have to switch
 anything anymore and just run those windows userthings next to your gnome /
 kde applications.

Nope, never tried it! I just have a bad experience with multiboot systems in the past, and have tended to avoid them.

VMs have nothing to do with multiboot. I have Ubuntu in a Sun Virtualbox on my desktop and it's wonderful. It's fun to watch an OS start in a window. I can also share a folder across the boundary; the clipboard works seamlessly; input grabbing is nearly seamless. And since I can share folders, I can do fun things like work on a DS project in my favorite Windows code editor, make graphics for it in CS2, compile it using GDC on the Linux side, and run it in an emulator on the Windows side. I have the best of both worlds without any need to have multiple partitions or reboot.
Apr 07 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Tue, 07 Apr 2009 15:03:54 -0400, grauzone <none example.net> wrote:

 Steven Schveighoffer wrote:
 On Tue, 07 Apr 2009 14:35:04 -0400, grauzone <none example.net> wrote:

 But shell scripting in itself is so powerful for this kind of stuff.   
 I've written lots of little scripts to do fantastic things that on  
 Windows would be so painful (without cygwin of course).  Like  
 renaming all files of a certain type to something else, or copying  
 select files to another directory.

Now wouldn't that be much more powerful to use an actual programming language for this, instead of bash? I claim with something like python, bash doesn't really have any right to exist anymore.

reasonable /bin/sh that allows at least bourne shell functionality. The same can't be said for almost any other scripting language you can throw at me.

Sure, /bin/sh is the least common denominator. But is there a UNIX that can't run python?

I would guess there isn't. But when someone says, "hey, I need a script that does this," I don't ever have to say "oh, you don't have /bin/sh installed? Sorry, can't help you."
 Of course, aside from that, I hate python syntax...  And can python be  
 used as a user shell?

Don't tell me you hate it more than the clusterfuck that is sh syntax? Reading or writing sh scripts always feels like screwing in bolts into my head.

Yes, I hate it more. sh is a simple syntax (described in 34 pages, most of which are builtin functions, of my Unix in a Nutshell book), and has no standard library. All the "library" is are standard unix commands. I had to fix some shit in the live CD creator script written in python on Fedora. It took me a long, long time to figure out what it was doing. Does it *really* require you to type self every time you want to access a member? And what's up with all the freakin underscores? You consider that a good programming syntax? The syntax of python is horrendous. The only thing I can think of that's worse is VBScript. It might be a good language, but I can't get past the syntax.
 And regarding using it as an user shell: there's an interactive command  
 line interpreter.

if you type ls, does it work, or do you have to type __run__("ls") or whatever?
 How would you do the same thing in python?  Would it be any clearer or  
 shorter?  Probably not.

Not in all cases. But in general, I'd expect it to be clearer. Python is just more similar to normal programming than sh, which is why I'd prefer it.

You thought my script was unclear? I thought you could know exactly what it's doing without even knowing sh syntax. Maybe the most confusing part was the 'fi' denoting an end of an if statement. Prove me wrong, show me a python script that does the same thing, and we'll see if it's clearer.
 sh scripts aren't very reliable either. I remember that script that  
 invoked another program. That other program produced some warning, and  
 the script interpreted it as normal output.

Oh yeah, that *must* have been the scripting language's fault. I have bugs in my D programs too, must be because D sucks?
 And escaping. I don't think there are many scripts that still work  
 correctly if they encounter "strange" filenames, like filenames with  
 spaces, special characters, or even line breaks. Yes, \n is a valid  
 character in UNIX filenames.

That is what single quoting is for. 'xy *$123' is that string exactly, no interpretation of any special characters. Want to know a good trick to play on a unix newbie? Make a file in their home directory called * touch '*' Not knowing what it is, they try to remove it: rm * hilarity ensues :)
 I'm sure some would argue that there is no point for python if you can  
 run perl...

Perl doesn't have any right to exist either. It has the same brainfuck quirks like sh. For example, defining magical global variables and such. And clusterfuck syntax. It even has a reputation as read-only language. For that matter, any language better than sh or Perl would be better for a shell.

So basically, you don't like other scripting languages so they don't have a right to exist? Interesting point of view. -Steve
Apr 07 2009
prev sibling next sibling parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 08 Apr 2009 06:38:53 -0400, Yigal Chripun <yigal100 gmail.com>  
wrote:

 On 08/04/2009 02:48, Christopher Wright wrote:
 Yigal Chripun wrote:
 ever heard of powershell? it is in fact a superior design for a shell
 compared to most unix shells.

I have tried it briefly. Too briefly to give a good analysis of it. The GUI is better than that of cmd.exe, but not anywhere near as good as, say, GNOME Terminal. (It's still fixed width, as I recall; just wider by default.) Another issue is integrating it with existing utilities.
 also, have you ever heard of rush? http://rush.heroku.com/

It's an interesting concept. I think I'll try it out. But it has nothing to do with GUIs for housing shells.

both options above are shells not terminals. in fact powershell just runs inside a cmd.exe window. both shells are orders of magnitude better than unix standard shells and of course bat files. btw, windows admins use different tools than BAT files for scripting windows - based on VB/js up until XP. now the MS recommended way is powershell. windows as an infrastructure of WMI _objects_ (as opposed to UNIX files) that provide everything you need to manage windows with scripting.

My experience with WMI is that it is buggy and very slow, not to mention really complicated. I would hate to rely on it for scripting. On the other hand, having everything as a file allows me to use all existing file processing tools to deal with anything on a UNIX system. The file API is simple and doesn't require me to look at an object spec to do simple tasks.
 Windows has a different design than Unix's "everything is a file" which  
 IMO is a stupid legacy design from the 70's.

The old "technology from the 70's" chestnut. Your opinion varies from 90% of people who actually use scripts. New technology for the sake of being new isn't better.
 therefore, trying to do the unix way on windows with BAT files is simply  
 the wrong way. it doesn't work because it is not designed to work like  
 that.
 my take on all this, I'm not a huge fan of windows and it sure has its  
 own problems, but this specific aspect is done much better than UNIX and  
 all those comments about "windows doesn't support unix's "everything is  
 a file" design and therefore it's crap" just show a lot of ignorance.

It's not crap, just not as good. It's a poor replacement for the "Everything is the same" design. Having everything use the same API has huge advantages in modularity. One of my hugest pet peeves with Windows is that it has several different APIs for I/O objects, and ony sockets support the select interface. I have no idea what Windows devs were smoking when they decided not to allow select on any object. Making efficient I/O driven apps that use more than just sockets is really difficult. -Steve
Apr 08 2009
next sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Thu, Apr 9, 2009 at 3:17 AM, Alexander P=E1nek
<alexander.panek brainsware.org> wrote:
 The thing is, I don't *want* my _shell_ to be able to parse anything. It'=

 shell, not a framework with everything and two kitchensinks built in to
 parse every imaginable file format on my computer. That's the whole point=

 the UNIX philosophy: small, encapsulated tools that do one or a few tasks
 very well.

The point is that Unix uses text (and parses text) because it forces you to make everything into a file. One program has to spend a whole lot of effort producing nicely-formatted output, only to have it piped to another program which just undoes all that work. Then you have "magical" files like the things in /proc where they query the OS for data and output it as text. The point of Powershell is to keep the data in the format that it started as, avoiding all the annoying (and inefficient) transcoding to and from text files.
Apr 09 2009
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 09 Apr 2009 10:10:35 -0400, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 On Thu, Apr 9, 2009 at 3:17 AM, Alexander Pnek
 <alexander.panek brainsware.org> wrote:
 The thing is, I don't *want* my _shell_ to be able to parse anything.  
 It's a
 shell, not a framework with everything and two kitchensinks built in to
 parse every imaginable file format on my computer. That's the whole  
 point of
 the UNIX philosophy: small, encapsulated tools that do one or a few  
 tasks
 very well.

The point is that Unix uses text (and parses text) because it forces you to make everything into a file. One program has to spend a whole lot of effort producing nicely-formatted output, only to have it piped to another program which just undoes all that work. Then you have "magical" files like the things in /proc where they query the OS for data and output it as text. The point of Powershell is to keep the data in the format that it started as, avoiding all the annoying (and inefficient) transcoding to and from text files.

Yeah, somebody should make a d shell that shows us how it *really* should be done, then we might be convinced ;) -Steve
Apr 09 2009
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 08 Apr 2009 08:55:19 -0400, Yigal Chripun <yigal100 gmail.com>  
wrote:

 On 08/04/2009 14:34, Steven Schveighoffer wrote:

 My experience with WMI is that it is buggy and very slow, not to mention
 really complicated. I would hate to rely on it for scripting. On the
 other hand, having everything as a file allows me to use all existing
 file processing tools to deal with anything on a UNIX system. The file
 API is simple and doesn't require me to look at an object spec to do
 simple tasks.

well, WMI is supposed to be replaced and enhanced by powershell. So you should check that out. I agree that a uniform and consistent API is important and I'm sure that MS managed to mess that up :) but that's besides the point. "Everything is a file" does not provide a uniform API but rather provides no API.

Sure it does, open, read, select, etc. The API is all the same. So you can use standard tools to work with all files, even dynamically generated ones.
 Each unix tool has its own mini-syntax and its own set of command-line  
 arguments and you need to learn how to use each tool separately beyond  
 trivial use cases.

how is this different from some powershell set of commands? I think you are confusing the parameters for running tools with the API for system objects. If I don't know how to use a command to do what I want, I first try cmd --help, then man cmd if that doesn't show what I need. I'm sure it's not much different than powershell commands.
 At my work, we program in a *nix environment (Solaris) and I also use  
 Linux extensively So I know my way on *nix systems but I simply cannot  
 remember all the different argument for each util. every time I need to  
 find a file I need to ask a co-worker how to use "find". So in my  
 experience there's nothing simple and uniform about unix tools and I use  
 those constantly at work.

Again, you are confusing tool usage with OS object API. Do you actually use powershell? Do you find that it's objects or tools beam their usage directly into your brain or do you have to look up a manual to see how it works? Maybe you don't have to ask your coworkers about powershell objects because *nobody uses it*.
 given that both options suck - I'd prefer dealing with objects rather  
 than raw files that need to be parsed.
 i.e. someDir.list() which returns an array of files is better than using  
 ls on unix.

The question is not whether you want to deal with that, it's whether other tools deal with that. Since the interface between tools is well defined on unix (file descriptors), all tools can be made to work with eachother. If some powershell object expects an array of File objects, but your directory tool is outputting an array of strings, you're SOL (this probably isn't the case, but I'm sure some more obscure objects suffer from this). Since most unix tools treat input data as whitespace/newline delineated tokens, you only need to deal with rare special cases. Most of the time, they just work together without any effort.
 Windows has a different design than Unix's "everything is a file"
 which IMO is a stupid legacy design from the 70's.

The old "technology from the 70's" chestnut. Your opinion varies from 90% of people who actually use scripts. New technology for the sake of being new isn't better.

Was Colombus wrong when he said the world is round and 99.9% of people told him he's a fool?

Sure, but I'm sure he felt like one when he found out America wasn't India :) This is a rediculous point. You ain't Chris Columbus, and you're not saying anything radical here, just ignorant.
 My opinion is that there where better OS designs in the _60s_ than what  
 we use today. "everything is a file" is a complete failure.

Yes, I pity all those poor helpless Unix script writers who can't seem to accomplish anything. "If only things were objects instead of files" I always hear them say. What a load of crap.
 therefore, trying to do the unix way on windows with BAT files is
 simply the wrong way. it doesn't work because it is not designed to
 work like that.
 my take on all this, I'm not a huge fan of windows and it sure has its
 own problems, but this specific aspect is done much better than UNIX
 and all those comments about "windows doesn't support unix's
 "everything is a file" design and therefore it's crap" just show a lot
 of ignorance.

It's not crap, just not as good. It's a poor replacement for the "Everything is the same" design. Having everything use the same API has huge advantages in modularity. One of my hugest pet peeves with Windows is that it has several different APIs for I/O objects, and ony sockets support the select interface. I have no idea what Windows devs were smoking when they decided not to allow select on any object. Making efficient I/O driven apps that use more than just sockets is really difficult.

see above, MS got the it wrong. are you surprised? I'm not.

No, definitely not surprised. MS always seems to make things more complicated for the sake of, well I have no idea why. -Steve
Apr 08 2009
prev sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Thu, 09 Apr 2009 00:10:29 +1000, Daniel Keep wrote:

 Steven Schveighoffer wrote:
 [snip]
 
 -Steve

This is getting rather inflammatory, so let me clarify a few things. What Yigal should have said was that when everything is a file, there is no API for the CONTENTS of files. Yes, you can manipulate files, but it's a bit like Variants in D: you can't do anything useful with the contents unless you specifically know what they are. Powershell is designed to work with managed (.NET) objects. It can dynamically introspect these objects and pull them apart, mutate them, convert them, etc. Imagine if every file on a UNIX system also carried around a reference to its own parser, and a description of how to interpret the data. THAT is what Powershell has over UNIX shells. For example, the output of the "ls" equivalent is a table of objects. By default, it gets toString'd and displayed as a table. However, you can pipe this into a command that reorders columns. Or sorts. And you don't have to dick about with ensuring the filenames don't contain whitespace or newlines because the file names are carried around as actual strings that know their own length. Unlike UNIX, where everything is a file, to powershell everything is an object. So the list command can be used on a directory or on an object that is an aggregate of stuff. For example, you can use powershell to browse the registry as if it was just another part of the filesystem. I won't say that "everything is a file" is a failure, but powershell *definitely* exposes a superset of UNIX's functionality. Anything you can do with a UNIX-style environment, powershell can potentially do better. Microsoft really hit one out of the park with powershell, although it remains to be seen if anyone will actually use it. -- Daniel.

Ah, then the problem was using the term "everything is a file." $ ls is unrelated to that philosophy. "Everything is a file" refers to how you communicate to your kernel, not the tools used to manipulate files. That is you can open a text file and use a file descriptor, you open a socket and use a file descriptor. Maybe it would have been better to use the *nix philosophy of "chaining tools together." I've never used powershell so I'm not familiar wit the alternative.
Apr 08 2009