frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Packed Data Support in Haskell

https://arthi-chaud.github.io/posts/packed/
77•matt_d•1y ago

Comments

nine_k•1y ago
> Introducing the ‘packed’ data format, a binary format that allows using data as it is, without the need for a deserialisation step. A notable perk of this format is that traversals on packed trees is proven to be faster than on ‘unpacked’ trees: as the fields of data structures are inlines, there are no pointer jumps, thus making the most of the L1 cache.

That is, a "memory dump -> zero-copy memory read" of a subgraph of Haskell objects, allowing to pass such trees / subgraphs directly over a network. Slightly reminiscent of Cap'n Proto.

90s_dev•1y ago
We are always reinventing wheels. If we didn't, they'd all still be made of wood.
Zolomon•1y ago
They mention this in the article.
spockz•1y ago
It reminds me more of flat buffers though. Does protobuf also have zero allocation (beyond initial ingestion) and no pointer jumps?
cstrahan•1y ago
No, one example of why being variable sized integers.

See https://protobuf.dev/programming-guides/encoding/

carterschonwald•1y ago
One thing that sometimes gets tricky in these things is handling Sub term sharing. I wonder how they implemented it.
tlb•1y ago
> the serialised version of the data is usually bigger than its in-memory representation

I don’t think this is common. Perhaps for arrays of floats serialized as JSON or something. But I can’t think of a case where binary serialization is bigger. Data types like maps are necessarily larger in memory to support fast lookup and mutability.

nine_k•1y ago
I suppose all self-describing formats, like protobuf, or thrift or, well, JSON are bigger than the efficient machine representation, because they carry the schema in every message, one way or another.
IsTom•1y ago
If you use a lot of sharing in immutable data it can grow a lot when serializing. A simple pathological example would be a tree that has all left subtrees same as the right ones. It takes O(height) space in memory, but O(2^height) when serialized.
gitroom•1y ago
honestly i wish more stuff worked this way - fewer hops in memory always makes me happy
lordleft•1y ago
This was very well written. Excellent article!
NetOpWibby•1y ago
Is this like MessagePack for Haskell?

America's $10T AI infrastructure boom is starting to fray

https://www.ft.com/content/9ea5a37d-15c9-4d5b-94d6-719048c9cd3c
1•cheesecompiler•2m ago•0 comments

He Jiankui Affair

https://en.wikipedia.org/wiki/He_Jiankui_affair
1•cl3misch•7m ago•0 comments

JAXA is about to perform a Phobos sample return mission

https://www.science.org/content/article/audacious-space-heist-japan-aims-bring-home-bits-martian-...
1•Muhammad523•8m ago•0 comments

A Princeton PhD Applied to 2,300 Jobs. He Still Can't Get One

https://www.wsj.com/lifestyle/careers/labor-market-freeze-phd-graduate-f8e17d7c
2•mid1110•12m ago•0 comments

Zero-Click Spyware Is Infecting Phones via Targeted Ads

https://www.wired.com/story/nightmare-scenario-zero-click-spyware-is-infecting-phones-via-targete...
1•walterbell•14m ago•0 comments

Encryption Is Getting Squeezed from All Sides

https://www.wired.com/story/kernel-panic-encryption-is-getting-squeezed-from-all-sides/
1•ent101•22m ago•0 comments

Space Shuttle Endeavour Transport

https://www.cordobacorp.com/move-of-the-space-shuttle-endeavour/
1•thunderbong•28m ago•0 comments

Algorithmic Similarity and the Limits of Proof: Facial Recognition

https://medium.com/@smoking2man/algorithmic-similarity-and-the-limits-of-proof-facial-recognition...
1•Aldus551•33m ago•0 comments

The Cycle of New Software: On Operative Simulacra

https://szymon-wilczek.me/writings/the-cycle-of-new-software/
1•signa11•33m ago•0 comments

'What the hell did this?': The orca brothers preying on great white sharks

https://www.bbc.com/future/article/20261015-sharks-washed-up-one-after-another-after-another-why-...
1•jazali•34m ago•0 comments

Want to Release Projects Easily?

https://cx-shipd.netlify.app
1•CX-Designs•43m ago•0 comments

Anthropic turns to lawyers to help AI agents strike deals

https://www.ft.com/content/f7c26ac0-f5f2-443a-86b2-39d62f7920a9
1•thm•45m ago•0 comments

Show HN: Parents Inbox – Communication Guide for Schools

https://helptheparents.org/
1•sxates•49m ago•0 comments

TurboScribe AI: Free video to text and audio to text converter

https://www.turboscribeai.org/
1•wsm123456•53m ago•0 comments

China startup demoes prototype EUV light source, still years away from viability

https://www.tomshardware.com/tech-industry/semiconductors/china-startup-demoes-prototype-euv-ligh...
1•rguiscard•54m ago•0 comments

PwnEscape: Guest-to-Host KVM Escape (CVE-2026-99999)

https://pwn.ai/blog/pwnescape
1•taubek•55m ago•0 comments

I made an OS kernel in Rust that runs in the browser and on an actual computer

https://github.com/avycado13/webos
1•avycado13•1h ago•0 comments

LLMs are inside fabs, so why aren't they solving core problems?

https://www.waferpilot.xyz/resources/fab-llm-yield-reliability/
2•mangohaha•1h ago•0 comments

Telegram Web A: Telegram's Zero-Dependency Official Web Client

https://github.com/Ajaxy/telegram-tt
2•theanonymousone•1h ago•0 comments

Show HN: Pbschema-lens – static doc generator for protobuf

https://github.com/ymmt2005/pbschema-lens
1•ymmt2005•1h ago•0 comments

The game industry is broken – can we fix it?

https://knowledge.edge-online.com/p/the-game-industry-is-broken-can-we-fix-it-tim-sweeney-edge-crash
17•mellosouls•1h ago•13 comments

World's Timekeepers Vote to Eliminate the Leap Second

https://www.smithsonianmag.com/smart-news/its-official-timekeepers-have-gotten-rid-of-the-leap-se...
1•signa11•1h ago•0 comments

Fast approximation algorithms for knapsack problems (1977)

https://ieeexplore.ieee.org/document/4567944
1•vismit2000•1h ago•0 comments

Dot factory – a spec to describe complex (agentic) workflows

https://redbeardlab.github.io/dotFactory/
1•siscia•1h ago•0 comments

Matthew Prince on why Cloudflare offers a free version and always will

https://webmasters.stackexchange.com/questions/88659/how-can-cloudflare-offer-a-free-cdn-with-unl...
39•thatslast•1h ago•15 comments

Mobile Application GPU Optimization Guide

https://arm-software.github.io/magog/
1•matt_d•1h ago•0 comments

Rahn Curve

https://en.wikipedia.org/wiki/Rahn_curve
1•baxtr•1h ago•0 comments

Does moving a GPU server's request loop into the kernel save CPU?

https://eunomia.dev/blog/2026/10/17/bpf-gpu-server/
1•thatslast•1h ago•0 comments

Wing Commander 3 is getting a remaster

https://www.pcgamer.com/games/sim/it-looks-like-wing-commander-3-is-getting-a-remaster-after-ea-p...
3•jbm•1h ago•0 comments

AI Slop? Nay, AI Gourmet

https://octomon.dev/blog/ai-slop-and-ai-gourmet/
1•securitypedant•1h ago•1 comments