Re: Posix vs. Windows

2012-05-21 Thread Paulo Pinto

On Sunday, 20 May 2012 at 14:57:21 UTC, H. S. Teoh wrote:

On Sun, May 20, 2012 at 07:59:49AM +0200, Paulo Pinto wrote:
[...]
One thing I hate is visiting customers which have UNIX 
installations

configured with their default installs.

Depending on the operating system version, sometimes I feel 
like I am
back in 197x, with the original versions of vi, sh, sed, and 
so on.


The people that only have GNU/Linux or BSD experience, don't 
have any
idea how spoiled they are when compared with the commercial 
UNIX

vendors offerings.

[...]

Commercial Unixen have been on the decline for the last 2 
decades

(probably more).

I remember having to work with Solaris in my first job. I had 
the
dubious pleasure of working with its packaging system once, and 
...


Let's put it this way: I first started using Linux back in the 
day when

you had to download packages manually and sort out all package
dependencies by hand. Get just _one_ package with the wrong 
version, and
you have a broken system. Lots of roundtrips on sneakernet. 
Imagine the
horror of that. Now, that was actually a _pleasure_ in 
comparison with
the Solaris package manager.  That's how horrible it was. It 
doesn't
keep track of files (what is a package manager _for_ again?!): 
it
liberally overwrites files from different packages, leaves 
random files
lying around after removing packages which causes all sorts of 
conflicts
with future package installations, has no usable version 
tracking to
speak of, and in general is such a horrible train wreck you 
might as
well be installing the entire system from tarballs instead 
(you'd
probably have an easier time). It's all the horror of Windows 
without
Install Shield, minus the eye-candy, and without the option to 
reinstall
the entire OS when things screw up horribly (because usually 
it's
running on a critical production server that can't afford to go 
down).


And today Linux is actually making its way onto non-technical 
user's
desktops (e.g. Ubuntu), with automated installs, one-command 
upgrade
between _major_ OS releases, autodetected system configuration 
(e.g.,
X11)?  It's the difference between north pole and south pole. 
Commercial
Unixen for all practical purposes are as dead as can be, 
waiting for the

final nails to be driven into their collective coffins.


T


Well on my part of the world commercial UNIX is pretty much alive.

Enterprise companies like a lot the type of support contracts 
they can get from UNIX vendors. Plus there are many features 
where Linux/BSD still aren't a match, like the Solaris ZFS, or 
the security zones for application sandboxing.


But thanks for your reply, it really shows how the life in real 
UNIX land looks like, for those that only know GNU/Linux and BSD.


--
Paulo


Re: Posix vs. Windows

2012-05-20 Thread Paulo Pinto

Am 20.05.2012 07:43, schrieb H. S. Teoh:

[...]

That said, some editors, like Sublime Text 2 (my current favorite)
have a vi mode that functions pretty closely to how vi does. It's
another way to ease your way into the vi mindset, as it were.
Personally, I know enough vi to get around but not enough to prefer
it. It's simy a matter of necessity though, as vi is the only editor
I've found installed on every system I need to edit on. Too bad it
couldn't at least be vim though.


Ugh. Plain vi (non-vim) is a bear to use. Many non-vim vi's have an undo
buffer with a depth of 1. And it just goes downhill from there. :-P

But at least, once you've eased into the vim mindset, you can navigate
around inferior vi's without stumbling into electric fences and stubbing
your toes.


T



One thing I hate is visiting customers which have UNIX installations 
configured with their default installs.


Depending on the operating system version, sometimes I feel like I am
back in 197x, with the original versions of vi, sh, sed, and so on.

The people that only have GNU/Linux or BSD experience, don't have any
idea how spoiled they are when compared with the commercial UNIX vendors 
offerings.


--
Paulo


Re: Posix vs. Windows

2012-05-20 Thread H. S. Teoh
On Sun, May 20, 2012 at 07:59:49AM +0200, Paulo Pinto wrote:
[...]
 One thing I hate is visiting customers which have UNIX installations
 configured with their default installs.
 
 Depending on the operating system version, sometimes I feel like I am
 back in 197x, with the original versions of vi, sh, sed, and so on.
 
 The people that only have GNU/Linux or BSD experience, don't have any
 idea how spoiled they are when compared with the commercial UNIX
 vendors offerings.
[...]

Commercial Unixen have been on the decline for the last 2 decades
(probably more).

I remember having to work with Solaris in my first job. I had the
dubious pleasure of working with its packaging system once, and ...

Let's put it this way: I first started using Linux back in the day when
you had to download packages manually and sort out all package
dependencies by hand. Get just _one_ package with the wrong version, and
you have a broken system. Lots of roundtrips on sneakernet. Imagine the
horror of that. Now, that was actually a _pleasure_ in comparison with
the Solaris package manager.  That's how horrible it was. It doesn't
keep track of files (what is a package manager _for_ again?!): it
liberally overwrites files from different packages, leaves random files
lying around after removing packages which causes all sorts of conflicts
with future package installations, has no usable version tracking to
speak of, and in general is such a horrible train wreck you might as
well be installing the entire system from tarballs instead (you'd
probably have an easier time). It's all the horror of Windows without
Install Shield, minus the eye-candy, and without the option to reinstall
the entire OS when things screw up horribly (because usually it's
running on a critical production server that can't afford to go down).

And today Linux is actually making its way onto non-technical user's
desktops (e.g. Ubuntu), with automated installs, one-command upgrade
between _major_ OS releases, autodetected system configuration (e.g.,
X11)?  It's the difference between north pole and south pole. Commercial
Unixen for all practical purposes are as dead as can be, waiting for the
final nails to be driven into their collective coffins.


T

-- 
PNP = Plug 'N' Pray


Re: Posix vs. Windows

2012-05-19 Thread H. S. Teoh
On Sat, May 19, 2012 at 04:10:29AM +0200, Mehrdad wrote:
 On Saturday, 19 May 2012 at 01:28:32 UTC, H. S. Teoh wrote:
 You must be using Emacs with a GUI.
 
 No, I told you I hate Emacs. :P
 I've seen *other* people do it, and it's horribly slow.

Well, let's just say that Emacs and gui in a single sentence is just a
recipe for pain. Especially when you're talking about doing it over the
network.


[...]
 Which is what I mean. GUI's are useless across an SSH connection.
 
 Ah, ok. That makes more sense than GUIs are slow over an internet
 connection.
 Yes, SSH wasn't designed for GUIs (or the converse), so of course
 it's slow.

Although, to be fair, the reason for much of this slowness on *nix
systems is that X11 is one phat protocol. Trying to to run X11 over a
remote SSH session is like trying to parse a 5MB XML file on a 386 with
512k RAM instead of just reading the data directly from a binary file.
It's just _asking_ for pain, and lots of it.


 Trying to force GUIs onto *nix systems is like trying to force a
 command-line tool on Windows... doesn't exactly work the way it's
 supposed to, and it gives you the wrong impression.

Well... I think a lot of it is that people are used to the way Windows
work, and they imagine that _all_ GUIs must work just like that. Which
is not true.

On the flip side, X11 was designed in a bygone age, and its age is
showing (and rather badly at that). It paid lots of attention to little
trivial things that are no longer applicable in today's systems, and as
a result performs poorly over the internet. There have been efforts to
design a more modern windowing system, but none of them have caught on
just yet. One day it's bound to happen, though.


[...]
 Oh? It's called rename the method and recompile, get 50 pages of
 compile errors, pipe it to a grep command that extracts the filenames
 and line numbers, use sed to transform that into a sed command that
 automatically substitutes every instance of the matching identifier
 on the given files/line numbers.
 
 See, I told you I was a command-line freak. :-)
 
 
 
 Yes, that's clever. :P **EXCEPT**:
 
 1. Compilers (cough, DMD?) generally limit their output to a few dozen
 errors, so your '50 pages' is kinda off. :P But yea, you could just
 loop until it works.
 
 
 2. Okay, so that's clever. :P Now tell me what you do when you have
 dozens of lines in your source file like
 
   @property auto length() { return _range.length; }
 
 and you want to rename the field 'length'? How do you prevent the
 second one from getting renamed?

Substitute length( with size( instead of just length with size.
Problem solved. :-)


 Or say you have
 
   @property auto back() { ... }
   @property moveBack() { assert(0, Cannot move an element from the
 back!); }
   auto popBack() { }// Remove an element from the back
 
 and you change the name of the property 'back' to 'last':
 
   @property auto back() { ... }
   @property moveBack() { assert(0, Cannot move an element from the
 last!); }
   auto popBack() { }// Remove an element from the last
 
 Notice something funny?

Again, you rename back( to last( instead of back to last. This
is a trivial mistake that anyone who's used vim for at least a year
would've known without thinking twice. :-)


 Worse yet, no way in hell that a command-line tool would tell you your
 documentation is messed up. :P

Oh yeah? And what about when documentation mentions the old name of the
method? In which case you *want* to rename it. :-)


 Well, I _did_ demonstrate how to do it above, given the proper tools
 and shell support. :-) It's a bit clunky, but hey, it works.  And if
 you get further compile errors, just look those up (using suitable
 combinations of grep/sed) and undo the wrong substitutions. Just two
 steps, and you're done.
 
 
 You're done? Or so you think.
 See above.

I did say it's clunky. But it's also a trivial case that one quickly
learns and remembers how to deal with correctly. :-)


 My IDE is called vim. :-P *runs and hides*
 
 Better than Emacs loll :-P  *also runs and hides*

