zsh-workers
 help / color / mirror / code / Atom feed
* Suggestion for ZSH, who do I send it to?
@ 2014-12-17 15:36 Micah Waddoups
  2014-12-17 17:00 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Micah Waddoups @ 2014-12-17 15:36 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 1706 bytes --]

   So, I have a few suggestions. Are you open to using GNU libraries in 
ZSH?  If so, I was thinking how ZSH is so powerful (and easy to use), 
that it can actually handle all types of data -- like all 256 characters 
of ASCII.  So with multibyte turned off that means binary, even if its a 
little slow.  But here is the problem with dealing with binary, or 
unusual characters through ZSH, every operation requires using several 
ZSH builtin commands / variable expansions.  This makes a process that 
converts data into something more usable on the input or the output very 
CPU heavy and inefficient.  My suggestion is to add a few options to the 
sysread and syswrite builtins that come stock with ZSH in the system module:

  * -d : (sysread) to make the variable created an integer type
    containing the numerical value corresponding to the raw byte value,
    for -s 1; and for -s 2+ (reading more than a single byte), make it
    an array with each indice containing a string of decimal digit(s),
    whose numerical value is generated the same way, representing the
    value for each byte.
  * -h : (sysread) to make a string value that is two characters per
    input byte, representing the value of the byte in hexadecimal
    (padded with 0 if less than 16, and obviously as with above, a null
    would equal 00).  This would make Zsh able to function for whatever
    given needs (boot environments, less prevalent unix-like systems)
    without having to supply an xxd program, and it would be much more
    efficient processing when any math is involved in the script.

-- 
Micah micah@askmicah.net <mailto:micah@askmicah.net>
AskMicah.Net <http://askmicah.net>, Problem Solving Agency

[-- Attachment #1.2: Type: text/html, Size: 2106 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for ZSH, who do I send it to?
  2014-12-17 15:36 Suggestion for ZSH, who do I send it to? Micah Waddoups
@ 2014-12-17 17:00 ` Bart Schaefer
  2014-12-17 17:53   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2014-12-17 17:00 UTC (permalink / raw)
  To: Micah Waddoups, zsh-workers

On Dec 17,  7:36am, Micah Waddoups wrote:
} 
}    So, I have a few suggestions. Are you open to using GNU libraries in 
} ZSH?

As long as they're linked via a loadable module there shouldn't be any
problem.

} My suggestion is to add a few options to the sysread and syswrite
} builtins that come stock with ZSH in the system module:

If this is a change that means these options would not work when a
particular GNU library is not available, then it would be better to
add them a different way so that it's possible to test beforehand
whether they are available.  I don't think the module "features"
mechanism has granularity below the level of a new builtin (i.e., I
don't think you can use features to test for individual options).

In any case, if you have a suggested patch or new module, send it to
this list.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for ZSH, who do I send it to?
  2014-12-17 17:00 ` Bart Schaefer
@ 2014-12-17 17:53   ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2014-12-17 17:53 UTC (permalink / raw)
  To: zsh-workers

On Wed, 17 Dec 2014 09:00:44 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> } My suggestion is to add a few options to the sysread and syswrite
> } builtins that come stock with ZSH in the system module:
> 
> If this is a change that means these options would not work when a
> particular GNU library is not available, then it would be better to
> add them a different way so that it's possible to test beforehand
> whether they are available.  I don't think the module "features"
> mechanism has granularity below the level of a new builtin (i.e., I
> don't think you can use features to test for individual options).

The "zsystem supports" command was added to this module for this
purpose.  "zsystem supports anyoldrubbish" simply returns status 1
unless the zsystem module has been provided with an internal feature
called anyoldrubbish.  It's not visible at the zmodule interface,
however; you have to load the module and run the command.

Explicitly linking against GNU libraries might have legal consequences.
We print a warning when we do this with libgdbm as it means the binary
is covered by the GNU public license (as they call it).  It depends on
the licence (as I call it) for the library whether this would apply
here.

pws

P.S. Tests reveal zsystem does not currently support anyoldrubbish.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for ZSH, who do I send it to?
  2014-12-17 18:46 Micah Waddoups
@ 2014-12-18  5:23 ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2014-12-18  5:23 UTC (permalink / raw)
  To: Micah Waddoups, zsh-workers

On Dec 17, 10:46am, Micah Waddoups wrote:
}
}    So, I have a few suggestions. Are you open to using GNU libraries in 
} ZSH?

