Earlier quoted context omitted.
> Python REPL is an incredibly poor UI for repeated execution of subprocesses Python REPL, even with recent additions of TAB completion, is a poor REPL, period. IPython, on the other hand, offers a much better programming environment than shell while still allowing easy access to most of the things you mention. Example: In [1]: from pathlib import Path In [2]: file = Path("~/.sbclrc").expanduser().read_text() In [3]:…
> In [3]: !echo "$file" | awk '!/^;;/' That's Bash (or at least sh). Which excels at piping the output of programs into other programs, and pay that cost for everything else.
Bash 5.0 released
291–300 of 306 posts
Re: Bash 5.0 released
#292Earlier quoted context omitted.
(re: Bash-vs-OS integration) bash is a programming language like any other, and you could use anything with a REPL as your shell. Python should do. In fact, I'll try it right now.. Yes, it works. Just sudo chsh -s /usr/bin/python and off you go. Once you start doing this for a bit, you'll notice that the Python REPL is an incredibly poor UI for repeated execution of subprocesses. It is very elaborate. Having to const…
You may be interested in xonsh, a shell that supports both python and bash-like expressions: https://xon.sh/
Re: Bash 5.0 released
#293Earlier quoted context omitted.
It can't be done. If you want to write reliable code, and actually notice all of the possible error conditions instead of silently ignoring them, your code needs to get more verbose and complicated than it would be to just use a more capable tool like Python or Node, and it still won't be as reliable. If you have more logic than a couple of string comparisons, Bash is not the right tool for the job.
>Python or Node Python, sure, but replacing Bash with Node just seems like replacing a language crippled by its need to be backward compatible with (Bourne) sh with a language crippled by its need to be backward compatible with what Brandon Eich came up with in two weeks in 1995.
Python is the more direct substitute, though: it's built-in to almost every platform, and the Python 3 stagnation has even given us a consistent version: 2.7.
Re: Bash 5.0 released
#294Earlier quoted context omitted.
Eh, is it 2007 again? Hasn't this been discussed to death already? I have little interest to repeat it again; this discussion has been on-going for ten years already (longer if we count GPL vs. BSD discussions, which are roughly similar). Everyone should be familiar with the arguments by now; I trust you're already familiar with mine. I understand that you're well-intentioned, but I find the suggestion that I'm someh…
So... you don't really know what restrictions you're talking about, right? I mean, you brought up the subject: "There are restrictions!" "What restrictions?" "Everyone knows. It's patronizing to ask me. I won't say."
I didn't include an entire summary of it, as it can be easily looked up on e.g. Wikipedia, as well as many other places.
Re: Bash 5.0 released
#295Earlier quoted context omitted.
Yeh, GPL2 is also considered less than ideal, and replacing GPl2 code has been a low-key long-term goal. GPL2 is still considered acceptable though, whereas GPL3 is outright barred.
Is there any GPL code remaining in the base at this point? I thought it was all gone once they replaced gcc with Clang.
Also, a quick look at the source tree shows there are still some other parts as well. GNU binutils, GNU diff, dialog is GPL, etc. See: https://github.com/freebsd/freebsd/tree/master/contrib
In the kernel, I think there are some drivers that are based on the Linux GPL code, for example: https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee... (just first hit from GitHub search for "gpl")
So yeah, looks like there's still plenty of GPL code in FreeBSD that's not trivially replaceable. The same applies to OpenBSD, although in general the OpenBSD people tend to be a bit more proactive in replacing GPL code.
Re: Bash 5.0 released
#296Re: Bash 5.0 released
#297Earlier quoted context omitted.
Since I'm clueless on the subject, can I ask how you determined that information and what resource I could use to become better informed?
A good first step is disabling SSL 3.x and TLS 1.0 in your daily browser. I would also recommend the excellent Qualys SSL Server Test: https://www.ssllabs.com/ssltest/
Re: Bash 5.0 released
#298Earlier quoted context omitted.
Some application still requires bash, like wireguard
WireGuard doesn't require bash. The main configuration utility, wg(8), is written in vanilla C. However, the tools ship with a little convenience script, called wg-quick(8), which is indeed written in bash. It started out as the thing I was using to configure my laptop on the go, but then others found it helpful. It's by no means essential or central to WireGuard, and lots of people use different things to wrap wg(8)…
$ brew install wireguard-tools
[1] - https://www.wireguard.com/install/Re: Bash 5.0 released
#299Earlier quoted context omitted.
Syntactic sugar is a phrase permanently marred for me by the ruby community: it means "cognitive load for other people who know the language but don't keep up with the faddy bits". It made me tremendously sad.
Yeah, but C-style "for" loops are nice, right ? Still, they really are a syntactic sugar for a "while". The problem is more with a language having fady bits and people using them when they don't make the code clearer, than with syntactic sugar.
Well... I know macros are supposed to be bad, but.. I've been programming in C for a long time, but only recently tried 'sugaring' my loops with
#define _(x,y) for (x=0;x
..which has worked soo well, I'm sticking with it. It makes programming in C much more pleasurable. (My programs mostly have a lot of nested loops over multidimensional arrays, mostly from 0, inc'ed by 1)So now instead of e.g.
for (i=0;i
it's just _(i,WID) _(j,HEI) {
which makes me smile every time.Re: Bash 5.0 released
#300Earlier quoted context omitted.
> In [3]: !echo "$file" | awk '!/^;;/' That's Bash (or at least sh). Which excels at piping the output of programs into other programs, and pay that cost for everything else.
Piping program output is just function composition. The downside is that it works over expensive system processes, and data must be serialized. It's a fragile system where instead of using built-in functions, we use "standard" executables.