OK, no need to ignite the flames for that flamewar.


 You're missing the point. My point was that you can do this with
 *arbitrarily complex sequences of operations*. Yes search and replace
 with regex is a specific command that's supported by your IDE, but
 what about move one line down, one word over, increment the number
 by 1 repeated 50 times to repair a table of numbers that had some
 miscalculations?
 
 Visual Studio has a Record Macro feature, to record keystrokes and
 such, but I haven't used it, so I don't know if it does what you want
 -- but yeah, if it doesn't, I can see why you'd choose
 Vim/Emacs/whatever.

Plus, you've to keep in mind that integration with arbitrary shell
commands add a whole new dimension to this that no Windows-centric IDE
can ever hope to achieve. Like filter selected lines through grep, sed,
and this 1-line perl script that transforms the text 

Re: Posix vs. Windows

2012-05-19 Thread Paulo Pinto

Am 19.05.2012 04:15, schrieb Mehrdad:

On Saturday, 19 May 2012 at 02:10:31 UTC, Mehrdad wrote:

Worse yet, no way in hell that a command-line tool would tell you your
documentation is messed up. :P



I should submit a correction:

Nothing wrong with the command-line-ness per se -- it's just that
command-line tools happen to be text-based, so when they just work with
text, they miss the fact that it's documentation and not code. It's just
that I haven't seen a command-line tool do refactoring like that.

An IDE would obviously make the same mistake, if you used Search/Replace
instead of actually doing refactoring.


I used to be an Emacs fan, but the no Emacs plugins are able to deliver 
the set of tools any IDE offers.


- visual code navigation, away better than cscope/ctags are able to offer
- dependency analysis tools between modules
- code refactoring
- compile as you write
- code completion with direct code documentation popups
- method/classes information as popup
- RAD tools for UI generation
- Locate all usages of a given symbol, even across compiled modules
- Show call sequences for a given method/function
- Find using semantic information
- Plugins repositories
- Debugger integration, with possible edit and continue

All of the above feature made me a fan of IDEs, since the MS-DOS days.

You can do a lot of those features in Emacs or VIM, but they are all 
text based, and always feel like a poor man's solution, when you already

experienced the IDE ones.

--
Paulo



Re: Posix vs. Windows

2012-05-19 Thread Mehrdad

On Saturday, 19 May 2012 at 06:47:48 UTC, H. S. Teoh wrote:

One day it's bound to happen, though.


Yeah I'd heard about some similar stuff too, waiting to hear 
about it.



Substitute length( with size( instead of just length with 
size. Problem solved. :-)



Er, you missed the entire point of my example. :\

Those were PROPERTIES. They are used *without* parentheses. Your 
solution doesn't actually work on them. :P




Worse yet, no way in hell that a command-line tool would tell 
you your documentation is messed up. :P


Oh yeah? And what about when documentation mentions the old 
name of the method? In which case you *want* to rename it. :-)



My answer might suprise you then... you should _REALLY_ try using 
a real IDE to get a feel for what I'm talking about.


Eclipse actually _automatically renames_ identifiers inside your 
documentation comments.
All it takes is Alt+Shift+R to say you want to rename an 
identifier, and it corrects all references _as you type_.
With 100% accuracy, I might add. Unlike the CLI-based solution, 
it's NOT a half-baked text-based solution. AFAIK it uses the 
syntax tree.


Try doing that in your-text-editor-here

:P


I did say it's clunky. But it's also a trivial case that one 
quickly learns and remembers how to deal with correctly. :-)


Again, see above.
Your solution fails miserably when you're working with properties 
like In my example, since those don't have any parentheses.



Plus, you've to keep in mind that integration with arbitrary 
shell commands add a whole new dimension to this that no 
Windows-centric IDE can ever hope to achieve.



+1 yes, it's powerful indeed. But they're all text-based.

Editing source code with text-based tools is error-prone. Editing 
them with an IDE that uses the syntax tree is not.


Simple as that.




It is possible in theory


key word here   :P^


Thing is, in vim the various movement keys can be applied as 
modifiers to a particular action. And because these are logical 
entities, not physical positions, the same command can be 
applied to vastly different parts of the text and still have 
the same logical meaning. That is, 2 paragraphs in this case 
may span 6 lines, but in another part of the file it may span 8 
lines.


Yes, that's very powerful. But again, it's for *TEXT*, not CODE.  
Unless your editor can go two scopes down and six statements to 
the right, what you're saying doesn't really work for code (or 
maybe I'm not understanding it right?).




Eeek! On most modern keyboards, PgUp/PgDn, etc., are so far out 
of the way that you might as well reach for the mouse.



Lol, 100% correct -- except in my situation. :P

I code on my laptop, and it's Fn+Up and Fn-Down. Home/End are 
Fn-Left and Fn-Right.
Takes a little getting used to at the beginning, but it's VERY 
handy. :)


Especially compared to ESC, as you mentioned.


Yikes. I wouldn't touch Windows 7 with a 20-foot sterilized 
flagpole. XP was the last usable version of Windows in many 
senses of the word.



If you haven't used it then you can't really say that now, can 
you? (If you're thinking of Vista when you think of 7, FYI it's 
on the opposite end of the spectrum from Windows 7. And if you 
don't like the looks, you can always switch to an XP-like theme, 
like me.)




There's a reason the adoption rate of Windows 7 is 
significantly slower than MS would like.


I thought it was doing well?

But yeah I just swallowed your chunk of salt, thanks. :P



Now don't get me wrong, Ubuntu is doing a very good thing in 
making Linux accessible to the masses, but frankly, you haven't 
 _really_ used Linux until you've mastered the command-line and 
can regularly compose long chains of pipes that does magical 
transformations to data without thinking twice. In my previous 
job, there was a part-time contractor who regularly writes 
5-line long bash commands complete with subshells, multiple 
redirections, obscure sed/grep tricks, AND HAVE IT ALL WORK THE 
FIRST TIME ROUND WITHOUT NEEDING TO HIT BACKSPACE EVEN ONCE. 
Seriously, the guy just breathes bash command lines like a fish 
in water,



My God, how I wish I could do that! :O As much as I'm not a Linux 
fan, I still want that ability -- it can be very *very* useful in 
quite a few situations!!



it's uncanny. Sometimes you just stare at him compose these 
incredibly complex commands and your jaw just drops to the 
floor in  amazement. Your first thought is that can't possibly 
work! Isn't that a typo right there?! He spelt that option 
wrong! and then the next second, your eyes are popping out of 
their sockets, what the... it WORKED?!?!?!.


I've seen 1 person who did stuff *close* to what you're 
describing... and yes, my jaw dropped indeed, so I know what you 
mean perfectly. it's... out of this world... x___x



Sufficiently advanced shell commands are indistinguishible from 
physics-defying magic. ;-)


+1


(If you've ever had to deal with the monstrosities that are 
makefiles for very 

Re: Posix vs. Windows

2012-05-19 Thread Dmitry Olshansky

On 19.05.2012 3:03, H. S. Teoh wrote:

On Fri, May 18, 2012 at 11:08:26PM +0200, Mehrdad wrote:

On Friday, 18 May 2012 at 19:40:35 UTC, H. S. Teoh wrote:

This is one of those things that makes Windows (l)users wonder how we
Unix people can stand using the shell all day -- their idea of shell
is the DOS prompt (a veritable train wreck of train wrecks).  If only
they knew what a *real* shell can do. ;-)



Don't generalize. :P


Well, that was partially tongue-in-cheek. ;-)



I'm a Windows user, but yes, I've used Linux and yes, the command
prompt is indeed a train wreck. Bash is indeed a lot better.

And no, I haven't used PowerShell; I hate programs that take too long
to start up.


Whoa. PowerShell takes a long time to start up? Sounds like it's already
a train wreck even before you start using it.



Far is the command line for windows. And a decent editor, and ftp client 
that doesn't suck and..


--
Dmitry Olshansky


Re: Posix vs. Windows

2012-05-19 Thread Stewart Gordon

On 19/05/2012 00:51, H. S. Teoh wrote:

On Sat, May 19, 2012 at 01:21:56AM +0200, Mehrdad wrote:

On Friday, 18 May 2012 at 23:02:18 UTC, H. S. Teoh wrote:


I find IDEs more painful to use than scratching your nails on a
chalkboard. The inability of running an IDE over a remote SSH
session without everything slowing down to a snail crawl makes it
completely unusable for me.


Have you tried running Eclipse/Visual Studio over Remote Desktop on
Windows?


I don't use Windows except when I have to fix my wife's windows laptop.
:-P



Was it actually that slow?


Anything that has a GUI is unacceptably slow over a remote connection,
last time I checked. I'm not talking about connecting over a local
network, which doesn't really count, but a connection over the internet.


If you want to see _real_ slowness, try opening in MS Access (running locally) a .mdb that 
is on a fileserver accessed via a VPN connection.  That's what they briefly made me do in 
one of my recent jobs.


snip

It works on Linux as well, and it's amazing. (Not quite as powerful
as Emacs/Vim, but it's hella more intuitive/easier to use, so worth
it IMO.)


Intuitive text editors are ultimately also limited by their
intuitiveness, because what most people think of as intuitive is what
I type appears on the screen and I don't have to memorize obscure key
sequences to get stuff done.

snip

No, because such an editor could still provide obscure key sequences for those advanced 
features that are beyond what can reasonably be done with an intuitive GUI.  Whatever 
those advanced features are.


Stewart.


Re: Posix vs. Windows

