HNHacker News
TopNewBestAskShowJobs

hyperupcall

221 karma · joined July 16, 2021

submissionscomments
hyperupcall··on Dotfile madness (2019)
Oh right I forgot about those - I set some environment variables so I don't see any of those except for .pki

And in my opinion .ssh and .gnupg are okay since in some contexts, the "XDG variables" haven't been initialized in certain circumstances when using those utilities.

But yeah, I'll have to look into those - maybe there is something I can do to fix that

hyperupcall··on Dotfile madness (2019)
what other "alternatives" are you speaking of on Linux?
hyperupcall··on Dotfile madness (2019)
Which software in particular? Given my experience, it is well within reach, besides a few exceptions including Firefox/Thunderbird, etc, and one relating to Chromium-based browsers.

The trick is to use the XDG Base Dir Spec, only if the old ~/.name location doesn't exist. Old users are happy because it doesn't break compatibility and new users are happy because nobody's dropping 10 sacks of potatoes on their metaphorical doorstep

hyperupcall··on Dotfile madness (2019)
strongly disagree - as of 2022, more apps follow the XDG Base Directory Specification than not - in fact, by a wide margin. So by "doing dirty" in your users home directory, you're going against the grain of the ecosystem.

It doesn't seem like you understand much about the specification? I'd recommend reading it, or at least a short summary I've made available here: https://xdgbasedirectoryspecification.com/

hyperupcall··on Dotfile madness (2019)
I completely agree! That's why I created this site: https://xdgbasedirectoryspecification.com. We need some place where people can immediately understand the practical benefit, and the minimum ask of their users.

Of course, it doesn't help just to complain about the issue in a void, so I've also submitted like 10 PRs and filed quite a few issues. Projects like pnpm and Poetry took note, and now they comply!

Someone's gotta clean up house, and I don't mind doing the dirty work.

hyperupcall··on How can we develop transformative tools for thought? (2019) [pdf]
Do the acts of learning Latin and writing letters truly represent the peak quality of thought?

I'd think that technological ability and thought quality would improve in unison. Better thought leads to technological leaps, which potentially lead to better thought.

Being a luddite hardly sounds like a solution. Thought not unlike meditation do have their place, but I believe they help enhance "normal" thought, rather than completely substitute it.

hyperupcall··on Asdf Performance
Your point about plugins is valid, but I believe a good middleground is having the plugins in core, but disabling them by default. Having an interface to enable particular plugins or plugin groups would be useful in this scenario too.

I thought about contributing to asdf, but unfortunately many of my pain points are deeply integrated within the design and architecture of the code itself. For example, since there is a lot of code duplication within plugins, it would be good to create a "plugin API" (I think that has recently been proposed). But that would be very time consuming to implement not just because of the already-existing code, but also because essentially every plugin is its own separate repository, usually maintained by different people. So I'd think it's not too hard to imagine how difficult making broad improvements or changes will be.

There's also the fact that writing (decently) fast and cross-platform Bash codes necessitates an essentially orthogonal coding style, which would be at odds with asdf's coding style. Even though the `REPLY` and `$()` is probably 80% of it, I would also like to take advantage of my `bash-core` and `bash-term` Bash libraries, which really wouldn't be possible in asdf (implementation-wise, that would necessitate the use of my Bash package manager)

hyperupcall··on The Unreasonable Effectiveness of Makefiles
Honestly, I only find Makefiles useful when I have a tiny C/C++ project and need stuff just to compile quickly and easily without the overhead of a real build system.

For literally everything else, I found myself using it more as a task runner - and Make doesn't do a great job at it. You end up mixing Bash and Make variables, string interpolation, and it becomes really messy, really fast. Not to mention the footguns associated with Make.

