News for hackers. Stuff that matters.
Re:Writing a Minecraft server from scratch in Bash (2022) by synergy20 on Sunday March 03, 2024 @10:02AM (#39581226)
bash is one of my favorite, as favorite as vim and lua.

a single binary that is less than 2M bytes, universal, way more capable than many people think.

with shellcheck and good habits, bash can be readable and safe as well.

if you want something extra, you can always use C/C++ to add those utilities without using more involved FFI etc, and without pip/npm/etc to load who knows how many dependencies.

Re:Writing a Minecraft server from scratch in Bash (2022) by inetknght on Sunday March 03, 2024 @10:09AM (#39581286)
> with shellcheck and good habits, bash can be readable and safe as well.

My favorite thing to do with shellcheck: add it to CI. Developers hate this one trick!

A lot of times CI and Dockerfiles have inline bash scripts. My next favorite thing to do is to move all of that inlined bash to their own script files. Now that CI has shellcheck: all that stuff gets checked too! Developers seem to hate this though because it's "less readable". Less readable my ass, it's way more safe.

Next problem: the same bash scripts are now in the same files in multiple repositories (a distributed build). I'm open to ideas for improvements here.

Re:Writing a Minecraft server from scratch in Bash (2022) by klardotsh on Sunday March 03, 2024 @07:55PM (#39585989)
To skip the "move your scripts to standalone files" step some devs don't like, consider something like https://github.com/hadolint/hadolint which runs Shellcheck over inline scripts within Containerfiles.
Re:Writing a Minecraft server from scratch in Bash (2022) by yodsanklai on Sunday March 03, 2024 @10:15AM (#39581337)
I dislike bash because I'm not good with it. It sucks but is still often the best solution available. Actually, one of my regret was not to invest more time on it when I was a student (a while ago) because it's one of these rare tools that accompanied me my whole career.
Re:Writing a Minecraft server from scratch in Bash (2022) by inetknght on Sunday March 03, 2024 @10:17AM (#39581347)
It's true. The nice thing is that there are many many examples of how to use bash. Just open a script file in random repositories. Most scripts are super SUPER simple. But just copy-paste to shellcheck and it will give some feedback if you're looking to get in some really quick commits and PRs :)