2012-05-19 Thread Sean Kelly
On May 18, 2012, at 5:39 PM, Mehrdad wfunct...@hotmail.com wrote:
 
 Yeah, imagine trying to name a method named getValue() to something else 
 (probably because you realized that's not a great name :P).
 
 A HUGE time waster without refactoring tools, and last time I checked, no 
 text-based tool did it.

Possibly because this can be accomplished from the command line with 
find/grep/sed and the like. 

Re: Posix vs. Windows

2012-05-19 Thread Sean Kelly
On May 18, 2012, at 7:10 PM, Mehrdad wfunct...@hotmail.com wrote:
 
 2. Okay, so that's clever. :P Now tell me what you do when you have dozens of 
 lines in your source file like
 
@property auto length() { return _range.length; }
 
 and you want to rename the field 'length'? How do you prevent the second one 
 from getting renamed?

sed using a regex that accounts for more of the line than just length, like  
length(.  It only gets tricky if you are renaming a method call with a 
non-unique name, which is when you need to use compiler output to flag the 
offending lines since pure text analysis won't cut it. 

 Or say you have
 
@property auto back() { ... }
@property moveBack() { assert(0, Cannot move an element from the back!); 
 }
auto popBack() { }// Remove an element from the back
 
 and you change the name of the property 'back' to 'last':
 
@property auto back() { ... }
@property moveBack() { assert(0, Cannot move an element from the last!); 
 }
auto popBack() { }// Remove an element from the last
 
 Notice something funny?

Three operations, one for each method actually being renamed. Ultimately, it's 
hard to replace a real refactoring tool since it has a compiler built-in 
though. That said, I don't personally do this kind of thing... pretty much 
ever. So using a special tool when needed seems like an option. 


Re: Posix vs. Windows

2012-05-19 Thread Paulo Pinto

On Saturday, 19 May 2012 at 13:49:28 UTC, Sean Kelly wrote:
On May 18, 2012, at 7:10 PM, Mehrdad wfunct...@hotmail.com 
wrote:


2. Okay, so that's clever. :P Now tell me what you do when you 
have dozens of lines in your source file like


   @property auto length() { return _range.length; }

and you want to rename the field 'length'? How do you prevent 
the second one from getting renamed?


sed using a regex that accounts for more of the line than just 
length, like  length(.  It only gets tricky if you are 
renaming a method call with a non-unique name, which is when 
you need to use compiler output to flag the offending lines 
since pure text analysis won't cut it.




Somehow I fail to see how this is more productive than doing a 
rename method

option.


Re: Posix vs. Windows

2012-05-19 Thread Sean Kelly
On May 19, 2012, at 7:00 AM, Paulo Pinto pj...@progtools.org wrote:

 On Saturday, 19 May 2012 at 13:49:28 UTC, Sean Kelly wrote:
 On May 18, 2012, at 7:10 PM, Mehrdad wfunct...@hotmail.com wrote:
 2. Okay, so that's clever. :P Now tell me what you do when you have dozens 
 of lines in your source file like
   @property auto length() { return _range.length; }
 and you want to rename the field 'length'? How do you prevent the second 
 one from getting renamed?
 
 sed using a regex that accounts for more of the line than just length, 
 like  length(.  It only gets tricky if you are renaming a method call with 
 a non-unique name, which is when you need to use compiler output to flag the 
 offending lines since pure text analysis won't cut it.
 
 
 Somehow I fail to see how this is more productive than doing a rename method
 option.

It isn't necessarily more efficient. But most editors don't have a compiler 
built-in, and the ones that do aren't always practical to use. 

Re: Posix vs. Windows

2012-05-19 Thread Paulo Pinto

Am 19.05.2012 15:35, schrieb Sean Kelly:

On May 18, 2012, at 5:39 PM, Mehrdadwfunct...@hotmail.com  wrote:


Yeah, imagine trying to name a method named getValue() to something else 
(probably because you realized that's not a great name :P).

A HUGE time waster without refactoring tools, and last time I checked, no 
text-based tool did it.


Possibly because this can be accomplished from the command line with 
find/grep/sed and the like.


While wiping everything else that is also called getValue() along the 
way, even if they belong to instances of other classes.


I like UNIX and the command line is invaluable for certain tasks 
regardless of the operating system, but sometimes I wonder if people 
realized that it is no longer 1970 and better ways to develop software 
do exist.


--
Paulo


Re: Posix vs. Windows

2012-05-19 Thread David Nadlinger

On Saturday, 19 May 2012 at 19:28:44 UTC, Paulo Pinto wrote:
I like UNIX and the command line is invaluable for certain 
tasks regardless of the operating system, but sometimes I 
wonder if people realized that it is no longer 1970 and better 
ways to develop software do exist.


…especially because it would be perfectly possible to provide a 
command-line interface to »intelligent« (i.e. frontend-backed) 
refactoring tools as well.


David


Re: Posix vs. Windows

2012-05-19 Thread H. S. Teoh
On Sat, May 19, 2012 at 09:45:20AM +0200, Mehrdad wrote:
 On Saturday, 19 May 2012 at 06:47:48 UTC, H. S. Teoh wrote:
[...]
 Substitute length( with size( instead of just length with
 size. Problem solved. :-)
 
 
 Er, you missed the entire point of my example. :\
 
 Those were PROPERTIES. They are used *without* parentheses. Your
 solution doesn't actually work on them. :P

OK, I concede. :)


 Worse yet, no way in hell that a command-line tool would tell you
 your documentation is messed up. :P
 
 Oh yeah? And what about when documentation mentions the old name of
 the method? In which case you *want* to rename it. :-)
 
 My answer might suprise you then... you should _REALLY_ try using a
 real IDE to get a feel for what I'm talking about.
 
 Eclipse actually _automatically renames_ identifiers inside your
 documentation comments.
 All it takes is Alt+Shift+R to say you want to rename an identifier,
 and it corrects all references _as you type_.
 With 100% accuracy, I might add. Unlike the CLI-based solution, it's
 NOT a half-baked text-based solution. AFAIK it uses the syntax tree.

Now that _is_ pretty cool.

Actually I've been thinking about this kind of problems. It's not just
code, actually, the problem is much more general than that. It applies
to _any_ structured text.

See, the thing is, one of the reasons I like vim in spite of its warts
(yes it has warts, including what we're discussing here about syntax
trees transformations) is that it gives me a _unified_ environment for
working with all kinds of files: text files, XML files, configuration
files with their own syntax, code in all kinds of languages, other files
with formatted syntax, Python (hehe), and even my 4-dimensional esolang.
The unification is very convenient: no need to switch between 15
different tools to work with different file formats. Better yet, you can
do things like quote code in emails, write cross-language code, etc.,
without flinching.

But this unification is also its downfall: plain text, as the lowest
common denominator, also suffers from not being able to deal with syntax
trees in a meaningful way.

So what is needed is a way of plugging in arbitrary syntax tree parsers,
such that you can have a generic editing environment which can handle
any structured text, not just code, but _anything_ that can be parsed.
You then have a basic core of text-editing operations, plus semantic
operations that work with the syntax trees directly.

Now vim actually does have plugin capability, though I'm not sure if
it's general enough to do what I just described.


 Try doing that in your-text-editor-here
 
 :P

Don't be shocked if you find a vim plugin that does just that. ;-)


 I did say it's clunky. But it's also a trivial case that one quickly
 learns and remembers how to deal with correctly. :-)
 
 Again, see above.  Your solution fails miserably when you're working
 with properties like In my example, since those don't have any
 parentheses.

True.


 Plus, you've to keep in mind that integration with arbitrary shell
 commands add a whole new dimension to this that no Windows-centric
 IDE can ever hope to achieve.
 
 
 +1 yes, it's powerful indeed. But they're all text-based.
 
 Editing source code with text-based tools is error-prone. Editing them
 with an IDE that uses the syntax tree is not.
 
 Simple as that.

It would be really cool if there were syntax tree manipulators that
could do stuff like that. Actually, thinking a bit more about what I
wrote above, what if there were external parser programs that can do
these kinds of transformations, then you can just invoke them to do
their magic when you need syntax-tree based manipulations. A text editor
really should just do one thing: edit text. With full command-line
integration, you can even bind certain operations to external utilities
that specialize in whatever language/format they're designed to deal
with. Unix philosophy: every program does one thing, and does it really
well; connect them together, and you can do stuff no individual program
can hope to do, even stuff none of the authors of said programs even
imagined possible.


 It is possible in theory
 
 key word here   :P^

Ah, but isn't that what we programmers specialize in? Turning theory
into reality. ;-)


 Thing is, in vim the various movement keys can be applied as
 modifiers to a particular action. And because these are logical
 entities, not physical positions, the same command can be applied to
 vastly different parts of the text and still have the same logical
 meaning. That is, 2 paragraphs in this case may span 6 lines, but in
 another part of the file it may span 8 lines.
 
 Yes, that's very powerful. But again, it's for *TEXT*, not CODE.
 Unless your editor can go two scopes down and six statements to the
 right, what you're saying doesn't really work for code (or maybe I'm
 not understanding it right?).

Actually, vim does have some rudimentary support for moving across
scopes. I don't know 

Re: Posix vs. Windows

2012-05-19 Thread H. S. Teoh
On Sat, May 19, 2012 at 09:43:13PM +0200, David Nadlinger wrote:
 On Saturday, 19 May 2012 at 19:28:44 UTC, Paulo Pinto wrote:
 I like UNIX and the command line is invaluable for certain tasks
 regardless of the operating system, but sometimes I wonder if
 people realized that it is no longer 1970 and better ways to
 develop software do exist.
 
 …especially because it would be perfectly possible to provide a
 command-line interface to »intelligent« (i.e. frontend-backed)
 refactoring tools as well.
[...]

+1. I think the ideal development environment would be one where there
are reusable parsers and syntax-tree rewriters (either standalone
programs or libraries with generic API), that can be used to do
semantic-level text manipulations, which can then be used with basic
text-editing functions.

I envision something like this (using vim as an example, substitute your
favorite editor at will): have a bunch of language-specific plugins,
like xml, c, c++, d, etc., for basic syntax-tree level navigation
through source code, bound to a bunch of designated syntax-tree
navigation keys in the editor, plus a bunch of language-specific
operations (like rename identifiers, move nested function in/out of
nesting, etc.) bound to some kind of command interface, which can be
aliased to unused command keys. These plugins can be applied to
arbitrary blocks of text -- usually an entire buffer, but possibly to
sections within a buffer, such as D code embedded in an email, or XML
embedded in a heredoc, etc..

The plugins autodetect the environment they're in, much like vim already
does nowadays to a limited extent, but you can also bind specific
plugins to sections of text at will.

Now you have an environment that lets you work on all kinds of files in
all kinds of formats, with basic text editing capability common to all
of them, plus semantic actions for language-specific operations.

Best of all, these plugins have a common, generic API, that can be
reused by _anything_. Imagine if you can, for example, grep for stuff in
a large source tree and have grep automatically detect the language of a
particular file so that it can use a plugin for locating stuff at
specified places in a syntax tree. You'd then be able to do really handy
stuff like find this regex in the body of for loops that are nested
inside a top-level function, or enumerate all occurrences of
if-statements nested at least 3 levels deep.


T

-- 
Error: Keyboard not attached. Press F1 to continue. -- Yoon Ha Lee, CONLANG


Re: Posix vs. Windows

2012-05-19 Thread Mehrdad

On Saturday, 19 May 2012 at 20:00:03 UTC, H. S. Teoh wrote:

Now that _is_ pretty cool.


:D yes!

See, the thing is, one of the reasons I like vim in spite of 
its warts (yes it has warts, including what we're discussing 
here about syntax trees transformations) is that it gives me a 
_unified_ environment for working with all kinds of files


Indeed, that's one of the major reasons people use text editors 
over IDEs for a lot of tasks.



Don't be shocked if you find a vim plugin that does just that. 
;-)


I dunno, I might be xD



It would be really cool if there were syntax tree manipulators


Omg yeah. And I think D is probably the closest to getting 
something like that.


I remember asking about whether something like this this in 
StackOverflow, but (perhaps because I didn't phrase myself 
properly) people didn't really understand what I was saying and I 
kinda got blank responses lol.



Ah, but isn't that what we programmers specialize in? Turning 
theory into reality. ;-)


