Hacker Newsnew | past | comments | ask | show | jobs | submit | alberto-m's commentslogin

I appreciate this balanced take! Let's hope one day we'll get the best of today's and yesterday's era.

> Any alternative is better than the current state of things.

I don't know, the incentives for creators are already low enough. Any book one writes lands immediately in Anna's Archive and is digested into LLM slop for the profit of Altman & Co. Any piece of investigative journalism, when shared here or on Reddit, sees a link to some paywall-bypass site as one of the most upvoted comments. So we are already in a Bastiat's window situation where people are disincentivized to produce creative work. I'd rather not put the work of software creators even more at risk of being cheaply copied and copyright laundered: any state vault would be an easy target for trillion-dollar corporations.

Aside, as someone doing retro reverse engineering I greatly appreciate the author's words about the tension between software preservation and the need to reward creators for their work.


> Any piece of investigative journalism, when shared here or on Reddit, sees a link to some paywall-bypass site as one of the most upvoted comments.

That is generally because they're on random sites that want you to subscribe for a year to read the one piece that was mentioned on the sites you read... not going to happen, sorry.


How this worked for printed news back in the dark ages was:

A friend told you about an article, or a headline piqued your interest.

You could anonymously hand a negligible payment (few cents or dollars in cash) to an intermediary (the newspaper seller at the street corner) to get access to all the content published for a certain time period (daily/weekly/monthly issue of the publication).

Now a "friend" (for example a HN post) still tells you about an article. Unfortunately you can't get an issue, they want an ongoing commitment. It's not anonymous, you have to create an account. The intermediaries are gone though, is that a good thing?


I might be a contrarian in that I actually like using unsigned integers for sizes and indexes. In my experience, most of their trappings can be prevented by treating any subtraction involving them as a `reinterpret_cast`: i.e.

* Do your utmost to rewrite the code in order to avoid doing that (e.g. reordering disequations to transform subtractions into additions). * If not possible, think very hard about any possible edge case: you most certainly need an additional `if` to deal with those. * When analyzing other people's code during troubleshooting merge reviews, assume any formula involving an unsigned integer and a minus sign is wrong.


> An alternative view is that any C "unsigned" is both positive and negative. For example the unsigned short "1" is the same number as "65537" and as "-65535".

This can be disproven by the fact that dividing by `unsigned e = 1U` is well defined and always yields the starting number. If the unsigned numbers were really modular numbers as you suggest, division could not be defined.


This does not demonstrate anything. It is just additional evidence that the C standard contains contradictory rules about "unsigned" integers.

The oldest parts of the C language are all consistent with "unsigned" numbers being non-negative integers. The implicit conversions between different sizes of "unsigned", the sizeof operator, the relational operators and division are consistent with non-negative integers.

However the first C standard, instead of defining the correct behavior has left undefined many corner cases of the arithmetic operations, allowing the implementation of "unsigned" as either non-negative integers or integer residues.

Eventually, the undefined behaviors for addition, subtraction and multiplication have been defined to be those of integer residues, not those of non-negative integers.

These contradictory properties are the cause of many confusions and bugs.

In extensible languages, like C++, it is possible to define proper non-negative integers and integer residues and bit strings and to always use those types instead of the built-in "unsigned".

In C, it is better to always use signed numbers and avoid unsigned, by casting unsigned to bigger sizes of signed before using such a value.


The official announcement contains many interesting complementary links:

https://opensource.microsoft.com/blog/2026/04/28/continuing-...


I used Qwen CLI's undescribed “coder_agent” (I guess Qwen 3.5 with size auto-selection) and it was powerful enough to complete 95% of a small hobby project involving coding, reverse engineering and debugging. Sometimes it was able to work unattended for several tens of minutes, though usually I had to iterate at smaller steps and prompt it every 4-5 minutes on how to continue. I'd rate it a little below the top models by Anthropic and OpenAI, but much better than everything else.


I opened “view source” in Firefox and it showed the html in a different font than usual. Maybe it's just a fallback because the page contains Chinese characters, but I was quite surprised. A small page with a lot of mysteries.


