Questions about windows support

Adam D. Ruppe destructionator at gmail.com
Tue Feb 21 18:44:33 PST 2012


On Wednesday, 22 February 2012 at 02:03:58 UTC, H. S. Teoh wrote:
> Hmm. Let's implement shell utilities in D! (Pointless, yeah, 
> but a fun exercise to see how much cleaner D code can be -- if 
> you've

I'm sooo tempted again.

Though, I don't really like shell utilities.... I'd want many
of them to be accessible through api, and at that point, might
as well just do them all as built ins.

I guess if there's another file available, we can call it
instead to allow easy replacement, but I just think making
the shell there as a library is a really nice thing.

class ShellOperations { /* methods here */ }
then use compile time reflection to build your map for the
command line processing....

Our D shell could be just one program.


though tbh if I was doing a shell, I'd kinda want to do
a terminal replacement too. But, I don't see myself leaving
xterm and rxvt. Nor putty.

idk, should probably limit the scope a bit just to make it
realistic to finish. Use gnu readline too and piggyback on
that pretty nice function for history, editing, completion,
etc.


Actually that makes it fairly doable as a weekend project.

> Only? Heh... when I was young and foolish, I wanted to trump 
> Linus and write my own kernel.

I've tried it before.... but it is terribly boring.

As cool as it is to say "every line of code on that box is
mine and mine alone", that's all it is good for imo: bragging.

The interesting stuff is all user territory.

> My concept of shell is to make it a very thin (but scriptable) 
> layer over actual syscalls, so you could do something like:

Eeeeeeh.... at that point, you might as well just write
your commands in C (or D).

I actually like bash a lot... but only for 1-3 line things.
Bigger than that, and screw it, I'd rather just write C/D.
bash is a huge pain to get anything done for > 3 lines...

But for those 1-3 line things, it is really nice. And, since
it is a command line shell, that's exactly what it should be
optimizing!


More information about the Digitalmars-d mailing list