frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

The original vi is a product of its time (and its time has passed)

https://utcc.utoronto.ca/~cks/space/blog/unix/ViIsAProductOfItsTime
1•ingve•5m ago•0 comments

Circumstantial Complexity, LLMs and Large Scale Architecture

https://www.datagubbe.se/aiarch/
1•ingve•13m ago•0 comments

Tech Bro Saga: big tech critique essay series

1•dikobraz•16m ago•0 comments

Show HN: A calculus course with an AI tutor watching the lectures with you

https://calculus.academa.ai/
1•apoogdk•19m ago•0 comments

Show HN: 83K lines of C++ – cryptocurrency written from scratch, not a fork

https://github.com/Kristian5013/flow-protocol
1•kristianXXI•24m ago•0 comments

Show HN: SAA – A minimal shell-as-chat agent using only Bash

https://github.com/moravy-mochi/saa
1•mrvmochi•25m ago•0 comments

Mario Tchou

https://en.wikipedia.org/wiki/Mario_Tchou
1•simonebrunozzi•26m ago•0 comments

Does Anyone Even Know What's Happening in Zim?

https://mayberay.bearblog.dev/does-anyone-even-know-whats-happening-in-zim-right-now/
1•mugamuga•26m ago•0 comments

The last Morse code maritime radio station in North America [video]

https://www.youtube.com/watch?v=GzN-D0yIkGQ
1•austinallegro•28m ago•0 comments

Show HN: Hacker Newspaper – Yet another HN front end optimized for mobile

https://hackernews.paperd.ink/
1•robertlangdon•29m ago•0 comments

OpenClaw Is Changing My Life

https://reorx.com/blog/openclaw-is-changing-my-life/
2•novoreorx•37m ago•0 comments

Everything you need to know about lasers in one photo

https://commons.wikimedia.org/wiki/File:Commercial_laser_lines.svg
2•mahirsaid•39m ago•0 comments

SCOTUS to decide if 1988 video tape privacy law applies to internet uses

https://www.jurist.org/news/2026/01/us-supreme-court-to-decide-if-1988-video-tape-privacy-law-app...
1•voxadam•41m ago•0 comments

Epstein files reveal deeper ties to scientists than previously known

https://www.nature.com/articles/d41586-026-00388-0
3•XzetaU8•48m ago•1 comments

Red teamers arrested conducting a penetration test

https://www.infosecinstitute.com/podcast/red-teamers-arrested-conducting-a-penetration-test/
1•begueradj•55m ago•0 comments

Show HN: Open-source AI powered Kubernetes IDE

https://github.com/agentkube/agentkube
2•saiyampathak•59m ago•0 comments

Show HN: Lucid – Use LLM hallucination to generate verified software specs

https://github.com/gtsbahamas/hallucination-reversing-system
2•tywells•1h ago•0 comments

AI Doesn't Write Every Framework Equally Well

https://x.com/SevenviewSteve/article/2019601506429730976
1•Osiris30•1h ago•0 comments

Aisbf – an intelligent routing proxy for OpenAI compatible clients

https://pypi.org/project/aisbf/
1•nextime•1h ago•1 comments

Let's handle 1M requests per second

https://www.youtube.com/watch?v=W4EwfEU8CGA
1•4pkjai•1h ago•0 comments

OpenClaw Partners with VirusTotal for Skill Security

https://openclaw.ai/blog/virustotal-partnership
1•zhizhenchi•1h ago•0 comments

Goal: Ship 1M Lines of Code Daily

2•feastingonslop•1h ago•0 comments

Show HN: Codex-mem, 90% fewer tokens for Codex

https://github.com/StartripAI/codex-mem
1•alfredray•1h ago•0 comments

FastLangML: FastLangML:Context‑aware lang detector for short conversational text

https://github.com/pnrajan/fastlangml
1•sachuin23•1h ago•1 comments

LineageOS 23.2

https://lineageos.org/Changelog-31/
2•pentagrama•1h ago•0 comments

Crypto Deposit Frauds

2•wwdesouza•1h ago•0 comments

Substack makes money from hosting Nazi newsletters

https://www.theguardian.com/media/2026/feb/07/revealed-how-substack-makes-money-from-hosting-nazi...
5•lostlogin•1h ago•0 comments

Framing an LLM as a safety researcher changes its language, not its judgement

https://lab.fukami.eu/LLMAAJ
1•dogacel•1h ago•0 comments

Are there anyone interested about a creator economy startup

1•Nejana•1h ago•0 comments

Show HN: Skill Lab – CLI tool for testing and quality scoring agent skills

https://github.com/8ddieHu0314/Skill-Lab
1•qu4rk5314•1h ago•0 comments
Open in hackernews

