HNHacker News
TopNewBestAskShowJobs

xlii

3,506 karma · joined August 23, 2017

https://xlii.space

e-mail me: alexander (at) kaminski.se

submissionscomments
xlii··on Hologram v0.7.0: Milestone release for Elixir-to-JavaScript porting initiative
For serious apps it's impossible to escape reading Erlang or Erlang documentation. Many functions and libraries simply aren't available for Elixir or are partial (see `opentelemetry_*` family as an example). Deep debugging is almost exclusively done with Erlang functions.

I'd even say that the more serious/critical application becomes the more weight shifts toward Erlang. Personally I'd go with Erlang-first, but only because I've accumulated thousands paper cuts from Elixir.

For starters Elixir has much more palatable syntax, though.

xlii··on AI bot gives customer 80% discount, supplier can't deliver
Misleading title. AI chatbot hallucinated discount codes that weren't accepted but scammy customer decided to push on it.
xlii··on San Francisco to offer free childcare to people making up to $230k
I think the joke is people trying to figure out why 0.18. I, personally, enjoy it.
xlii··on My Gripes with Prolog
Someone bashing on my pet language? Cracks knuckles

Just kidding. Some of those are stylistic choices I don't have gripes but can understand the criticism. There is however one thing about "Non-cuts are confusing" I'd like to clarify:

In this example:

    foo(A, B) :-
      \+ (A = B),
      A = 1,
      B = 2.
It's very obvious why it fails and it has nothing to do with non-cut. Let's say A can be apple and B can be orange and now you're asking Prolog to compare apples to oranges! ;)

In short one has to "hint" Prolog what A and B can be so then it can "figure out" whethever comparison can be made and what is its result. Assuming there exist is_number(X) clause that can instantiate X as a number following would work just fine:

    foo(A, B) :-
      is_number(A),
      is_number(B),
      \+ (A = B),
      A = 1,
      B = 2.
(note that this would be stupid and very slow clause. Instantiation in such clauses like is_number(X) usually starts with some defined bounds. For A = 10000, B = 10001 and lower bound of 1 pessimistic case this clause would require 100M checks!
xlii··on The URL shortener that makes your links look as suspicious as possible
I posted my site on the thread.

My site is hosted on Cloudflare and I trust its protection way more than flavor of the month method. This probably won't be patched anytime soon but I'd rather have some people click my link and not just avoid it along with AI because it looks fishy :)

xlii··on Ask HN: Share your personal website
https://xlii.space
xlii··on I hate GitHub Actions with passion
act is often mentioned as a drop-in replacement but I never got it to replicate GitHub actions environment. I didn't try it for this particular case, though.
xlii··on I hate GitHub Actions with passion
Totally agree.
xlii··on Git Rebase for the Terrified
That's true, but acceptance is still all or nothing.

When chaining commits it's possible to (for example) have a function that does THING and then have another PR that have a function that uses first one.

It's somewhat PITA when team has no-dead-code hard rule, but otherwise it's quite manageable and invites rich feedback. Reviewer and feedback can focus on atomic change (in example: function that does THING) and not on a grand picture.

But I also often use method of logical PRs and even written about it: https://xlii.space/eng/pr_trick/

xlii··on Git Rebase for the Terrified
Also branches that are write-only by a single person by consensus. E.g. "personal" PR branches that are not supposed to be modified by anyone but owner.
xlii··on Git Rebase for the Terrified
Allow me (today) to be that person to propose checking out Jujutsu instead [0]. Not only it has a superpower of atomic commits (reviewers will love you, peers will hate 8 small PRs that are chained together ;-)) but it's also more consistent than git and works perfectly well as a drop-in replacement.

In fact, I've been using Jujutsu for ~2 years as a drop-in and nobody complained (outside of the 8 small PRs chained together). Git is great as a backend, but Jujutsu shines as a frontend.

[0]: https://www.jj-vcs.dev/latest/

xlii··on Oh My Zsh adds bloat
Dunno.

I have 90 lines zsh config with 3 plugins (compinit, vcs-info, edit-command-line) and startup-exit sequence takes 0.32s.