Touche


Actually, vim does have some rudimentary support for moving 
across scopes. I don't know about statements, though.


Yeah, editors often have brace-matching and stuff (go to 
matching/enclosing brace) but yeah, not statements.



Honestly, I like the layout better (the standard PC keyboard is 
way too wide). However, the _size_ of a laptop keyboard is just 
too uncomfortable for me


Yup, I've been debating if I want a real-sized keyboard or not... 
might order one these days. :)



OK I admit I was being unfair. See, my problem is, the second I 
have to deal with rodent navigation and clicking through menus, 
I just get really really frustrated that I can't just tell the 
stupid machine to do what I already know I want to do.


Totally understand what you mean -- I could say the same thing 
for *nix tools, just the other way around. (Why can't I *browse* 
my choices? why do I have to look at /documentation/, for God's 
sake, to figure out how to just locate a file on my computer? 
etc.)




Yikes!!


Indeed, that says it all. xD


You do realize that building GCC involves two stages, right?


Someone told me like a year later. XD



http://www.vim.org/scripts/script.php?script_id=301
Ah, the wonders of opensource. :-)


:) I have a love-hate relationship with OS. It's among the 
greatest things in CS but it also has its own problems. I was 
going to post a link to a blog post I read about it, but while I 
agree with it, it's a little harsher than my view, so maybe not. 
xD




Yikes! I highly recommend using plain vanilla vim, no GUI


Oh geez, that'll take a while lol. At least with GVim, I can 
discover the command names through the menus haha.




Re: Posix vs. Windows

2012-05-19 Thread Jérôme M. Berger
H. S. Teoh wrote:
 But this unification is also its downfall: plain text, as the lowest
 common denominator, also suffers from not being able to deal with syntax
 trees in a meaningful way.
 
 So what is needed is a way of plugging in arbitrary syntax tree parsers,
 such that you can have a generic editing environment which can handle
 any structured text, not just code, but _anything_ that can be parsed.
 You then have a basic core of text-editing operations, plus semantic
 operations that work with the syntax trees directly.
 
You mean like Emacs' Semantic mode?
https://www.gnu.org/software/emacs/manual/html_node/emacs/Semantic.html

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



signature.asc
Description: OpenPGP digital signature


Re: Posix vs. Windows

2012-05-19 Thread Mehrdad
On Saturday, 19 May 2012 at 20:58:40 UTC, Jérôme M. Berger 
wrote:

You mean like Emacs' Semantic mode?
https://www.gnu.org/software/emacs/manual/html_node/emacs/Semantic.html






O_O


Re: Posix vs. Windows

2012-05-19 Thread Sean Kelly
On May 19, 2012, at 1:35 PM, Mehrdad wfunct...@hotmail.com wrote:

 On Saturday, 19 May 2012 at 20:00:03 UTC, H. S. Teoh wrote:
 
 Yikes! I highly recommend using plain vanilla vim, no GUI
 
 Oh geez, that'll take a while lol. At least with GVim, I can discover the 
 command names through the menus haha.

The only way to really learn vim is to suffer through it until it clicks. The 
experience is so fundamentally different than other editors, that menus would 
just prevent that from happening. That said, some editors, like Sublime Text 2 
(my current favorite) have a vi mode that functions pretty closely to how vi 
does. It's another way to ease your way into the vi mindset, as it were. 
Personally, I know enough vi to get around but not enough to prefer it. It's 
simy a matter of necessity though, as vi is the only editor I've found 
installed on every system I need to edit on. Too bad it couldn't at least be 
vim though. 

Re: Posix vs. Windows

2012-05-19 Thread H. S. Teoh
On Sat, May 19, 2012 at 04:53:32PM -0700, Sean Kelly wrote:
 On May 19, 2012, at 1:35 PM, Mehrdad wfunct...@hotmail.com wrote:
 
  On Saturday, 19 May 2012 at 20:00:03 UTC, H. S. Teoh wrote:
  
  Yikes! I highly recommend using plain vanilla vim, no GUI
  
  Oh geez, that'll take a while lol. At least with GVim, I can
  discover the command names through the menus haha.
 
 The only way to really learn vim is to suffer through it until it
 clicks. The experience is so fundamentally different than other
 editors, that menus would just prevent that from happening.

Exactly. Until you've grappled with GUI-less vim, you haven't _really_
used vim. I did say that it was a very frustrating experience for me.
But when it clicked, it _really_ clicked. Now I couldn't bear to use
pico or joe or any of that stuff. They've become so foreign to me.

It's one of those things that have a totally steep learning curve, but
totally worth it once you get it. Just like console Linux/bash. (Even I
myself find it hard to believe, but there was a time when I used to
_hate_ Linux.  Yeah.) Or ratpoison (aka how to use a GUI without a
mouse). :-P


 That said, some editors, like Sublime Text 2 (my current favorite)
 have a vi mode that functions pretty closely to how vi does. It's
 another way to ease your way into the vi mindset, as it were.
 Personally, I know enough vi to get around but not enough to prefer
 it. It's simy a matter of necessity though, as vi is the only editor
 I've found installed on every system I need to edit on. Too bad it
 couldn't at least be vim though. 

Ugh. Plain vi (non-vim) is a bear to use. Many non-vim vi's have an undo
buffer with a depth of 1. And it just goes downhill from there. :-P

But at least, once you've eased into the vim mindset, you can navigate
around inferior vi's without stumbling into electric fences and stubbing
your toes.


T

-- 
You are only young once, but you can stay immature indefinitely. -- azephrahel


Re: Posix vs. Windows

2012-05-18 Thread Sean Kelly
On May 17, 2012, at 1:01 PM, Mehrdad wrote:

 From looking at Phobos, I'm understanding that the main difference between 
 the implementation of various features for Posix systems as compared to 
 Windows systems (aside from the API, etc.) is that Windows tends to do a lot 
 of stuff *before* the program is loaded (and hence requires special cases in 
 a lot of places), whereas Posix systems tend to require you to call 
 initializers manually (and hence they're called just like any other function).
 
 Just wanted to check, is this understanding correct?

I'd say that Windows tends to do more for you, while Posix provides lower-level 
APIs to accomplish the same thing.  So Posix offers more control and is 
typically more robust as a result.  There are a few exceptions however, like 
SEH has proven to be far more capable than signals for certain classes of error 
handling.


 (The reasoning being, if I'm writing my own little kernel, I want to figure 
 out whether I should be compiling Phobos with Posix or with Windows, to 
 minimize my headaches... although I should mention that, either way, I'm 
 going to be developing on Windows, in PE format.)

If you're targeting Windows then use Windows APIs, if Posix then Posix.  
Windows does claim Posix support, but it's really pretty terrible and Druntime 
doesn't have declarations for the Posix Windows interface anyway.

Re: Posix vs. Windows

2012-05-18 Thread H. S. Teoh
On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]
 If you're targeting Windows then use Windows APIs, if Posix then
 Posix.  Windows does claim Posix support, but it's really pretty
 terrible and Druntime doesn't have declarations for the Posix Windows
 interface anyway.

Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T