Zippers: Making Functional "Updates" Efficient (2010)

http://www.goodmath.org/blog/2010/01/13/zippers-making-functional-updates-efficient/
63•tinyspacewizard•4mo ago

Comments

sevensor•4mo ago
I can see how this is useful if you’re repeatedly updating the same part of a tree. I can’t quite see how to use this approach for random edits. Seems like you’re back at recreating all the nodes back up to the root every time?
agentultra•4mo ago
You’re right! For random access and edits you’ll need a different solution. Maybe some monads to encapsulate the mutations.
macmac•4mo ago
Zippers are part of Clojure API (clojure.zip). They take a bit of work to get used to, but once you get it they are an amazing way of making "transactional" "changes" to immutable data structures.
thom•4mo ago
I've built quite a lot of functionality on top of Clojure's version of this. For deeply nested stuff it's great, necessary even. But for shallow sequences where you're mostly doing complex logic looking back and forth, I genuinely think you're better off building some sort of parser combinator solution where you can more naturally match multiple conditions over long ranges, and alter the output as you send it out, transducer-style. You're also much more likely to end up with good performance compared to the constant recursive navigation you do with zippers.
xdavidliu•4mo ago
i was messing around on hackerrank a few years ago and one of the problems involved implementing Huet's zipper tree, which I did in haskell. it was quite fun

https://github.com/xdavidliu/fun-problems/blob/main/zipper-t...

contificate•4mo ago
There's a neat paper where they implement basic blocks (in a control flow graph) as zippers (https://www.cs.tufts.edu/~nr/pubs/zipcfg.pdf). The neat part is that - due to how the host language works (mutation having the cost of invoking the write barrier) - their measurements show that the zipper version is more performant than the mutable version.
clarkmoody•4mo ago
I've used the zipper concept with lists for making impossible states impossible [0] in the context of Rust programs. The rich enum type in Rust creates opportunities to avoid bugs by baking small state machines into the code everywhere, like loading data in the linked example.

A concrete example is for managing the active item in a list. Instead of storing the active item as an index into the vector like this:

  struct List<T> {
    items: Vec<T>,
    active: usize,
  }
...which two the glaring impossible states. The vector can be empty, or the index can be outside the vector. Each time the active item is desired, we must check the index against the current state of the list.

Instead, we can use the zipper concept so we always have a concrete active item:

  struct List<T> {
    prev: Vec<T>,
    active: T,
    next: Vec<T>,
  }
Switching to a different active item requires some logic internal to the data structure, but accessing the active item always results in a concrete instance with no additional checks required.

[0]: https://sporto.github.io/elm-patterns/basic/impossible-state...

hombre_fatal•4mo ago
What does the second List impl offer over the first one?

It's the API that makes something impossible to misuse, and they could offer the same API like List.create(x: T, xs: T[]), but the first one is simpler.

clarkmoody•4mo ago
In one version I've seen, the active element is of a different type, offering enhanced functionality over the vectors of next and prev items:

  struct List<T, A> {
    prev: Vec<T>,
    active: A,
    next: Vec<T>,
  }
This could be used for some active type that has ephemeral cache information or state associated with it (view state in a GUI app, for instance). The inactive type may be hydrated and converted to active, and the active type can be archived into an inactive type.
johnfn•4mo ago
I tend to like the idea of making impossible states impossible, but your particular example seems to have a number of negative tradeoffs. For one, it's more complex than the original data structure - a simple call like .map() is now a fairly chunky operation, and if you want to filter after that, you really have a mess on your hands. Additionally, you seem to have traded off one set of "state we shouldn't allow to be represented" for another. For instance, you could have mistakenly included `active` in `prev` or `next`. That is something you couldn't have done in the initial version.
clarkmoody•4mo ago
The iterator can be implemented fairly simply:

  self.prev.iter()
    .chain(iter::once(self.active))
    .chain(self.next)
I'm not sure what you mean by including active in another position, but see my sibling comment that makes the active element of a different type, for another wrinkle on this thing.
rkangel•3mo ago
How do you represent an empty list with this approach?
gatane•4mo ago
Zippers are the derivative of lists. You can go beyond lists, too.

https://journals.sagepub.com/doi/abs/10.3233/FUN-2005-651-20...

geospeck•4mo ago
Here[1] is a nice breakdown of Zippers in Clojure. I am not the author of the post but I found it very helpful when I wanted to learn more about Zippers in Clojure. There are some nice illustrations as well.

- https://grishaev.me/en/clojure-zippers/

eikenberry•4mo ago
Archived version with the images still there...

https://web.archive.org/web/20160328032556/http://www.goodma...