You learn very quickly where the lags come though when you work on a big old repository (I learned this on Emacs source code) where getting current branch for jujutsu takes ~5 second. Git is faster in this regard but it still is ~0.3s

I'm not fan of starship (I don't use fancy command line variables in general) but many of those issues can be dealt with awesome bkt caching utility [0]. Instead of live reading just let bkt cache it with long TTL with eager async refreshes. My guess is that Starship does exactly that.

[0]: https://github.com/dimo414/bkt

xlii··on ChatGPT Health
> what would you recommend if one is against the idea of medication in general for neurological issues that aren't deterental to ones life?

Given that ADHD people tend to commit suicide 2x-4x times more often than general population [0] keep in mind that it's not detrimental until it suddenly is.

Also it gets worse with age, so it's better to get under doctor's control sooner than later.

[0]: https://pmc.ncbi.nlm.nih.gov/articles/PMC5371172/

xlii··on Rust is beyond object-oriented, part 3: Inheritance (2023)
After my adventures with different languages I'm on the hill that Rust traits, Haskells typeclasses, (sic!) Go's interfaces, etc. are state-of-art features in modern programming languages.

It's not like they're without the footguns - they have plenty. But even with those footguns typeclasses (as I'd rather call them) are complexity escape hatches.

E.g. at some point your type can have dozen of different implementations and you can decide to ignore that fact completely while proceeding to work on your (very narrow) piece of pie ignoring vastness of universe[^0] you found yourself in.

That being said multiple inheritance fits the same category and with minimal squinting same features can be found in languages such as Clojure or Elixir.

As other commenters mentione this is not a secret by any means, as composition over inheritance advice is decades old, but IMO still worth repeating because there might be someone who doesn't know it yet :)

[^0]: By universe I mean code implementional universe, not The Universe

xlii··on JavaScript's For-Of Loops Are Fast
On Safari are results were within 3% of each other. On Brave "for loop, negative" was 84% faster than "for of".

This small sample (2 browsers on macOS) align with my expectations of "Good luck optimizing JavaScript that has dozen of different implementations".

xlii··on Maybe comments should explain 'what' (2017)
Haskell enters the chat

Haskell (and OCaml I suppose two) are outliers though as one is supposed to have a small functions for single case. It's also super easy to find them and haskell-language-server can even suggest which functions you want based on signatures you have.

But in other languages I agree - it's abomination and actually hurt developers with lower working memory (e.g. neuroatypical ones).

xlii··on Maybe comments should explain 'what' (2017)
I'm all against commenting gatekeeping. IMO this is an anti-pattern.

Even in stupidest cases, like:

    // add two and two
    let four = two + two
The rationale for this is that if you start to mute developer on case of "this is not comment-worthy" you start to actually losing context for the codebase. Sure, maybe "add two and two" is not contextful enough, but "add same account twice" might be signal for appropriate code.

Maybe that's me, but I rarely saw teams which over-document, under-documenting is usually the case. So if we ever meet in professional environment - comment away. Worst case scenario - I'll skim over it.

xlii··on Why users cannot create Issues directly
I have a one bit that might be useful that I learned from debugging/optimizing Emacs.

macOS' Instruments tool only checks for leaks when it can track allocations and it is limited to ~256 stack depth. For recursive calls or very deep stacks (Emacs) some allocations aren't tracked and only after setting malloc history flags [0] I started seeing some results (and leaks).

Another place I'm investigating (for Emacs) is that AppKit lifecycle doesn't actually align with Emacs lifecycle and so leaks are happening on the AppKit and that has ZERO to do with application. Seems that problem manifests mostly on a high end specs (multiple HiDPI displays with high variable refresh rate, powerful chip etc.)

Probably nothing you haven't investigated yet, but it is similar to the ghost (pun intended) I've been looking for.

[0]: https://developer.apple.com/library/archive/documentation/Pe...

xlii··on Ask HN: A self populating task list
I had multiple implementation for myself, it's not worth it. In general task lists are all about motivation to do something not a "sweep" to find some work. At the beginning new systems hit home, but once novely wears down I found them pointless.

You can check Amazing Marvin, which has plenty of various gadgets available and have REST API client for integration. In business setting software like Linear with its integration is usually the way to go.

xlii··on Rust--: Rust without the borrow checker

    > In addition to meeting the Open Source Definition, the following standards apply to new licenses:
    > (...) The license does not have terms that structurally put the licensor in a more favored position than any licensee.
    https://opensource.org/licenses/review-process

That's a funfact I learned from IP lawyer when discussing possibility of open-source but otherwise LLVM-extempt license. If there is extemption (even in LLM) such license is most likely OSI-incompatible.
xlii··on Show HN: Ssort – I got sick and vibe coded a stream priority sorter
Good question - main thing is that it's saving time on repeatable searches and optimize search.

I was working with Elixir without ability to use LSP and so, my flow often looked like this:

    > rg "defp|def\b|def_rule|def_helper" . | rg "something"
Only to find that someone made a "def_instruction" and it's there. I didn't want to filter our, I just wanted to... sort.

With config file I can do a simple

    > rg "something" | ssort ~/ssort/elixir_methods
    > # or if I use it often
    > alias ssort-elixirm "ssort ~/ssort/elixir_methods"
    > rg "something | ssort-elixirm
This can be solved by working LSP though, what working LSP can't solve though is:

    > rg "impl" | ssort-elixirm | ssort -f MyCompany
But (given as it looks like it was buried) it's a microoptimization for CLI search freaks ;)
xlii··on Principles of Slack Maximalism
Unless there is something new Slack doesn't have personal APIs but merely integration APIs and history extraction was a big violation list time I checked. I doubt anything had changed in this scope though.
xlii··on Principles of Slack Maximalism
Slack would be good tool if it would let me just stream and filter straight from the CLI.

Since IRC allows to do this with almost zero setup I'd rather see it used in my fantasies where non-technical people aren't considered for choice of tooling ;)

