Live data from Hacker News

Bashblog – a single bash script to create blogs

github.com

41–50 of 93 posts

Re: Bashblog – a single bash script to create blogs

#41

Earlier quoted context omitted.

Yeah but i have Python PTSD from all this Python 2 vs. 3 shit :D

I'm sure that there are still Python 2 codebases there running an unsupported interpreter, but for most people that has been at least 5-10 years ago. Also, the Python project learned a lot from the messy transition, that I think it's unlikely to happen again.

And then some old debian box comes out of shadow.

I'm sure that ubuntu LTS also extended the life of this disaster + some tool you wanted to use which never upgraded.

GNU Radio took ages

Re: Bashblog – a single bash script to create blogs

#42

Its time to invent something lightweight and good which runtime is so small that it becomes a system default. like a microvm with normal language features. Something you can and want to actually attach a debugger onto it. Something independent of architecture too. I just hate bash :| Even just using bash and curl and checking if its a website or an error page...

It's definitely not a system default (unless it's a system I've had access to for more than ten minutes!), but:

I use Janet[0] for this.

[0] https://janet-lang.org

Re: Bashblog – a single bash script to create blogs

#43

Earlier quoted context omitted.

Known system dependency that's (almost) always on the system you're on. I remember somebody once telling me that they had learned vi because "it was always installed". Well, no, technically, the only editor you can be sure is there is ed. So, you know, learn that. I was surprised that they actually did. Bash is syntactically not perfect, I agree. However it's a well known, mature, stable environment. LLMs can write i…

Who's updating their blog from a random machine without Python on it, though?

I'd presume it's quite common with NixOS. At least I don't have python linked to my environment. It might be different would I use the REPL, but I do not, so for me python is a program (or script) dependency, not something I need to carry around. It's actually quite common for many setup scripts to fail when python is not installed, but not all of them list python as a dependency either.

Re: Bashblog – a single bash script to create blogs

#44
Oooh..reminds me of something similar I did earlier for own blog a few years back: https://github.com/proxygeek/publish/

I have moved away to Jekyll again but there's always something alluring about single file things - single file webapps, single file LLMs (llamafile) and others

Re: Bashblog – a single bash script to create blogs

#45
post #7

Earlier quoted context omitted.

Awful old Bash. I hate it. Seriously I don't know why you'd do this in Bash. Crazy choice.

Some people like to claim that using a pretty esoteric language with lots of weird footguns, lack of basic features and data types, and spawning subprocesses for everything, is somehow keeping it simple. I do not understand them.

Weird footguns don't matter if you stick to using shell for control flow, composition, and interpolation, and don't use all the weird things you have to look up every time. It's also very easy to do something in the commandline then just

  tail -n 8 $HISTFILE > script.sh
and very little to no editing is needed to make that useful. Shell is not a programming language, it's an interface to the OS, and thinking about it like a programming language is just asking for frustration.

Re: Bashblog – a single bash script to create blogs

#46
post #7

Earlier quoted context omitted.

Awful old Bash. I hate it. Seriously I don't know why you'd do this in Bash. Crazy choice.

Some people like to claim that using a pretty esoteric language with lots of weird footguns, lack of basic features and data types, and spawning subprocesses for everything, is somehow keeping it simple. I do not understand them.

I honestly think that's the contrary: it's the laziest choice possible when you want something to work immediately without thinking too much about it. Till like 7 years ago I made literally every script to do "personal" stuff in bash, because I wasn't quite good with any programming language and bash... was just there in my Linux machine, and I was already familiar with it because I was a long time Linux user. Sometimes you end up committing it on github and people start issuing feature requests, and at the beginning you are just happy that your work fits the need of other people and you don't want to rewrite it from scratch with a better programming language and end up over-scripting it. That's basically the story of a little program I made years ago. Now I don't log in on github anymore because I'm afraid people is still requesting new features...

Re: Bashblog – a single bash script to create blogs

#47
Nice idea but I don't understand why people write bash scripts more than a few lines long.

There's absolutely 0 advantage, especially when AI can write simple code like that easily, over using any other language. It makes reading and maintaining much more complex.

Hell, even GitHub's syntax highlighting (and VS Code's) breaks in many places throughout the script. It's just a terrible developer experience, even for your own scripts that nobody else will ever touch.

Some people will say that the advantage is that you don't need to install another runtime, but even this is wrong as the script uses bash, not sh.

I hate Python with a passion, but I'd gladly take it over bash for any of those scripts.

Re: Bashblog – a single bash script to create blogs

#48

Nice idea but I don't understand why people write bash scripts more than a few lines long. There's absolutely 0 advantage, especially when AI can write simple code like that easily, over using any other language. It makes reading and maintaining much more complex. Hell, even GitHub's syntax highlighting (and VS Code's) breaks in many places throughout the script. It's just a terrible developer experience, even for yo…

Bash is the wrong choice for truly complex software but I still find it really hard to pick anything else for the sort of tasks where I'm mostly manipulating text files and shelling out to other tools. My general instinct for when its time to reimplement a script in Python or similar is when I've got a ton of conditionals or function calls, at that point its also time to start writing unit tests.

shellcheck is a huge help in the middle sized shell script space and will regularly shout at me about missing all the random gotchas like not quoting file paths.

Re: Bashblog – a single bash script to create blogs

#49
post #45

Earlier quoted context omitted.

Some people like to claim that using a pretty esoteric language with lots of weird footguns, lack of basic features and data types, and spawning subprocesses for everything, is somehow keeping it simple. I do not understand them.

Weird footguns don't matter if you stick to using shell for control flow, composition, and interpolation, and don't use all the weird things you have to look up every time. It's also very easy to do something in the commandline then just tail -n 8 $HISTFILE > script.sh and very little to no editing is needed to make that useful. Shell is not a programming language, it's an interface to the OS, and thinking about it l…

> Shell is not a programming language, it's an interface to the OS, and thinking about it like a programming language is just asking for frustration.

I guess this just isn’t obvious to me. Where do you see the boundary between “interface to the os” and “programming language”?

Re: Bashblog – a single bash script to create blogs

#50
post #7

Earlier quoted context omitted.

Awful old Bash. I hate it. Seriously I don't know why you'd do this in Bash. Crazy choice.

Known system dependency that's (almost) always on the system you're on. I remember somebody once telling me that they had learned vi because "it was always installed". Well, no, technically, the only editor you can be sure is there is ed. So, you know, learn that. I was surprised that they actually did. Bash is syntactically not perfect, I agree. However it's a well known, mature, stable environment. LLMs can write i…

To be fair, qualifying bash as on (almost) every system and then poo-pooing vi as being also on (almost) every system seems odd. Had you said sh instead of bash the analogy would have worked better.
Post reply on HN