From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19687 invoked by alias); 17 Dec 2014 15:56:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33991 Received: (qmail 25513 invoked from network); 17 Dec 2014 15:56:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <5491A318.5020303@askmicah.net> Date: Wed, 17 Dec 2014 07:36:56 -0800 From: Micah Waddoups User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Suggestion for ZSH, who do I send it to? Content-Type: multipart/mixed; boundary="------------010500020003070305010304" X-Provags-ID: V02:K0:YldjizwsMdYGvPW6n2jSNcLrOjMUhT1rklGJBvOfNVq 4gJrDpew6az/79v0BPIoJ8tR41R14rioR3azMoscTWDWQD2q8H DJhCH4ngeRfT5wi+8p64x61YMXhdMad1ZgSSk4OyJYpQ6yRMg5 RE/rfdfDh7Et9M1xpljBaK5l7EgmqiXZVho8Zg3UtNAbsPGYS/ +ZfhkQFrIuepdQZoGHCsBfVu8UNLVDh7aDnXLTRK87kjmJBBZt OUbnNjd0CVORTPXyOJmBKtoieKilkVfzVDmmF3WhdqLTNiwIlk sRcm53gOyvc2oru2L+HNdQsgJ/YrPHe01RxkKIQwoZVx5mUCzS +VQTi11BxqNfGqe4RliNJtI66oXQM7uQJ3a34yw9t X-UI-Out-Filterresults: notjunk:1; --------------010500020003070305010304 Content-Type: multipart/alternative; boundary="------------010301080007050107090308" --------------010301080007050107090308 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 AskMicah.Net , Problem Solving Agency --------------010301080007050107090308 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit   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
AskMicah.Net, Problem Solving Agency
--------------010301080007050107090308-- --------------010500020003070305010304-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13425 invoked by alias); 17 Dec 2014 17:00:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33994 Received: (qmail 10287 invoked from network); 17 Dec 2014 17:00:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=D9vw8UVm c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=lL7sXvDrPdFN4bQJH24A:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141217090044.ZM567@torch.brasslantern.com> Date: Wed, 17 Dec 2014 09:00:44 -0800 In-reply-to: <5491A318.5020303@askmicah.net> Comments: In reply to Micah Waddoups "Suggestion for ZSH, who do I send it to?" (Dec 17, 7:36am) References: <5491A318.5020303@askmicah.net> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Micah Waddoups , zsh-workers@zsh.org Subject: Re: Suggestion for ZSH, who do I send it to? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28640 invoked by alias); 17 Dec 2014 18:03:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33996 Received: (qmail 13289 invoked from network); 17 Dec 2014 18:03:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-b7fc86d0000066b7-74-5491c3049b6e Date: Wed, 17 Dec 2014 17:53:05 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Suggestion for ZSH, who do I send it to? Message-id: <20141217175305.23e73179@pwslap01u.europe.root.pri> In-reply-to: <141217090044.ZM567@torch.brasslantern.com> References: <5491A318.5020303@askmicah.net> <141217090044.ZM567@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVy+t/xa7oshyeGGCx5a2hxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mj4dv8BUcJCr4uSyqUwNjDs5uhg5OSQETCR6j19nhrDFJC7c W8/WxcjFISSwlFHi7IFlzBDOEiaJbX8amCCcbYwSpxfPYeli5OBgEVCVWL/aGaSbTcBQYuqm 2YwgtoiAuMTZtedZQGxhAVOJts+9YHFeAXuJC48OMoHYnAIWEmf71rCB2EICkRJ3v/Wzgtj8 AvoSV/9+YoK4yF5i5pUzUL2CEj8m3wObySygJbF5WxMrhC0vsXnNW2aIOeoSN+7uZp/AKDQL ScssJC2zkLQsYGRexSiaWppcUJyUnmukV5yYW1yal66XnJ+7iREStF93MC49ZnWIUYCDUYmH 98X1CSFCrIllxZW5hxglOJiVRHjZDkwMEeJNSaysSi3Kjy8qzUktPsTIxMEp1cBYFZc1bcmV uBV1fw6kHQ3KzGWavbpsQuaxp8u2Lf+YOYP108q7sZK+v11rDm902G8Sdle++kTmuruPKna8 TmhVuOy5PihHL2HeRAGu0Mcf5m9YXbXmxunsMOc837fzr2xeyfbNNH2DbNnTU5dT2/+fKz9p 2mXAJLZmy3871RNC5w9OvyC9ft+KUiWW4oxEQy3mouJEACjXKlE4AgAA On Wed, 17 Dec 2014 09:00:44 -0800 Bart Schaefer 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1637 invoked by alias); 17 Dec 2014 18:40:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33998 Received: (qmail 7351 invoked from network); 17 Dec 2014 18:40:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <5491CF6B.9080503@askmicah.net> Date: Wed, 17 Dec 2014 10:46:03 -0800 From: Micah Waddoups User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Suggestion for ZSH, who do I send it to? Content-Type: multipart/alternative; boundary="------------090503090009080700010202" X-Provags-ID: V02:K0:EIXWnEWjqA5w/uF99Y7FePwQrFeBHE3G6aOy54zmYpA qEnPdzB89kIuRM8KFGzAAs1iwtGA7UqQJN57GfujAi+ohwU/LW oHjyNfzPlkvSUioeXwbul5S2Jx2k+jnVuE/IRQ8lEZWBW7v4yS j5Sk+PkAoPmd0GoqtxEXTallr/TkLJPhbKZuOIM4RScfBBa5Qh 63Oqhf8cZ/RUsDR4STp8lG9Eini6QhfiypAzlCQhKKqFsSWhJe mSfEADptmQFqX5yVSkcJBzPNptXqDz5NLy9h1h8cTKTFjXGTiE OgPESrfw5JQdV7GXctiUTWD1EoWJCaRBJL1JrAtzqTInwYZ4C9 AZy2EdQ3L6TfqJapKbk6hBdH2UjuIFDOebykYQlkg X-UI-Out-Filterresults: notjunk:1; --------------090503090009080700010202 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 AskMicah.Net , Problem Solving Agency --------------090503090009080700010202-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6111 invoked by alias); 18 Dec 2014 05:22:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34001 Received: (qmail 19894 invoked from network); 18 Dec 2014 05:22:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=B94OC1pJ c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=rFn2VItiJaUR1JCXkqIA:9 a=CjuIK1q_8ugA:10 a=OvPiij20ow4A:10 a=qxbZw48jZ-QA:10 a=wZWajfAHhjEA:10 From: Bart Schaefer Message-id: <141217212304.ZM1017@torch.brasslantern.com> Date: Wed, 17 Dec 2014 21:23:04 -0800 In-reply-to: <5491CF6B.9080503@askmicah.net> Comments: In reply to Micah Waddoups "Suggestion for ZSH, who do I send it to?" (Dec 17, 10:46am) References: <5491CF6B.9080503@askmicah.net> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Micah Waddoups , zsh-workers@zsh.org Subject: Re: Suggestion for ZSH, who do I send it to? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.