xlii··on A million ways to die from a data race in Go
Whatever the case Go's tooling (i.e. IDE part) is one of the best in class and I think it shouldn't be be dismissed in the context of some footguns that Go has.
xlii··on Event Sourcing in Go: From Zero to Production
I'm going to have a word with my ISP. It seems that sites SSL certificates has expired. That's not a good thing, but my ISP decided I'm an idiot and gave me a condescending message about accepting expired certificate - unacceptable in my book. VPN helped.

Too much dry code for my taste and not many remarks/explanations - that's not bad because for prose I'd recommend Martin's Fowler articles on Event processing, but _could be better_ ;-)

WRT to tech itself - personally I think Go is one of the best languages to go for Event Sourcing today (with Haskell maybe being second). I've been doing complexity analysis for ES in various languages and Go implementation was mostly free (due to Event being an interface and not a concrete structure).

xlii··on Cloudflare outage on November 18, 2025 post mortem
Cloudflare rewrites Rust services to <next-cool-language> /joke

...

(I'd pick Haskell, cause I'm having fun with it recently :P)

xlii··on Löb and Möb: Loops in Haskell (2013)
A writer without unwritten article can throw the first stone... :)
xlii··on EyesOff: How I built a screen contact detection model
Assuming this works it will for sure be used for employee tracking.

Privacy protector solves different problems - they prevent people from extracting information on screen, not merely inform about possible infraction.

That being said it's useful in a way that if I'd see anything like that in a contract it wouldn't be a red flag. It'd be red flashing GT*O alarm ;)

xlii··on Löb and Möb: Loops in Haskell (2013)
https://colourcoding.net/2018/03/29/marvellous-moeb/

FTFY :)

xlii··on Who needs Graphviz when you can build it yourself?
Sorry for the late response but I just noticed your comment. I know UML and studied it for decades along with other diagramming solutions and this is something exactly opposite I aim for.

UML was made as a specification-through-visuals tool and I'm aiming at diagrams-as-communication tool. I.e. sure you can save them, but the use case I aim is that you hop on the video call, share screen and discuss specific concept with one of the diagram types.

Collaboration is a huge part of it, but since I've never seen my concept in realization I'm going to keep it hush-hush for a while :)

← PreviousPage 6 of 22Next →