bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] make function local


From: Eduardo A . Bustamante López
Subject: Re: [Help-bash] make function local
Date: Fri, 10 Apr 2015 09:13:17 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

> function as first class citizen is just one of the feature that makes
> javascript so successful now days.
That is not true. Javascript is only successful for the same reasons that PHP
and bash are successful: because they're everywhere.

Javascript is actually a terrible example of a language, with many
inconsistencies. Even the closures that you claim are essential come with many
gotchas in javascript.

Now, for the features in bash that'd be actually useful:

- discipline functions and compound datatypes (like in ksh)
- a way to do wrap arbitrary OS system calls with a builtin, so that instead of
having thousands of builtins each interacting with the system, we could just
do: `syscall lstat foo' and get something useful.
- a faster implementation of the variable lookup code
- a shopt to disable evaluation of shell code in places like arithmetic
expansion
- a better way to deal with binary input (specially NUL bytes)
- and many more, these are the ones I can think of right now


Also, why do you want to make bash look like Javascript? Just use nodejs and be
happy then. There's a good reason to keep languages different, and that's
because it allows diversity and also because some languages have specific
purposes (bash for example is specially designed to be used interactively, and
thus has many features in this regard).

-- 
Eduardo Bustamante
https://dualbus.me/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]