[dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Fernando C.V.
Probably I'm talking shit here... or maybe this is something you are
considering with sbase already... but I kept thinking about this.

Would it make sense to create a whole shell infrastructure based on
little small commands?

I mean, not just replacing no-brainer builtin things like "echo", etc,
but also things like "if", "while", "for", "set", by doing system()
calls to an extremelly minimal shell. Would it make sense? maybe even
a command for creating pipes. It wouldn't be POSIX-conformant, but
then just as long as the names don't conflict and the commands were
available the script would run on normal shells too.

Then you could have a damn small /bin/sh core that only takes care of
finding things in PATH and doing variable and filename expansion. Then
also you could get rid of some of the irregularities in shell syntax
that make it kind of weird for something that should be so simple.

Would this make sense or would it be extremely inefficient and stupid?

--
Fernando



[dev] Re: Is there any plan on a shell for sbase?

2013-05-31 Thread Fernando C.V.
> by doing system() calls to an extremelly minimal shell. Would it make sense?

uh.. I mean, something like a while-cmd like this:

  while-cmd 'test whatever' <

Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Strake
On 31/05/2013, Fernando C.V.  wrote:
> Would it make sense to create a whole shell infrastructure based on
> little small commands?
>
> I mean, not just replacing no-brainer builtin things like "echo", etc,
> but also things like "if", "while", "for", "set", by doing system()
> calls to an extremelly minimal shell. Would it make sense? maybe even
> a command for creating pipes.

I tried this lately. Actually, I tried no shell at all.

The basic idea was this: a program is a list of arguments. Each
utility parses the first few arguments and spawns the rest by its
operational scheme, like chroot and setsid. This was the dawn of
grief, for many utilities, for example if, must take many argument
lists. I first tried '--' as list separator, but thus I had to quote
'--'s in the argument list, which I did with another '-'; as I soon
learned, this is very cumbersome.

I mean to try again, this time with s-expressions, which, as they are
balanced, need no quotation.

Cheers,
Strake



Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread markus schnalke
[2013-05-31 12:05] "Fernando C.V." 
> Probably I'm talking shit here... or maybe this is something you are
> considering with sbase already... but I kept thinking about this.
> 
> Would it make sense to create a whole shell infrastructure based on
> little small commands?
> 
> I mean, not just replacing no-brainer builtin things like "echo", etc,
> but also things like "if", "while", "for", [...]

Welcome to the Thompson shell! ;-)

http://v6shell.org/


meillo



Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Christoph Lohmann
Greetings.

On Fri, 31 May 2013 18:00:41 +0200 markus schnalke  wrote:
> [2013-05-31 12:05] "Fernando C.V." 
> > Probably I'm talking shit here... or maybe this is something you are
> > considering with sbase already... but I kept thinking about this.
> > 
> > Would it make sense to create a whole shell infrastructure based on
> > little small commands?
> > 
> > I mean, not just replacing no-brainer builtin things like "echo", etc,
> > but also things like "if", "while", "for", [...]
> 
> Welcome to the Thompson shell! ;-)
> 
> http://v6shell.org/

What does a shell need to be useful:

* tab completion
* Can this be done simply?
* Just expanding the $PATH?
* Does this really need plugins?
* Maybe some argument to the alias command so this function is run for
  tab completion?
* ugly POSIX style
* Really?
* rc style?
* Something better?
* backwards compatibility?
* Wouldn't be busybox ash enough for this?
* basic job handling stuff and all the piping

For now busybox ash is enough for all of this.


Sincerely,

Christoph Lohmann




Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Evan Gates
> * tab completion

Does this need to be built in? Would it suck less to have a wrapper that
can do tab completion that we can reuse? Something along the lines of
rlwrap but without readline. Or would it suck less to create/use a
different library to accomplish this?

> * ugly POSIX style
> * backwards compatibility?

I think it would be nice to have a simplest possible POSIX compliant sh.
I'm not well versed in the options that already exist, is there a minimally
compliant, smallest possible, POSIX sh?

I also think it would be nice to create a new shell from the ground up, to
see what happens...

I'd love to see a shell in sbase (POSIX, rc, completely new), just to see
what a suckless approach to creating a shell would be. (And I've been
curious about yacc for a while.)

-Evan

P.S. Any recommendations on joining #suckless when connecting to oftc
through tor?


Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Thorsten Glaser
Christoph Lohmann dixit:

>* tab completion

Can busybox ash do this? (If so, that’s recent.)

>   * Does this really need plugins?

Definitely not; in mksh, tab completion is deterministic: the
first word is expanded as command, all other words as files.

Only downside is that tab completion is an editing feature,
and as such gets confused by 'echo $(foo) ba' due to
the closing parenthesis.

>For now busybox ash is enough for all of this.

I don’t think you should inflict ash on *anyone*. And mksh
is not *that* much larger. I mean, even the Android people
saw the light after a while…

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh



Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Christoph Lohmann
Greetings.

On Fri, 31 May 2013 20:29:53 +0200 Evan Gates  wrote:
> > * ugly POSIX style
> > * backwards compatibility?
> 
> I think it would be nice to have a simplest possible POSIX compliant sh.
> I'm not well versed in the options that already exist, is there a minimally
> compliant, smallest possible, POSIX sh?
> 
> I also think it would be nice to create a new shell from the ground up, to
> see what happens...
> 
> I'd love to see a shell in sbase (POSIX, rc, completely new), just to see
> what a suckless approach to creating a shell would be. (And I've been
> curious about yacc for a while.)