I found bake (https://github.com/hyperupcall/bake) to suit my needs (disclaimer: I wrote it). It's literally just a Bash script with all the boilerplate taken care of you - what a task runner is meant to be imo

hyperupcall··on Asdf Performance
Asdf is a good idea in theory and pretty okay considering it's in Bash, but the execution is quite lackluster. I'm glad the maintainer is focusing on performance, but there are other areas that prevent me from using the tool:

- asdf uses way more commands than it needs to. Instead of glob pattern matching for files, it reads the output of `ls` (and _many_ very similar mistakes)

- When running functions, the output tends to be collected using $(). Since this is done so much, this realllyyyy slows down execution since subshell invocations are slowwww in bash. Better is to set the global variable `REPLY` and use that directly from the callee

- The command line interface is kind of verbise and clunky and a little unintuitive

- There are too many separate plugins to use and download. Too much code duplication between plugins

I hope this doesn't sound like a laundry list of gripes, but just things to improve upon for the maintainers - I understand how hard it is to write Bash that works everywhere. Personally, I've opted to build my own (partial) solution that implements these suggestions at https://github.com/hyperupcall/woof, but my hope is that asdf will become substantially better over the years

hyperupcall··on Turborepo 1.2: High-performance build system for monorepos
> However, I feel a bit sad at the state of general purpose build tools (Bazel/Pants/Buck, make, GitHub Actions, Maven, Nix) or cloud-based IDEs (Cloud9, Codespaces). These tools come off as too complex to operate and build on top of...

I definitely agree, although I've found Please (please.build) to potentially be a solution in this area. It is a lot simpler, smaller, and more modern than Buck and Bazel, but shares similar properties as to be familiar (I.e. the buildfile syntax). I think it is supposed to be easier to extend with other languages, but I haven't tries that myself.

hyperupcall··on Ask HN: Let's build Checkstyle for Bash?
Wow, 8 thousand lines is pretty insane. When my bashrc started to get long, I started to separate things into different files and source them. And then that got too complicated so then I made them separate executables with different directories. But then I couldn't reuse functionality as easily so then I found myself making a package manager. And now I'm moving some of that stuff _BACK_ into my bashrc (sort of). It seems there is really no end...
hyperupcall··on Ask HN: Let's build Checkstyle for Bash?
This is a neat idea, but I'm not sure I see the need for this specific tool. Shellcheck covers essentially all the errors that are mentioned in the Google Style Guide so I'd just be using that instead.

And as the Guide itself, it is mostly OK, but there are a few things I really don't like. For example:

- Whatever doc format they use is not as nice to use as shdoc. Namely, you don't have to add the spaces to your comment to make it formatted properly

- The 'no tabs' thing is pretty bullshit - Bash is literally the perfect language to use tabs and their "Whatever you do, don’t use tabs" comment really kills me

- I don't like their recommendation of using `[[`. Only using `[[` for stuff like regex and glob matching makes it much easier to paste code between Bash and POSIX sh.

There are also a few things they forgot to mention, like the lastpipe` shopt option when talking about piping while loops. And maybe it would be nice to recommend using local like `local var=`. But I guess this guide is meant more for new people that don't know all the pitfalls and stuff

But I think I agree there is some need for a more extensible linter. I've been eyeing the Bash LSP, which is based off the Bash Tree Sitter parser, but that has quite a few bugs with parsing that I've been meaning to send PR's for.

I wonder if `shfmt` has gotten better since I used it. A few years ago, it was quite buggy with prepending extra whitespace whenever I formatted the file

hyperupcall··on Kakoune Code Editor
Sure POSIX shell scripting is a good skill to have, but I would hardly consider it good for a text editor to have that skillset be commonplace within their configuration language. Shelling out incurs a non-zero execution cost. For example with Bash, it is significantly slower execing out when using a builtin or parameter expansion will work just fine, especially with these types of quick text manipulation operations. And that's not even mentioning that you are literally starting up a new Bash process every time you want to do something semi-complicated in a Kakouine config. This doesn't just leave a bad taste in my mouth - it is also a giant waste of resources and causes initialization to be substantially slower compared to the alternative

It is also too easy to write poor shell scripts. It is too easy, even for experienced developers to sneak in GNUisms, and forget simple facts, like how Bash and especially Perl aren't guaranteed to be installed on all systems. Sometimes I also wonder: does Kakoune set `-o pipefail` or `-o errexit`? If somebody sets `ENV` and does something fishy, will that make my text editor unlaunchable? Behavior rooted in common semantics rather than heavy syntax (Bash, Perl) or micro-languages (Awk, Sed) make the overall experience much more pleasant. Especially if you do something like Neovim (Awesome, etc.) and use Lua for Config so you don't have to reinvent anything

hyperupcall··on Kakoune Code Editor
When I tried Kakoune, it seemed like a really cool idea and implementation, but it didn't seem like their configuration language had basic functions for string manipulation, path testing, etc. So a common pattern with plugins etc. was to shell out to sed, awk, etc, which was a _huge_ turnoff. I now use Neovim, but if they have recently implemented that functionality, I'd be willing to give Kakoune another shot
hyperupcall··on Show HN: A pure bash web server. No netcat, socat, etc.
I had this same idea, but just haven't gotten around to implementing it - so thank you for this reference! This also gives me the perfect excuse for finally getting around to implement automatic dynamic loading of Bash builtins for my Bash package manager

This would be very useful as a fallback - in case something like `socat` isn't installed, this can be used to display some sort of dumbed down version of the site

hyperupcall··on Tcl/Tk Spline Editor
Having been recently converted into a Tcl user, studying this code will definitely help me improve my skill in the language! Thanks for the link
hyperupcall··on Japan's Paper Culture
I second this! Their explanations of different product SKUs are quite helpful, even if you don't end up purchasing from them
hyperupcall··on Learn RegEx step by step, from zero to advanced
I agree that it would be nice to get native syntax highlighting for strings, especially for languages where regular expressions are not a first class feature

However, I would realllyyy not want to have a more verbose regex dialect. For me at least, it would make recognizing common regex patterns a lot harder since they won't be succinct. It would also be yet _another_ regex variety that I would have to remember.

For me, Perl's DEFINE feature and 'x' switch are definitely close enough[1] to variables and comments. Pardon, I don't remember what they are officially called. What we really need is for more non PCRE engines to implement these features

[1]: https://regex101.com/r/z5pGvZ/6

hyperupcall··on Launch HN: Dendron (YC W21) – Structured note-taking for developers and teams
This is exactly what I'm looking for! After creating hundreds of markdown notes with Obsidian, it became rather hard to sift through and query knowledge. I can't wait to try Dendron out!
hyperupcall··on Bash functions are better than I thought
I'm quite happy to see that something Bash-related is on Hacker News! Unfortunately it seems that I don't really agree with much the author...

While I do agree that it would be nice to be able to have 'local' functions and have inter-function cleanup work better, the logical conclusion for me was not to use function subshells. Since the use case is for larger programs (where different functions may want to have their own cleanup mechanisms), I'm opting to go for more of a library route. For example, I'm working on a Bash library that includes a function to allow different sources to add (and remove) functions to the same `TRAP`. A similar function may be useful, possibly involving the `RETURN` trap and the `-T` flag for the use case the author brings up. Obviously, using a package manager for _Bash_ of all languages brings in a lot of overhead, but I think it can be quite powerful, especially with a potential "Bundle" feature that makes scripts work without the package manager.

Concerning specifically the use of subshells, (as other commenters have pointed out) it significantly reduces performance. I also disagree that dynamic scoping is necessarily bad for Bash. I find it quite useful when I need to use various common functions to manipulate a variable - since modifying and 'returning' variables from a function is usually either slow or verbose with Bash. Admittedly though, this feature is quite annoying at times - for example, most public functions in my Bash package manager[2] all have their variables prefixed with two underscores - because they `source` all the shell scripts of all package dependencies - so I want to be extra certain nothing weird happens

[1] https://github.com/hyperupcall/bash-core/blob/a17ab0a8b6070f...

[2] https://github.com/hyperupcall/basalt/blob/main/pkg/lib/publ...

hyperupcall··on DOS Subsystem for Linux
I don't understand the confusion. I thought it was called WSL because WSL1 was just that - a Windows subsystem that acted as a sort of compatibility later for Linux. And then when they released WSL2 (which replaced the old model with a Hyper-V accelerated VM running Linux), there was no real reason to rename it and create confusion.
← PreviousPage 2 of 2