syklemil

joined 8 months ago
[–] syklemil@discuss.tchncs.de 7 points 7 months ago (2 children)

I think I mentioned it, but inverse: The only data type I'm comfortable with in bash are simple string scalars; plus some simple integer handling I suppose. Once I have to think about stuff like "${foo[@]}" and the like I feel like I should've switched languages already.

Plus I rarely actually want arrays, it's way more likely I want something in the shape of

@dataclass(frozen=True)
class Foo:
    # …

foos: set[Foo] = …
[–] syklemil@discuss.tchncs.de 1 points 7 months ago (1 children)

-e is great until there’s a command that you want to allow to fail in some scenario.

Yeah, I sometimes do

set +e
do_stuff
set -e

It's sort of the bash equivalent of a

try { 
  do_stuff()
} 
catch { 
  /* intentionally bare catch for any exception and error */
  /* usually a noop, but you could try some stuff with if and $? */ 
}

I know OP is talking about bash specifically but pipefail isn’t portable and I’m not always on a system with bash installed.

Yeah, I'm happy I don't really have to deal with that. My worst-case is having to ship to some developer machines running macos which has bash from the stone ages, but I can still do stuff like rely on [[ rather than have to deal with [ . I don't have a particular fondness for using bash as anything but a sort of config file (with export SETTING1=... etc) and some light handling of other applications, but I have even less fondness for POSIX sh. At that point I'm liable to rewrite it in Python, or if that's not availaible in a user-friendly manner either, build a small static binary.

[–] syklemil@discuss.tchncs.de 12 points 7 months ago (5 children)

At the level you're describing it's fine. Preferably use shellcheck and set -euo pipefail to make it more normal.

But once I have any of:

  • nested control structures, or
  • multiple functions, or
  • have to think about handling anything else than simple strings that other programs manipulate (including thinking about bash arrays or IFS), or
  • bash scoping,
  • producing my own formatted logs at different log levels,

I'm on to Python or something else. It's better to get off bash before you have to juggle complexity in it.

[–] syklemil@discuss.tchncs.de 3 points 7 months ago

There also are some stories from js devs about how async/await reduced the spaghetti factor of their code a lot. So yeah, similar stories all around I think, even though async/await obviously isn't a magical thing with no downsides

[–] syklemil@discuss.tchncs.de 3 points 7 months ago

Yes, I agree. It appears to have worked on the leftpondians though, and thus we get headlines like this.

[–] syklemil@discuss.tchncs.de 2 points 7 months ago* (last edited 7 months ago)

Yeah, Rust is ultimately a different project than Go, and I suspect much of the success of Go is down to stuff like good tooling, default GC, native static binaries, generally easy concurrency, rather than stuff like having as bare-bones a language as otherwise possible. I'd suspect having a focus on fast compilation also helps draw in people from interpreted languages.

It's easy to write a Kubernetes microservice that performs adequately with Go, and that's all a lot of people & teams need.

[–] syklemil@discuss.tchncs.de 3 points 7 months ago* (last edited 7 months ago) (2 children)

Yeah, the Go creators seem to generally mean "resembles C" when they use words like "simple", which could explain stuff like going "why do you need generics when you can just cast?" for, what, ten years?

I remember trying some Plan9 stuff and bouncing off it, including acme. I guess it's the kind of thing that makes sense to Pike but not to me. Not sure what gophers in general think of it (but wikipedia lists at least Russ Cox as a user).

[–] syklemil@discuss.tchncs.de 3 points 7 months ago (2 children)

That's my opinion as well (I think of "ebike" as "EU-conformant pedelec"), but that opinion doesn't seem to be universal.

[–] syklemil@discuss.tchncs.de 10 points 7 months ago (6 children)

I get the impression a lot of leftpondians use "bike" to mean MC, so to them saying "ebike" when they mean "electric motorcycle" is pretty natural.

[–] syklemil@discuss.tchncs.de 7 points 7 months ago

There have been studies of manure reactors here in Norway as well, including some really small-scale ones, like the Telemark reactor.

As long as they have animals, getting the manure through the reactor will

  • capture methane for use as biogas rather than letting it straight into the atmosphere,
  • let that biogas supplant fossil gas ("natural" gas), i.e. rather than free stored carbon it has gone in a loop
  • reduce the viability of weeds in the manure, and
  • increase the nitrogen availability in the manure, bringing it closer to fossil gas-derived artificial fertilizer in potency.

Biogas reactors are a serious harm reduction win in modern agriculture and reduces reliance on fossil fuels in several ways.

Here it seems like Vox is just peddling "big oil and big ag are in favor, therefore it's sus". Blind hens like those two also sometimes find corn.

[–] syklemil@discuss.tchncs.de 26 points 7 months ago

This comes off as a weird mash of ideas, and it's not clear what they mean by "traditional programming languages"—the link seems to include Typescript, which is younger than Rust, which is _not_presented as a "traditional" programming language.

The whole thing comes off as … something a Murdoch-owned site would dream up, maybe?

[–] syklemil@discuss.tchncs.de 2 points 7 months ago

It's been widely studied in other cities already. Studying it more is ok, but at some point you gotta wonder whether we need all that many studies about whether water is wet, or if the resources and manpower could be better spent elsewhere.

view more: ‹ prev next ›