Just waiting for it to happen won’t solve this problem. Suckless is what
we all produce and which fits the solution. So instead of waiting,  just
create it.

> P.S. Any recommendations on joining #suckless when connecting to oftc
> through tor?

Don’t  be  a  terrorist  pedophile so don’t use tor. Only feminists, pe‐
dophiles and terrorists use tor.


Sincerely,

Christoph Lohmann




Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Christoph Lohmann
Greetings.

On Fri, 31 May 2013 20:32:05 +0200 Thorsten Glaser  wrote:
> Christoph Lohmann dixit:
> 
> >* tab completion
> 
> Can busybox ash do this? (If so, that’s recent.)

It can do basic tab completion in directories.

> >For now busybox ash is enough for all of this.
> 
> I don’t think you should inflict ash on *anyone*. And mksh
> is not *that* much larger. I mean, even the Android people
> saw the light after a while…

Remove  this  Build.sh crap and add some real Makefile and I will recon‐
sider using it.

wc -l Build.sh
2362

Does this script really need to emulate autohell? Can’t a shell run in a
minimal C function library subset which is available everywhere?


Sincerely,

Christoph Lohmann




Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Andrew Gwozdziewycz


Christoph Lohmann <2...@r-36.net> wrote:

>> P.S. Any recommendations on joining #suckless when connecting to oftc
>> through tor?
>
>Don’t  be  a  terrorist  pedophile so don’t use tor. Only feminists,
>pe‐
>dophiles and terrorists use tor.
>

That's pretty offensive, don't you think? There are lots of legitimate reasons 
to use Tor, including but not limited to: victims of domestic abuse and of 
course getting around contractual limitations.

But in all seriousness, we do actually live in this weird age where information 
is key and Wall Street cashes out on little invasions of privacy. Not everyone 
wants to bend over.





Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Thorsten Glaser
Christoph Lohmann dixit:

>Remove  this  Build.sh crap and add some real Makefile and I will recon‐
>sider using it.

You can let Build.sh generate a Makefile using the -M option,
but that Makefile would then be specific to the system it ran
on (actually “for”, not “on”, considering cross-compiling).

This is done in MirBSD, MidnightBSD and Android currently.

On GNU/Linux targets you would additionally need to provide
signames.inc which is generated by Build.sh, or better, the
libc should provide a sys_signame[] array. Note that Linux,
kernel-side, has different signal names (even amount of them!)
per architecture, and even libc…

>wc -l Build.sh
>2362

An equivalent autoconf crap would be ten to hundred times
that size, FWIW.

>Does this script really need to emulate autohell?

Yes given mksh’s portability requirement.

>Can’t a shell run in a minimal C function library subset which is
>available everywhere?

I wish. Really.

mksh has very few imports, but the system-specific parts
sadly vary greatly across OSes.

bye,
//mirabilos
-- 
17:08⎜«Vutral» früher gabs keine packenden smartphones und so
17:08⎜«Vutral» heute gibts frauen die sind facebooksüchtig
17:10⎜«Vutral» aber auch traurig; früher warst du als nerd voll am arsch
17:10⎜«Vutral» heute bist du als nerd der einzige der wirklich damit klarkommt



Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Christoph Lohmann
Greetings.

On Fri, 31 May 2013 21:15:15 +0200 Andrew Gwozdziewycz  wrote:
> Christoph Lohmann <2...@r-36.net> wrote:
> 
> >> P.S. Any recommendations on joining #suckless when connecting to oftc
> >> through tor?
> >
> >Don’t  be  a  terrorist  pedophile so don’t use tor. Only feminists,
> >pe‐
> >dophiles and terrorists use tor.
> >
> 
> That's pretty offensive, don't you think? There are lots of legitimate 
> reasons to use Tor, including but not limited to: victims of domestic abuse 
> and of course getting around contractual limitations.

As  long  as anonymity and fighting for freedom is a domain of esoterics
like feminists and special freaks the common people will  not  join  in.
Fighting for the freedom of everyone should be a common hobby of the av‐
erage intellectual.

> But in all seriousness, we do actually live in this weird age where 
> information is key and Wall Street cashes out on little invasions of privacy. 
> Not everyone wants to bend over.

You  have  to  bend over to join #suckless. Your anonymous comrades have
been abusing their anonymity to annoy people on the channel. So  control
your  comrades  (which  you  will  tell  me is impossible) or don’t join
#suckless. I tried to keep tor from being banned, but people abused it.

But  there  are other ways to scramble your IP and connect to OFTC. Just
don’t let the average idiot know about how to do this.


Sincerely,

Christoph Lohmann




Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Noah Birnel
On Fri, May 31, 2013 at 09:15:15PM +0200, Christoph Lohmann wrote:
> Fighting for the freedom of everyone should be a common hobby of the av???
> erage intellectual.
> 
>

> But  there  are other ways to scramble your IP and connect to OFTC. Just
> don???t let the average idiot know about how to do this.
> 
This is incoherent. Is this just a troll, or are you drunk?