So, this is the same message you sent a few hours earlier, except you've
added another syswrite option and something about the MPFR library.

Thanks!  We will happily consider any patches sent to this mailing list.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Suggestion for ZSH, who do I send it to?
@ 2014-12-17 18:46 Micah Waddoups
  2014-12-18  5:23 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Micah Waddoups @ 2014-12-17 18:46 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 3288 bytes --]

   So, I have a few suggestions. Are you open to using GNU libraries in 
ZSH?  If so, I was thinking how ZSH is so powerful (and easy to use), 
that it can actually handle all types of data -- like all 256 characters 
of ASCII.  So with multibyte turned off that means binary, even if its a 
little slow.  But here is the problem with dealing with binary, or 
unusual characters through ZSH, every operation requires using several 
ZSH builtin commands / variable expansions.  This makes a process that 
converts data into something more usable on the input or the output very 
CPU heavy and inefficient.  My suggestion is to add a few options to the 
sysread and syswrite builtins that come stock with ZSH in the system module:

  * -d : (sysread) to make the variable created an integer type
    containing the numerical value corresponding to the raw byte value,
    for -s 1; and for -s 2+ (reading more than a single byte), make it
    an array with each indice containing a string of decimal digit(s),
    whose numerical value is generated the same way, representing the
    value for each byte.
  * -h : (sysread) to make a string value that is two characters per
    input byte, representing the value of the byte in hexadecimal
    (padded with 0 if less than 16, and obviously as with above, a null
    would equal 00).  This would make Zsh able to function for whatever
    given needs (boot environments, less prevalent unix-like systems)
    without having to supply an xxd program, and it would be much more
    efficient processing when any math is involved in the script.
  * -c : (syswrite) to make string the name of a variable who's value is
    processed in the same way as (( math context )) in hexadecimal, two
    digits at a time.  In other words starting at the beginning of the
    string, convert two hexadecimal characters into one byte, then the
    next two, etc., and any characters that are members of the IFS
    variable are ignored and discarded, and any other encountered
    non-hexadecimal characters causing an error, and lastly any
    remaining single digit hexadecimal characters either ignored or
    converting to it's value as if it had a 0 in front of it (My
    suggestion leaves that up to you who program this).

  And my other suggestion is that you add support for (statically?) 
compiling with the GNU MPFR library, so that in systems where this is 
possible, super long numerical values can be handled in the math context 
(with the appropriate min and max precision variable set super long).  
This would make a half a dozen scripting situations work much better 
than running out of precision space whenever doing operations that shift 
the values several powers of 10 or 2 left or right.  More importantly, 
depending on bc or gawk to run really long number calculations can be 
cumbersome and problematic if they are not present.

   While Zsh may not be intended to be a fix-all-do-all shell and 
scripting environment.  I believe it has the potential to be both the 
best user-friendly environment and the most versatile rescue 
environment, capable of replacing all other command-line shells in unix 
systems.

-- 
Micah micah@askmicah.net <mailto:micah@askmicah.net>
AskMicah.Net <http://askmicah.net>, Problem Solving Agency

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-18  5:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-17 15:36 Suggestion for ZSH, who do I send it to? Micah Waddoups
2014-12-17 17:00 ` Bart Schaefer
2014-12-17 17:53   ` Peter Stephenson
2014-12-17 18:46 Micah Waddoups
2014-12-18  5:23 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).