Really great writing and interesting experiment! I love the small details like the “clueless user”-style crash report in the `about:telemetry` section (“it just crashed out of nowhere”)


Churchill and Eisenhower beg to disagree. When everyone is bad, you focus on restraining the most powerful actor first.


One thing I find life-changing is to remap the up arrow so that it does not iterates through all commands, but only those starting with the characters I have already written. So e.g. I can type `tar -`, then the up arrow, and get the tar parameters that worked last time.

In zsh this is configured with

    bindkey "^[OA" up-line-or-beginning-search # Up
    bindkey "^[OB" down-line-or-beginning-search # Down


Once you start using CTRL+r, you may find that you never reach for up arrow again.


I'm familiar with ctrl-r, but I still very much like the up-arrow behavior described by that commenter.


Looking at it from a "law of least surprise" angle, it's exactly how it should behave.

"I typed 'cd di↑' and you're giving me 'pwd'??"


What I love about the default Bash Crtl-C behaviour is that once a command has been located, the bash history is moved to the history of that command, until Enter is pressed.

  $ a
  bash: a: command not found
  $ b
  bash: b: command not found
  $ c
  bash: c: command not found
  $ d
  bash: d: command not found
  $ <CTRL-R> b <UP>
  $ a
That's great if I don't remember which command I was experimenting with, but I do know other commands that I did around that time (usually a file that I edited with VIM).


Atuin[1] feels like the best of both worlds to me.

[1] https://github.com/atuinsh/atuin


Atuin looks pretty nice — I might give it a try.

I went down the “fully automatic history” path before, but it mostly turned into noise for me.

Keeping a tiny cheatsheet of things I had to look up twice ended up working better.


And once you want to one-up this look into fzf.


And once you get tired of fzf and want something better, you reach for https://atuin.sh.

Completely transformed all of my workflows


From the atuin.sh website

> Sync your shell history to all of your machines

I think of my shell history as very machine specific. Can you give some insights on how you benefit from history sync? If you use it.


That feature is entirely optional and disabled by default. Atuin stores your shell history locally in a sqlite db regardless of whether you choose to sync it. I thought fzf was fast, but atuin makes it look slow by comparison.


Same, I find shared history not very useful.

However what I do find useful is eternal history. It's doable with some .bashrc hacks, and slow because it's file based on every command, but:

- never delete history

- associate history with a session token

- set separate tokens in each screen, tmux, whatever session

- sort such that backward search (ctrl-R) hits current session history first, and the rest second

Like half my corporate brain is in a 11M history file at this point, going back years.

What I would love is to integrate this into the shell better so it's using sqlite or similar so it doesn't feel "sluggish." But even now the pain is worth the prize.


I just want to give a perspective of someone that uses the 'eternal history' in bash per Eli Bandersky [1] and reluctance to use something like atuin (without/ignoring shared history).

First, as for speed and responsiveness, if there is a degradation, it is imperceptible to me. I wouldn't have a clue that my interactive shell is slowing down because it is logging a command to ~/.persistent_history.

My persistent_history is 4MB and has been migrated from machine to machine as I've upgraded, it's never felt slow to edit with (neo)vim or search with system supplied grep.

Eli's way of doing it also includes the timestamps for all commands, so it's easy to trace back when I had run the command, and duplicates are suppressed. In fact my longest persistent_history goes back to 2019-07-04, so I've been using it for quite some time now.

But the larger point I wanted to make is that I wouldn't feel comfortable switching this, in my opinion, quite efficient setup to displace it with an sqlite database. That would require a special tool to drill through the history and search rendering simple unix utilities useless. As Eli suggested, if your history gets too big, simply rotate the file and carry on. I have the alias phgrep to grep ~/.persistent_history, but I can easily have another alias to grep ~/.persistent_history*.

[1]: https://eli.thegreenplace.net/2013/06/11/keeping-persistent-...


You don't have to setup shared history with Atuin if you don't want to and that's what's holding you back. Otherwise it hits the rest of your requirements. Just don't hesitate to change from the default config.


1. work on a project on host_foo in /home/user/src/myproject

2. clone it on host_bar in /home/user/src/myproject