-- 
Question authority. Don't ask why, just do it.


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Friday, 18 May 2012 at 16:37:31 UTC, Sean Kelly wrote:
I'd say that Windows tends to do more for you, while Posix 
provides lower-level APIs to accomplish the same thing.  So 
Posix offers more control and is typically more robust as a 
result.  There are a few exceptions however, like SEH has 
proven to be far more capable than signals for certain classes 
of error handling.


If you're targeting Windows then use Windows APIs, if Posix 
then Posix.  Windows does claim Posix support, but it's really 
pretty terrible and Druntime doesn't have declarations for the 
Posix Windows interface anyway.


Yeah...

The reason I asked was, I ended up calling a bunch of stuff 
manually (e.g. rt_moduleCtor), and when I looked at Phobos, I 
realized that's exactly what the Posix code already does. So I 
was thinking if I used Phobos with the Posix flag, it might be 
easier, but probably not...


Re: Posix vs. Windows

2012-05-18 Thread Alex Rønne Petersen

On 18-05-2012 18:42, H. S. Teoh wrote:

On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix.  Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T



Try doing fork() on Windows. ;)

--
Alex Rønne Petersen
a...@lycus.org
http://lycus.org


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad
On Friday, 18 May 2012 at 16:53:54 UTC, Alex Rønne Petersen 
wrote:

On 18-05-2012 18:42, H. S. Teoh wrote:

On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]
If you're targeting Windows then use Windows APIs, if Posix 
then
Posix.  Windows does claim Posix support, but it's really 
pretty
terrible and Druntime doesn't have declarations for the Posix 
Windows

interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt 
it, esp.

some parts that just goes against how Windows works.


T



Try doing fork() on Windows. ;)


I believe Interix (i.e. Windows POSIX subsystem) handles it 
perfectly well, although that's not at all related to what I was 
asking about haha.


Re: Posix vs. Windows

2012-05-18 Thread Paulo Pinto

Am 18.05.2012 18:53, schrieb Alex Rønne Petersen:

On 18-05-2012 18:42, H. S. Teoh wrote:

On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix. Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T



Try doing fork() on Windows. ;)



Easy,

Initially Windows NT family only supported POSIX.1, due to US federal 
requirements, later on it was improved by Interix und SUA


http://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

More information here,
http://technet.microsoft.com/en-us/library/cc772343
fork() == http://technet.microsoft.com/en-us/library/cc754234


--
Paulo


Re: Posix vs. Windows

2012-05-18 Thread Adam Wilson
On Fri, 18 May 2012 09:42:54 -0700, H. S. Teoh hst...@quickfur.ath.cx  
wrote:



On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix.  Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T


SUA is deprecated in Windows 8.

--
Adam Wilson
IRC: LightBender
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/


Re: Posix vs. Windows

2012-05-18 Thread Alex Rønne Petersen

On 18-05-2012 20:53, Paulo Pinto wrote:

Am 18.05.2012 18:53, schrieb Alex Rønne Petersen:

On 18-05-2012 18:42, H. S. Teoh wrote:

On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix. Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T



Try doing fork() on Windows. ;)



Easy,

Initially Windows NT family only supported POSIX.1, due to US federal
requirements, later on it was improved by Interix und SUA

http://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

More information here,
http://technet.microsoft.com/en-us/library/cc772343
fork() == http://technet.microsoft.com/en-us/library/cc754234


--
Paulo


Right, but that's not really Win32 out of the box. Cygwin implemented it 
too, in user land.


--
Alex Rønne Petersen
a...@lycus.org
http://lycus.org


Re: Posix vs. Windows

2012-05-18 Thread Sean Kelly
On May 18, 2012, at 9:42 AM, H. S. Teoh hst...@quickfur.ath.cx wrote:

 On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
 [...]
 If you're targeting Windows then use Windows APIs, if Posix then
 Posix.  Windows does claim Posix support, but it's really pretty
 terrible and Druntime doesn't have declarations for the Posix Windows
 interface anyway.
 
 Does Windows conform to the Posix spec at all? I highly doubt it, esp.
 some parts that just goes against how Windows works.

It's called SUA these days and I believe is Posix compliant. The problem is 
more that the Posix spec is so loose that Posix compliance alone doesn't mean 
very much. Tons of stuff is isn't implemented or is implemented badly, and the 
command shell is just a train wreck. 

Re: Posix vs. Windows

2012-05-18 Thread Paulo Pinto

Am 18.05.2012 20:59, schrieb Alex Rønne Petersen:

On 18-05-2012 20:53, Paulo Pinto wrote:

Am 18.05.2012 18:53, schrieb Alex Rønne Petersen:

On 18-05-2012 18:42, H. S. Teoh wrote:

On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix. Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T



Try doing fork() on Windows. ;)



Easy,

Initially Windows NT family only supported POSIX.1, due to US federal
requirements, later on it was improved by Interix und SUA

http://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

More information here,
http://technet.microsoft.com/en-us/library/cc772343
fork() == http://technet.microsoft.com/en-us/library/cc754234


--
Paulo


Right, but that's not really Win32 out of the box. Cygwin implemented it
too, in user land.



Of course it is not Win32. Windows has the capability of multiple 
subsystems.


By default 3 were offered in the beginnig: Win32, OS/2, Posix.

OS/2 is no longer available for obvious reasons.

The Posix is only one tick box away to install in any enterprise 
version, or via SUA to the home versions.


Some of the APIs are implemented at kernel level, page 53,
http://technet.microsoft.com/en-us/sysinternals/bb963901.aspx

--
Paulo


Re: Posix vs. Windows

2012-05-18 Thread H. S. Teoh
On Fri, May 18, 2012 at 12:11:33PM -0700, Sean Kelly wrote:
 On May 18, 2012, at 9:42 AM, H. S. Teoh hst...@quickfur.ath.cx wrote:
 
  On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
  [...]
  If you're targeting Windows then use Windows APIs, if Posix then
  Posix.  Windows does claim Posix support, but it's really pretty
  terrible and Druntime doesn't have declarations for the Posix Windows
  interface anyway.
  
  Does Windows conform to the Posix spec at all? I highly doubt it, esp.
  some parts that just goes against how Windows works.
 
 It's called SUA these days and I believe is Posix compliant. The
 problem is more that the Posix spec is so loose that Posix compliance
 alone doesn't mean very much. Tons of stuff is isn't implemented or is
 implemented badly, and the command shell is just a train wreck. 

Command shells have always been a train wreck on Windows, as far as I
can remember. I haven't used Windows in any serious way for more than a
decade now, so I can't speak for later versions of Windows, but I
suspect things haven't changed much.

This is one of those things that makes Windows (l)users wonder how we
Unix people can stand using the shell all day -- their idea of shell is
the DOS prompt (a veritable train wreck of train wrecks). If only they
knew what a *real* shell can do. ;-)


T

-- 
All problems are easy in retrospect.


Re: Posix vs. Windows

2012-05-18 Thread Paulo Pinto

Am 18.05.2012 21:03, schrieb Adam Wilson:

On Fri, 18 May 2012 09:42:54 -0700, H. S. Teoh hst...@quickfur.ath.cx
wrote:


On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix. Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


T


SUA is deprecated in Windows 8.



So is Win32, at least partially.


Re: Posix vs. Windows

2012-05-18 Thread Paulo Pinto

Am 18.05.2012 21:11, schrieb Sean Kelly:

On May 18, 2012, at 9:42 AM, H. S. Teohhst...@quickfur.ath.cx  wrote:


On Fri, May 18, 2012 at 09:37:23AM -0700, Sean Kelly wrote:
[...]

If you're targeting Windows then use Windows APIs, if Posix then
Posix.  Windows does claim Posix support, but it's really pretty
terrible and Druntime doesn't have declarations for the Posix Windows
interface anyway.


Does Windows conform to the Posix spec at all? I highly doubt it, esp.
some parts that just goes against how Windows works.


It's called SUA these days and I believe is Posix compliant. The problem is 
more that the Posix spec is so loose that Posix compliance alone doesn't mean 
very much. Tons of stuff is isn't implemented or is implemented badly, and the 
command shell is just a train wreck.


Developing software for multiple comercial UNIX systems has its own 
share of pains.





Re: Posix vs. Windows

2012-05-18 Thread Simon

On 18/05/2012 20:41, H. S. Teoh wrote:

Command shells have always been a train wreck on Windows, as far as I
can remember. I haven't used Windows in any serious way for more than a
decade now, so I can't speak for later versions of Windows, but I
suspect things haven't changed much.

This is one of those things that makes Windows (l)users wonder how we
Unix people can stand using the shell all day -- their idea of shell is
the DOS prompt (a veritable train wreck of train wrecks). If only they
knew what a *real* shell can do. ;-)


T



Powershell is actually very good, despite some major WTFs when 
programming in it. It's massively better than bash programming for instance.


--
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


Re: Posix vs. Windows

