Better HN
topnewbestaskshowjobs
Log inSign up

skribanto

49 karma · joined Jan 27, 2022 (4y ago) · 63 submissions

Submissions

comment 1mo ago · link · parent

I routinely run into issues, where Claude will try to add functionality to a dict-heavy API and messup the keys, I just do an initial pass converting everything to dataclasses, and it can iterate on it's own with the typechecker to fix everything on it's own, but otherwise I have to do a bunch of manual iterations.

comment 1mo ago · link · parent

The use case in the article though is type checking standalone scripts with declared dependencies. So it kind of needs some kind of package management + type checking utility at the same time.

comment 2mo ago · link · parent

Thats like the same point the article is making

comment 7mo ago · link · parent

From my understanding git reflog works on refs and jj op log works on fhe repo as a whole.

E.g. if I rebase some stacked branches then I want to undo it, with git I would reset each branch separately.

With jj you can timetravel the state of the repo in ine command

comment 10mo ago · link · parent

rerere can help, but OP probably has their own workflow

comment 11mo ago · link · parent

Why couldnt you flatten it?

comment 1y ago · link · parent

swap with last element then truncate at the end

comment 1y ago · link · parent

Well, it can make some chained function composition easier.

  Ick1 result1 = potentiallyNull1();
  Ick2 result2 = (result1 == null) ? null : potentiallyNull2(result1);
  Ick3 result3 = (result2 == null) ? null : potentiallyNull3(result2);
vs

  Ick3 result3 = potentiallyNone1()
    .flatMap(potentiallyNone2)
    .flatMap(potentiallyNone3);
You could maybe move the null check inside the method in the former and it cleans it up a bit, but in the latter you can have methods that are explicitly marked as taking NonNull in their type signature which is nice.

comment 1y ago · link · parent

maybe it’s better now, but at last time I checked (~2 years ago) humans are still better in jargon heavy contexts - legal as you mentioned, tech/medical/etc. also accents, muffled audio, noise in general, humans are (were?) much better at accounting for that

comment 1y ago · link · parent

My interpretation is that as engineers, we attempt to justify all of our choices through purely rational means. However, as humans, we cannot really make said choices without also being at least somewhat influenced by our subjective affections.

Perhaps I'm stretching the author's message, but at least I believe that the argument extends to all engineering conclusions. The author's call is that we acknowledge this subjective side.

Essentially, true engineering is about tradeoffs, there is no X that is objectively better than Y in all circumstances and contexts.

comment 1y ago · link · parent

Well, recursion is well-structured and can be reasoned about through induction. Goto is unstructured…

comment 1y ago · link · parent

I don’t think I follow, do you mind giving a concrete example?

comment 2y ago · link · parent

Well the main point is that there are changes that for most languages would need a change in the compiler/interpreter itself. However in lisp those kinds of things can be done in userspace

comment 2y ago · link · parent

I believe int[6] can still be passed to static 5 but I would have to double check

comment 2y ago · link · parent

Looks fine to me

comment 2y ago · link · parent

I like to wrap it in a venv (pure python project) or nix flake (mixed languages)

comment 2y ago · link · parent

Left leaning red black trees enforce extra constraints, which remove symmetries. This actually adds an edge case when instead you can just treat left/right rotations and comparisons as symmetric operations.

Left Leaning Red Black Trees Considerer Harmful: https://www.read.seas.harvard.edu/~kohler/notes/llrb.html

comment 2y ago · link · parent

A follow up from the same author

https://blog.codinghorror.com/web-discussions-flat-by-design...

comment 2y ago · link · parent

Interesting side note: the blog is generated with the C preprocessor

https://aartaka.me/this-post-is-cpp

comment 2y ago · link · parent

e4 d5 e5 f5 exf6 This simple en passant works

comment 2y ago · link · parent

I use Sidebery for tab groups, but it would be nice to have it built in

comment 2y ago · link · parent

At least in safari, you can hit the AA button and increase the font size there.

comment 2y ago · link · parent

Aren’t fruits only plants which contain seeds? Like a celery would not be a fruit

comment 2y ago · link · parent

You can approximate it by maintaining some kind of vtable, but it can get messy, especially if you need to implement multiple traits/interfaces.

comment 3y ago · link · parent

These virtues are promoted by Christianity as well

comment 3y ago · link · parent

Without it, it would pass the current location, that is the location inside that test function, rather than the original parent call.

comment 3y ago · link · parent

Maybe have your public fields defined as a second struct, and then you can cast the pointer to your struct to the concrete struct that has all the public fields. This has the restriction that all public fields must be at the start, and you must make sure to maintain the same order between the two structs.

At this point though, I think I honestly would prefer setters/getters.

    struct MyClassPublic {
        int x;
        int y;
        ...
    }

    /* using it */
    MyClass *myclass = myclass_create();
    ((MyClassPublic *)myclass)->x = 5;

comment 3y ago · link · parent

Austral has been looking good to me as a potential "rust-lite". It's still in the very early stages though.

comment 3y ago · link · parent

For me, tap hold is kind of iffy. If I set the hold delay short enough that it doesn’t feel sluggish, it becomes too easy to misfire it while trying to type. That’s just my experience though, I’ve come to prefer dedicated keys for each in a thumb cluster

comment 3y ago · link · parent

Getting 502 Bad Gateway
123