If you set filter_mode = "directory", you can recall project specific commands from host_foo for use on host_bar even though you're working on different machines and the search space won't be cluttered with project specific commands for other projects.


I sync Atuin to my home server but I also configure it to be host specific by default.


There is a difference, I believe. Doesn't Ctrl+r do a substring search instead?


Yes it's different: it will match anywhere in the previous command lines.


If you use multiple terminals it kinda sucks unless you do export PROMPT_COMMAND='history -a' in your.bashrc or something cause only the last closed terminal saves to history


export EDITOR=vi and then hitting Esc puts you into vi mode; k, j to move up/down through history or pressing / to search etc including using regex is all available.


Prefix search is faster for the majority of cases. CTRL-r / FZF is useful for the remaining ones.


Ctrl-r can’t replace prefix search.


I agree it's a game changer! For bash to do the same I put this in my .inputrc:

    ## arrow up
    "\e[A":history-search-backward
    ## arrow down
    "\e[B":history-search-forward


+1, i found out about this here: https://news.ycombinator.com/item?id=11211344 . total game changer.


This is the default `fish` shell behavior. Type anything, up/down keys to iterate through full commands that containing the term; alt + up/down to iterate through args containing the term.


Fish is underrated


This can also be achieved with `.inputrc`:

    "\e[A": history-search-backward
    "\e[B": history-search-forward


Thank you !


That's a nice one.

One thing I do is configure my keyboard so that "modifier+{ijkl}" mimicks the inverted T arrows key cluster. So there's never a need for me to reach for the arrow keys. And {ijk} makes more sense than vi's {hjkl} and is faster/more logical/less key fingers travel. The nice thing is: as I do this at the keyboard level, this works in every single map. "modifier" in my case is "an easily reachable key in a natural hand position on which my left thumb is always resting" but YMMV.

I set that up years ago and it works in every app: it's gorgeous. Heck, I'm using it while editing this very message for example.

And of course it composes with SHIFT too: it's basically arrow keys, except at the fingers' natural positions.


I did the same, starting with Ergo Mode in Emacs many years ago, and ending up today with a programmable split keyboard with those keys as arrows on a layer. For when I'm on a laptop without the keyboard, I have a mishmash of solutions that bind to Alt+{ijkl}


Very nice! Here's the full code for those that had, like me, a more minimalistic .zshrc:

```

autoload -U up-line-or-beginning-search

autoload -U down-line-or-beginning-search

zle -N up-line-or-beginning-search

zle -N down-line-or-beginning-search

bindkey "^[[A" up-line-or-beginning-search

bindkey "^[[OA" up-line-or-beginning-search

bindkey "^[[B" down-line-or-beginning-search

bindkey "^[[OB" down-line-or-beginning-search

```


Heh. I've done this since forever, but I use PgUp and PgDn so I can retain the original meaning of the up arrow key.


When I was on ubuntu it was easy to uncomment a couple lines in /etc/inputrc for this


I do something similar. I leave up and down arrows alone, but have ctrl+p and ctrl+n behave as you describe.


Did this many years ago (but with bash) -- life changing is an apt way of saying it.


Here's the Bash commands for this in case anyone is looking for them

  bind '"\e[A"':history-search-backward
  bind '"\e[B"':history-search-forward


I'd try this, but I often find that I want to repeat a cycle of two or more commands. Yes, I probably should edit and put them on one line with semicolons (or even make a function), but.


Or put && between them - I had "compile;run" and when compile failed, it still ran (but the old build). Took me a while to figure out. && ensures the first command succeeds. Anyway, so worth it to combine commands into one line for easy re-run.


Atuin is better than anything I’ve used in a shell.


> life-changing

For further life-changing experience... add aliases to .bash_aliases

    alias gph='history | grep --colour -i '
    alias gpc='grep --colour -Hin '
    #if gnu time is installed
    alias timef='/usr/bin/time -f "tm %E , cpu %P , mem %M" '


I've got many like these I copied from various people over the years.

One I came up and that I use all the time:

    alias wl='wc -l'
I use it so much I sometimes forget it's not stock.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: