On Mon, May 27, 2013 at 5:51 AM, Dan Douglas <[email protected]> wrote:
> On Sun, May 26, 2013 at 11:32 AM, A. P. Garcia
> <[email protected]> wrote:
>> on Sun, 26 May 2013 12:55:33 +0200, Irek Szczesniak wrote:
>>
>> <snip>
>>
>>> haven't you read Roland Mainz's comments about passing compound
>>> variables via pipe or network sockets? ksh93 already has a powerful
>>> (much more feature rich in what PowerShell can do) mechanism with
>>> that, and only at the beginning or the end a conversion from or to
>>> XML/JSON might be useful. In between the compound variable mechanism
>>> is much faster and flexible.
>>
>> i read it, but before that i was unaware of compound variables, so i
>> don't really know their capabilities. in roland's demo, though, it
>> seemed rather like he was passing a struct (just data). in this
>> regard, henk's comments, which you cited, are very interesting: "If
>> you think about it, the concept of the unix command as a 'filter' is
>> akin to functional programming; they consume input (stdin+parameters),
>> produce output, and leave no side-effects."
>>
>> where he refers to functional programming, think first class
>> functions. think currying. think objects as data plus functions that
>> operate on that data. then combine them, rather like ocaml. is that
>> what i want in a shell? i don't know, but it sure sounds like fun,
>> which is a wonderful quality to have in computing, as well as utility.
>> in the end, perhaps fun is what really sets unix apart.
>
> The object serialization is mostly through print's -C or -v, read -C, or just
> expand objects as ordinary parameters. These output data members but not
> function members.

Erm... read -C/print -C read and write _data_ and not code... the
whole function family around compound variables is for data processing
and not code serialisation. Objects/types are supported with the
limitation that both sides must have access to the same types (usually
via FPATH).

> I don't know why.

What exactly is the problem ?

> There are no higher-order functions, you
> still need eval.

Erm... why ? What exactly do you want to do with (evil) "eval" ?

> I could never get binary serialization to work,

What do you mean with "binary serialisation" ?

> and -C is
> broken in many cases.

What exactly is broken ? Please file _bug_ reports... preferably as
many as you can... :-)

> I did partial() here -- {,un}curry should be pretty
> close.
> http://wiki.bash-hackers.org/commands/builtin/eval#higher-order_functions
>
> Most AST utilities can't produce or consume ksh compound variable format.
> Powershell has the whole .net framework to work with. No Unix shell has a
> library like that.

The trouble is... while there is interest to build a CPAN-like
equivalent for ksh93 no coordination and infrastructure within ksh93
exists to implement it. It could be done... but requires a lot of
effort (like fixing namespaces and get namespaces to work with FPATH,
allow FPATH elements to point to "pax" archives and find a ksh93
equivalent to the perl "use"- or (better) java's "import"-statement).

> Maybe have a look at scsh. Sadly it doesn't get
> much interest.

Problem is that "scsh" is buggy as hell... last time I tested it
(~~around 2009) I crashed directly into the issue that it can't handle
multibyte characters properly...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to