2012-05-18 Thread Sean Kelly
On May 18, 2012, at 9:50 AM, Mehrdad wfunct...@hotmail.com wrote:

 On Friday, 18 May 2012 at 16:37:31 UTC, Sean Kelly wrote:
 I'd say that Windows tends to do more for you, while Posix provides 
 lower-level APIs to accomplish the same thing.  So Posix offers more control 
 and is typically more robust as a result.  There are a few exceptions 
 however, like SEH has proven to be far more capable than signals for certain 
 classes of error handling.
 
 If you're targeting Windows then use Windows APIs, if Posix then Posix.  
 Windows does claim Posix support, but it's really pretty terrible and 
 Druntime doesn't have declarations for the Posix Windows interface anyway.
 
 Yeah...
 
 The reason I asked was, I ended up calling a bunch of stuff manually (e.g. 
 rt_moduleCtor), and when I looked at Phobos, I realized that's exactly what 
 the Posix code already does. So I was thinking if I used Phobos with the 
 Posix flag, it might be easier, but probably not...

The Windows code should do the same thing as far as runtime initialization is 
concerned. 

Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Friday, 18 May 2012 at 21:08:28 UTC, Mehrdad wrote:
On the other hand, I *do* wonder how CLI users get any work 
done without the ability to do GUI-related tasks (e.g. 
refactoring in Visual Studio/Eclipse/whatever?). :P


Er, I should have said GUI-aided instead of GUI-related...
It's just that I haven't seen a *single* CLI tool offer the same 
powerful features as a GUI tool like refactoring.


Of course, GUI-related tools (Photoshop? Office suites? Web 
browsing? etc.) are out of the question anyway


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Friday, 18 May 2012 at 19:40:35 UTC, H. S. Teoh wrote:
This is one of those things that makes Windows (l)users wonder 
how we Unix people can stand using the shell all day -- their 
idea of shell is the DOS prompt (a veritable train wreck of 
train wrecks). If only they knew what a *real* shell can do. ;-)



Don't generalize. :P

I'm a Windows user, but yes, I've used Linux and yes, the 
command prompt is indeed a train wreck. Bash is indeed a lot 
better.


And no, I haven't used PowerShell; I hate programs that take too 
long to start up.



I definitely know what a *real* shell can do, but I also know 
that it's *pretty damn hard* to write foolproof code in Bash.

Just look at: http://mywiki.wooledge.org/BashPitfalls


It's just that in Bash scripts, it's easier to get to 99% 
correctness than it is with batch files. But getting to 100% is a 
pain in *BOTH* (indeed, I still have no idea how to do it).



On the other hand, I *do* wonder how CLI users get any work done 
without the ability to do GUI-related tasks (e.g. refactoring in 
Visual Studio/Eclipse/whatever?). :P


Re: Posix vs. Windows

2012-05-18 Thread H. S. Teoh
On Fri, May 18, 2012 at 11:08:26PM +0200, Mehrdad wrote:
 On Friday, 18 May 2012 at 19:40:35 UTC, H. S. Teoh wrote:
 This is one of those things that makes Windows (l)users wonder how we
 Unix people can stand using the shell all day -- their idea of shell
 is the DOS prompt (a veritable train wreck of train wrecks).  If only
 they knew what a *real* shell can do. ;-)
 
 
 Don't generalize. :P

Well, that was partially tongue-in-cheek. ;-)


 I'm a Windows user, but yes, I've used Linux and yes, the command
 prompt is indeed a train wreck. Bash is indeed a lot better.
 
 And no, I haven't used PowerShell; I hate programs that take too long
 to start up.

Whoa. PowerShell takes a long time to start up? Sounds like it's already
a train wreck even before you start using it.


 I definitely know what a *real* shell can do, but I also know that
 it's *pretty damn hard* to write foolproof code in Bash.
 Just look at: http://mywiki.wooledge.org/BashPitfalls

OK, _using_ bash and _coding_ in bash are two very different things. I
routinely write complex 1-liners to do crazy complex stuff in ways that
no GUI can express. *But* I also never write bash scripts.  Well, OK,
that's a lie... I do, but never more than 1-liners, or just very simple
sequences of commands.

Because you're right: bash is good for interactive use, but it's ...
shall we say, completely atrocious for scripting? Like the stupid
implicit interpolation everywhere (and sometimes _inconsistent_ levels
of interpolation -- well OK, it's actually consistent, but not to
someone who can't recite bash code in their dreams), that causes leaning
toothpick syndrome galore.

For scripting, you want Perl, not bash.

And just for the record, I was a tcsh user for well over a decade before
I decided to use bash, 'cos tcsh also has its own suckage.


 It's just that in Bash scripts, it's easier to get to 99% correctness
 than it is with batch files. But getting to 100% is a pain in *BOTH*
 (indeed, I still have no idea how to do it).

Use Perl. :-)

And batch files... yikes. The incompleteness and quirkiness of them
makes them almost completely unusable for anything but the most trivial
of tasks. Bash scripts can do a lot more, but there are pitfalls, holes,
and hidden interpolations everywhere that threaten to disintegrate your
beautiful castle of cards if you feed it the wrong kind of data.


 On the other hand, I *do* wonder how CLI users get any work done
 without the ability to do GUI-related tasks (e.g. refactoring in
 Visual Studio/Eclipse/whatever?). :P

I find IDEs more painful to use than scratching your nails on a
chalkboard. The inability of running an IDE over a remote SSH session
without everything slowing down to a snail crawl makes it completely
unusable for me. In the amount of time it takes the beast to paint the
screen, I could've manually refactored the code three times over. The
use of a _real_ text editor (i.e., NOT that monstrous shipwreck of an
excuse for software called notepad, or its dainbramaged second cousin
wordpad) helps a lot. Like, one that can filter an arbitrary text
selection through an arbitrary-complex shell command. :-) Or that can
repeatedly apply a complex sequence of editing commands at a single
keystroke (as opposed to navigating the rodent through endless layers of
menus).

But I won't start the Visual Irritation vs. Extremely Massive And
Cumbersome System flamewar here. ;-)


T

-- 
How are you doing? Doing what?


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Friday, 18 May 2012 at 23:02:18 UTC, H. S. Teoh wrote:

I find IDEs more painful to use than scratching your nails on a 
chalkboard. The inability of running an IDE over a remote SSH 
session without everything slowing down to a snail crawl makes 
it completely unusable for me.


Have you tried running Eclipse/Visual Studio over Remote Desktop 
on Windows?

Was it actually that slow?


In the amount of time it takes the beast to paint the screen, I 
could've manually refactored the code three times over.


I don't think refactoring means what you think it means. xP


Ever tried Rename all references?

It's impossible to do correctly without IDE support, unless all 
your variable names are unique (idk about you, but I've never 
seen a project like that).


With an IDE (at least with C# in Visual Studio): just erase the 
identifier, type in the new name, Ctrl-Dot, and press Enter. 
(Probably similar with Eclipse.)


Literally, it takes 1-2 extra seconds, and it renames across your 
entire project.


I have *never* seen a text-based tool do this -- if you know of 
any, let me know!





The use of a _real_ text editor


I use SciTE, with a handful of tweaks to the source code (not 
big, just small changes).


It works on Linux as well, and it's amazing. (Not quite as 
powerful as Emacs/Vim, but it's hella more intuitive/easier to 
use, so worth it IMO.)



(i.e., NOT that monstrous shipwreck of an excuse for software 
called notepad, or its dainbramaged second cousin wordpad)


LOL those are editors? I just thought they were 'pads'...


Like, one that can filter an arbitrary text selection through 
an arbitrary-complex shell command.
Or that can repeatedly apply a complex sequence of editing 
commands at a single keystroke (as opposed to navigating the 
rodent through endless layers of menus).


Ever used macros in Visual Studio? (There might exist the same 
thing for Eclipse, idk.)


No?

Well, it does what you're saying.
In a more powerful way than you're saying. :P


But I won't start the Visual Irritation vs. Extremely Massive 
And Cumbersome System flamewar here. ;-)



...oops


Re: Posix vs. Windows

2012-05-18 Thread H. S. Teoh
On Sat, May 19, 2012 at 01:21:56AM +0200, Mehrdad wrote:
 On Friday, 18 May 2012 at 23:02:18 UTC, H. S. Teoh wrote:
 
 I find IDEs more painful to use than scratching your nails on a
 chalkboard. The inability of running an IDE over a remote SSH
 session without everything slowing down to a snail crawl makes it
 completely unusable for me.
 
 Have you tried running Eclipse/Visual Studio over Remote Desktop on
 Windows?

I don't use Windows except when I have to fix my wife's windows laptop.
:-P


 Was it actually that slow?

Anything that has a GUI is unacceptably slow over a remote connection,
last time I checked. I'm not talking about connecting over a local
network, which doesn't really count, but a connection over the internet.


 In the amount of time it takes the beast to paint the screen, I
 could've manually refactored the code three times over.
 
 I don't think refactoring means what you think it means. xP
 
 
 Ever tried Rename all references?
 
 It's impossible to do correctly without IDE support, unless all your
 variable names are unique (idk about you, but I've never seen a
 project like that).

Strange, last I checked, global variables aren't a good coding practice.
:-) Renaming local variables is a trivial search-n-replace.

But you're right that certain renamings, like a member function name
that may be overloaded across a large number of classes, could
potentially be very painful. Though what I'd really like in that case is
a syntax-tree aware text editor. Or a nice console-based IDE that isn't
dependent upon a GUI.


[...]
 The use of a _real_ text editor
 
 I use SciTE, with a handful of tweaks to the source code (not big,
 just small changes).
 
 It works on Linux as well, and it's amazing. (Not quite as powerful
 as Emacs/Vim, but it's hella more intuitive/easier to use, so worth
 it IMO.)

Intuitive text editors are ultimately also limited by their
intuitiveness, because what most people think of as intuitive is what
I type appears on the screen and I don't have to memorize obscure key
sequences to get stuff done. What you really need are _logical_
operations, like navigate to the word 'void', go down 3 paragraphs,
go to the start of this block, replace text up to the next matching
delimiter, select the function body, line-wrap the selected text,
etc..


 (i.e., NOT that monstrous shipwreck of an excuse for software called
 notepad, or its dainbramaged second cousin wordpad)
 
 LOL those are editors? I just thought they were 'pads'...

They aren't real editors, no, but a lot people seem to think they are.


 Like, one that can filter an arbitrary text selection through an
 arbitrary-complex shell command.  Or that can repeatedly apply a
 complex sequence of editing commands at a single keystroke (as
 opposed to navigating the rodent through endless layers of menus).
 
 Ever used macros in Visual Studio? (There might exist the same thing
 for Eclipse, idk.)

I'm not talking about having to click through 5 menus and type in a
macro definition, bind it to some keystroke, and then run it afterwards.
I'm talking about things like search for this regex and replace it with
that pattern, now do this again to the next 25 occurrences of the search
term -- ON THE FLY. I don't care to waste time defining a whole named
macro just for this one occasion. I want to, in essence, write 1-line
code to transform the current selection, right now.


 No?
 
 Well, it does what you're saying.
 In a more powerful way than you're saying. :P

Then please enlighten me with an example. :-)


 But I won't start the Visual Irritation vs. Extremely Massive And
 Cumbersome System flamewar here. ;-)
 
 
 ...oops

By which I mean VI vs. EMACS, of course. ;-)


T

-- 
In theory, there is no difference between theory and practice.


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Friday, 18 May 2012 at 23:50:18 UTC, H. S. Teoh wrote:

Was it actually that slow?


Anything that has a GUI is unacceptably slow over a remote 
connection, last time I checked. I'm not talking about 
connecting over a  local network, which doesn't really count, 
but a connection over the internet.



Uhm, no.

The *slowest* GUI's I've seen are -- by far -- SSH-based. (e.g. 
remote Emacs -- even on a local network -- is horrible.)


I've _personally_ used National Instruments's tools over cable 
internet (if you've used them, you know they're certainly *not* 
less GUI-intensive than an IDE lol), and they're completely 
usable. Not /fast/, mind you -- but completely acceptable.


And no, my cable wasn't fantastic either.
And yes, it was plain old Remote Desktop.
Also, the other side's server was kinda slow too.

You should definitely try it. :P




Strange, last I checked, global variables aren't a good coding 
practice. :-) Renaming local variables is a trivial 
search-n-replace.


lol ok you got me there


But you're right that certain renamings, like a member function 
name that may be overloaded across a large number of classes, 
could potentially be very painful.


Yeah, imagine trying to name a method named getValue() to 
something else (probably because you realized that's not a great 
name :P).


A HUGE time waster without refactoring tools, and last time I 
checked, no text-based tool did it.



Though what I'd really like in that case is a syntax-tree aware 
text editor.



100% agree, I've been looking for them too. But they don't exist. 
And practically speaking, without project management (in which 
case they'd be half-baked IDEs), the *can't* exist...




Or a nice console-based IDE that isn't dependent upon a GUI.

,
I'd probably use them too, but they don't exist AFAIK. :(



Intuitive text editors are ultimately also limited by their 
intuitiveness, because what most people think of as intuitive 
is what I type appears on the screen and I don't have to 
memorize obscure key sequences to get stuff done. What you 
really need are _logical_ operations, like navigate to the 
word 'void', go down 3 paragraphs, go to the start of this 
block, replace text up to the next matching delimiter, 
select the function body, line-wrap the selected text, etc..






They aren't real editors, no, but a lot people seem to think 
they are.


lol. Those people probably haven't used Linux either. :P


I'm not talking about having to click through 5 menus and type 
in a macro definition, bind it to some keystroke, and then run 
it afterwards. I'm talking about things like search for this 
regex and replace it with that pattern, now do this again to 
the next 25 occurrences of the search term -- ON THE FLY.


Oh, I misunderstood then. In that case, you don't even need an 
external tool...


Ctrl-H: Brings up Replace dialog.
Alt-E: Check the Regex box.
Alt-P: Type in the regex.
types regex
Alt-R: However many times you want, to replace the next instance.

Though I'd question what you were doing if it were 25 times. Most 
likely you want to do it within a certain range of the document, 
in which case you can highlight that portion of the text (with 
the keyboard or the mouse, both are easy :P), and just tell your 
editor/IDE to replace only that portion.


Both are a piece of cake, and neither needs an external tool.




I don't care to waste time defining a whole named macro just 
for this one occasion. I want to, in essence, write 1-line code 
to transform the current selection, right now.


Yes, writing 1-line code is definitely easier in *nix-based tools 
(since they're text based, obviously), but if you have any other 
examples of actual tasks you do regularly, let me know -- I'm 
sure there's a way to do them with VS/Eclipse that isn't much 
different in terms of the amount of work/payoff.



Well, it does what you're saying.
In a more powerful way than you're saying. :P


Then please enlighten me with an example. :-)


They give you access to the *entire IDE* and *all APIs 
whatsoever*, so give me an example results in pretty much 
anything you want -- minus the syntax tree, unfortunately (not 
sure why).


But if you need an example...

I've made a macro to look for all of my C++ include and library 
directories, and switch them from Visual Studio to Windows WDK 
(for various reasns).
Oh, and to detect where the WDK is, I read the registry keys 
inside the macro, find the directories, etc.. Easy. And *none* of 
the pain with escaping quotes or whatnot, since it's an actual 
*language* (VB.NET, which has nothing to do with VB6, btw -- just 
C# in a different syntax), not a Bash script.


Oh, and it supports different versions of the WDK.

All in about ~150-200 lines of VB.NET code, and I've used it a 
few dozens of times now. Saved my fingers from all the typing I'd 
otherwise have to do to change a gazillion project settings. And 
I don't have to interface with any text lol.


If you were to do this 

Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Saturday, 19 May 2012 at 00:39:22 UTC, Mehrdad wrote:
If you were to do this with some text-based tool, it'd be next 
to impossible IMO, since you'd have to edit XML settings, and 
keep track of all the repetitions (e.g. something might appear 
under a Debug node but not a Release node, etc.).




Btw:

The correct way to do what I intended was to use Property 
Sheets, which are meant to be 'templates' for project settings.


Obviously, a lot easier than writing a macro -- just set the 
settings by hand once, and merge them with your projects later.


(Pretty sure your CLI tool doesn't have that either. :P)

But I didn't know about them beforehand...


Re: Posix vs. Windows

2012-05-18 Thread H. S. Teoh
On Sat, May 19, 2012 at 02:39:20AM +0200, Mehrdad wrote:
 On Friday, 18 May 2012 at 23:50:18 UTC, H. S. Teoh wrote:
 Was it actually that slow?
 
 Anything that has a GUI is unacceptably slow over a remote
 connection, last time I checked. I'm not talking about connecting
 over a  local network, which doesn't really count, but a connection
 over the internet.
 
 
 Uhm, no.
 
 The *slowest* GUI's I've seen are -- by far -- SSH-based. (e.g.
 remote Emacs -- even on a local network -- is horrible.)

You must be using Emacs with a GUI.


 I've _personally_ used National Instruments's tools over cable
 internet (if you've used them, you know they're certainly *not* less
 GUI-intensive than an IDE lol), and they're completely usable. Not
 /fast/, mind you -- but completely acceptable.

GUI-intensive apps aren't even on my radar. I don't do GUI. I'm a
command-line freak. The only GUI I consistently use is the browser,
which I only use for nice embedded image support and the fact that
nowadays, almost every website is graphic-intensive and specifically
designed to be as painful to use as possible should you ever dare to
turn off images.


 And no, my cable wasn't fantastic either.
 And yes, it was plain old Remote Desktop.
 Also, the other side's server was kinda slow too.
 
 You should definitely try it. :P

I regularly do all sorts of stuff over SSH. And I don't mean SSH
tunnelling that crap called X11, I mean good ole pure text-only SSH.
As soon as anything with graphics factor into the equation, it turns
into a crawling morass of slowness. Which is what I mean. GUI's are
useless across an SSH connection.


[...]
 But you're right that certain renamings, like a member function
 name that may be overloaded across a large number of classes,
 could potentially be very painful.
 
 Yeah, imagine trying to name a method named getValue() to
 something else (probably because you realized that's not a great
 name :P).

Although I'd argue that somebody silly enough to actually design an API
with methods called getValue deserves the pain of manually renaming
every instance of it. :-P


 A HUGE time waster without refactoring tools, and last time I
 checked, no text-based tool did it.

Oh? It's called rename the method and recompile, get 50 pages of
compile errors, pipe it to a grep command that extracts the filenames
and line numbers, use sed to transform that into a sed command that
automatically substitutes every instance of the matching identifier on
the given files/line numbers.

See, I told you I was a command-line freak. :-) You can't do that in any
GUI app that wasn't specifically designed to handle that specific
operation.  It's all fine and dandy when it *does* happen to support
that exact operation that you need, but good luck when the app writers
didn't think of this one case that you just ran into. Which I just did
with basic tools designed 20+ years ago (probably longer). :-P


 Though what I'd really like in that case is a syntax-tree aware text
 editor.
 
 
 100% agree, I've been looking for them too. But they don't exist.  And
 practically speaking, without project management (in which case they'd
 be half-baked IDEs), the *can't* exist...

Well, I _did_ demonstrate how to do it above, given the proper tools and
shell support. :-) It's a bit clunky, but hey, it works. And if you get
further compile errors, just look those up (using suitable combinations
of grep/sed) and undo the wrong substitutions. Just two steps, and
you're done.


 Or a nice console-based IDE that isn't dependent upon a GUI.
 ,
 I'd probably use them too, but they don't exist AFAIK. :(

My IDE is called vim. :-P *runs and hides*


[...]
 I'm not talking about having to click through 5 menus and type in
 a macro definition, bind it to some keystroke, and then run it
 afterwards. I'm talking about things like search for this regex
 and replace it with that pattern, now do this again to the next 25
 occurrences of the search term -- ON THE FLY.
 
 Oh, I misunderstood then. In that case, you don't even need an
 external tool...
 
 Ctrl-H: Brings up Replace dialog.
 Alt-E: Check the Regex box.
 Alt-P: Type in the regex.
 types regex
 Alt-R: However many times you want, to replace the next instance.

You're missing the point. My point was that you can do this with
*arbitrarily complex sequences of operations*. Yes search and replace
with regex is a specific command that's supported by your IDE, but what
about move one line down, one word over, increment the number by 1
repeated 50 times to repair a table of numbers that had some
miscalculations? In vim, you can group such sequences of operations and
apply them repeatedly. The fact that the operations are logical (move
one word over instead of move 5 characters over, which may not work if
your code has varying word lengths) helps a lot.


 Though I'd question what you were doing if it were 25 times. Most
 likely you want to do it within a certain range of the document, in
 which case you can 

Re: Posix vs. Windows

2012-05-18 Thread H. S. Teoh
On Sat, May 19, 2012 at 02:45:00AM +0200, Mehrdad wrote:
 On Saturday, 19 May 2012 at 00:39:22 UTC, Mehrdad wrote:
 If you were to do this with some text-based tool, it'd be next to
 impossible IMO, since you'd have to edit XML settings, and keep
 track of all the repetitions (e.g. something might appear under a
 Debug node but not a Release node, etc.).
 
 
 
 Btw:
 
 The correct way to do what I intended was to use Property Sheets,
 which are meant to be 'templates' for project settings.
 
 Obviously, a lot easier than writing a macro -- just set the settings
 by hand once, and merge them with your projects later.
 
 (Pretty sure your CLI tool doesn't have that either. :P)
[...]

That just went way over my head. Why do you need to use some fancy
feature with some fancy name just for changing some settings?

But over the years, I've become convinced that anything worth doing can
always be done at the command-line, faster, and with much more
flexibility. But then again, I *am* a command-line freak... y'know, to a
hammer, every problem is a nail, etc.. :-) Most programs that require
elaborate non-text configuration formats also tend to be bloated
GUI-bound mammoths that aren't really in my consideration anyway, so
*shrug*.


T

-- 
LINUX = Lousy Interface for Nefarious Unix Xenophobes.


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Saturday, 19 May 2012 at 01:28:32 UTC, H. S. Teoh wrote:

You must be using Emacs with a GUI.


No, I told you I hate Emacs. :P
I've seen *other* people do it, and it's horribly slow.



GUI-intensive apps aren't even on my radar. I don't do GUI.


okay... maybe National Instruments's LabView wasn't a good 
example for when we're talking about programming lol.



Which is what I mean. GUI's are useless across an SSH 
connection.


Ah, ok. That makes more sense than GUIs are slow over an 
internet connection.
Yes, SSH wasn't designed for GUIs (or the converse), so of course 
it's slow.


Trying to force GUIs onto *nix systems is like trying to force a 
command-line tool on Windows... doesn't exactly work the way it's 
supposed to, and it gives you the wrong impression.



Although I'd argue that somebody silly enough to actually 
design an API with methods called getValue deserves the pain 
of manually renaming every instance of it. :-P


LOL
How about payload, where have I seen that before? lol



Oh? It's called rename the method and recompile, get 50 pages 
of
compile errors, pipe it to a grep command that extracts the 
filenames and line numbers, use sed to transform that into a 
sed command that automatically substitutes every instance of 
the matching identifier on the given files/line numbers.


See, I told you I was a command-line freak. :-)




Yes, that's clever. :P **EXCEPT**:

1. Compilers (cough, DMD?) generally limit their output to a few 
dozen errors, so your '50 pages' is kinda off. :P But yea, you 
could just loop until it works.



2. Okay, so that's clever. :P Now tell me what you do when you 
have dozens of lines in your source file like


@property auto length() { return _range.length; }

and you want to rename the field 'length'? How do you prevent the 
second one from getting renamed?



Or say you have

@property auto back() { ... }
	@property moveBack() { assert(0, Cannot move an element from 
the back!); }

auto popBack() { }// Remove an element from the back

and you change the name of the property 'back' to 'last':

@property auto back() { ... }
	@property moveBack() { assert(0, Cannot move an element from 
the last!); }

auto popBack() { }// Remove an element from the last

Notice something funny?

Worse yet, no way in hell that a command-line tool would tell you 
your documentation is messed up. :P



Well, I _did_ demonstrate how to do it above, given the proper 
tools and shell support. :-) It's a bit clunky, but hey, it 
works. And if you get further compile errors, just look those 
up (using suitable combinations of grep/sed) and undo the wrong 
substitutions. Just two steps, and you're done.



You're done? Or so you think.
See above.




My IDE is called vim. :-P *runs and hides*


Better than Emacs loll :-P  *also runs and hides*


You're missing the point. My point was that you can do this 
with *arbitrarily complex sequences of operations*. Yes search 
and replace with regex is a specific command that's supported 
by your IDE, but what about move one line down, one word over, 
increment the number by 1 repeated 50 times to repair a table 
of numbers that had some miscalculations?


Visual Studio has a Record Macro feature, to record keystrokes 
and such, but I haven't used it, so I don't know if it does what 
you want -- but yeah, if it doesn't, I can see why you'd choose 
Vim/Emacs/whatever.



It was just for illustrative purposes. It doesn't have to be 
repeat n times; what about apply operation X,Y,Z until the 
end of the enclosing block?


Uhm, just highlight it and apply the operation to the highlighted 
block...




It sucks to have to open 15 different apps and waste time 
switching between them when I could do everything without my 
fingers leaving the keyboard for 1 second (and without 
focus-distracting cycling through windows).


My hands don't leave the keyboard too often either... even the 
basics Alt-Tab/Ctrl-Tab/F8/PageUp/PageDown/etc. get the job done 
fairly well, and the mnemonics (e.g. Alt-O to hit the button with 
O underlined) make it 10x better.




Your example went over my head, 'cos I haven't used windows in 
any serious way for at least 15 years. :-P


lol ok. If you get the chance sometime, might wanna give Windows 
7 a try. :P
Last time I used Linux was a few days ago (Ubuntu) so I guess I'd 
naturally have more to say about it haha.





Stop right there. Project settings, eh? lol...


Better than configure.in/configure/makefile.in/makefile/all that 
crap. :P




For me, an SConscript does my project management way better 
than any IDE project settings could ever do.

[...]
Now try writing an IDE that can do all of _that_ in one go. :-P


I gotta use SCons, haven't used it before :)



XML is the spawn of evil, next in evilness only to Javascript, 
but I digress. :-P Seriously though, you could just use xmlstar 
(google for it) if you really have to. XML is not meant for 
human 

Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Saturday, 19 May 2012 at 02:10:31 UTC, Mehrdad wrote:
Worse yet, no way in hell that a command-line tool would tell 
you your documentation is messed up. :P



I should submit a correction:

Nothing wrong with the command-line-ness per se -- it's just that 
command-line tools happen to be text-based, so when they just 
work with text, they miss the fact that it's documentation and 
not code. It's just that I haven't seen a command-line tool do 
refactoring like that.


An IDE would obviously make the same mistake, if you used 
Search/Replace instead of actually doing refactoring.


Re: Posix vs. Windows

2012-05-18 Thread Mehrdad

On Saturday, 19 May 2012 at 01:33:34 UTC, H. S. Teoh wrote:

[...]

That just went way over my head. Why do you need to use some 
fancy feature with some fancy name just for changing some 
settings?


But over the years, I've become convinced that anything worth 
doing can always be done at the command-line, faster, and with 
much more flexibility. But then again, I *am* a command-line 
freak... y'know, to a hammer, every problem is a nail, etc.. 
:-) Most programs that require elaborate non-text configuration 
formats also tend to be bloated GUI-bound mammoths that aren't 
really in my consideration anyway, so *shrug*.



T


Haha, fair enough.


Posix vs. Windows

2012-05-17 Thread Mehrdad
From looking at Phobos, I'm understanding that the main 
difference between the implementation of various features for 
Posix systems as compared to Windows systems (aside from the API, 
etc.) is that Windows tends to do a lot of stuff *before* the 
program is loaded (and hence requires special cases in a lot of 
places), whereas Posix systems tend to require you to call 
initializers manually (and hence they're called just like any 
other function).



Just wanted to check, is this understanding correct?

(The reasoning being, if I'm writing my own little kernel, I want 
to figure out whether I should be compiling Phobos with Posix or 
with Windows, to minimize my headaches... although I should 
mention that, either way, I'm going to be developing on Windows, 
in PE format.)