Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    234comments
  2. Cloudflare Quick Tunnels(cloudflare.com ↗)
    242comments
  3. Saving another 100TB of RAM(cloudflare.com ↗)
    40comments
  4. The Farnese letter(simonklee.dk ↗)
    3comments
  5. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    65comments
  6. How to Write with an LLM(sockpuppet.org ↗)
    264comments
  7. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    12comments
  8. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    43comments
  9. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    76comments
  10. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    52comments
  11. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    181comments
  12. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    51comments
  13. OpenJev(openjev.com ↗)
    245comments
  14. Column built an issuer processor from scratch(column.com ↗)
    4comments
  15. Cyclomatic Complexity in C#(ndepend.com ↗)
    14comments
  16. Two parallel neural ectoderm progenitors contribute to the developing brain(newscientist.com ↗)
    53comments
  17. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    195comments
  18. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    19comments
  19. Minimal Phone 2(minimalcompany.com ↗)
    169comments
  20. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    22comments
  21. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    90comments
  22. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    32comments
  23. Size-Specialized Memory Allocation(go.dev ↗)
    3comments
  24. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    16comments
  25. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    181comments
  26. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    151comments
  27. From Geometry to Algebra and Back Again: 4000 Years of Papers (2023) [video](youtube.com ↗)
    discuss
  28. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    19comments
  29. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  30. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    303comments

Metaprogramming for madmen

134 pointsby 12y agofgiesen.wordpress.com
12 comments
12y agoHN ↗

This is an amazing insight into how demos are written. Farbrausch stuff has always been inspirational to me.

It's very interesting is the sort of extreme version of the idea that data model and code are inherently tied: Especially in functional programming circles it's a maxim that you design your data models first, specifically for your task, and then the rest of the code is pretty much pattern-matching around that. This takes that coupling and makes it even tighter, to serve a higher purpose. I almost feel like given enough time, this could be a JIT: an executable that adaptively strips code and self-minifies over time as you run it. :)

Also check out: - kkrieger (windows only 96kb 3D FPS, video here: https://www.youtube.com/watch?v=2NBG-sKFaB0) - the previous post (http://fgiesen.wordpress.com/2012/02/13/debris-opening-the-b...)

12y agoHN ↗

an executable that adaptively strips code and self-minifies over time as you run it

i wonder if a lot of the dead code paths are already eliminated at runtime by the branch predictors in modern CPUs/GPUs. of course it would make no difference for size on disk (which can be argued is mainly useful for code golf and edu these days), but it would be cool to get that feedback in some format without needing to exert any additional effort.

12y agoHN ↗

Do you know much about branch prediction? It seems pretty darn interesting. I'm just curious as to how something like that would work with a path that potentially has side-effects. I don't really know how things work very well at that level, so perhaps I'm misunderstanding something.

12y agoHN ↗

Branch predictors do not modify the code in memory. Dead code is still there; if you have a branch that is always taken, the predictor may remember that, but the wasted bytes following it are still using up your cache.

You can usually get the linker to either remove dead code or assist in its removal, though. "Nearly" dead code is the big pain (e.g. options that are never set but could be).

12y agoHN ↗

I almost feel like given enough time, this could be a JIT: an executable that adaptively strips code and self-minifies over time as you run it. :)

Yes, their tool is getting pretty similar to superoptimization and profile-guided optimization.

(Of course, you don't really want to self-minify over time: what if a new request comes in from a user exercising stripped functionality? You'd have to have some sort of fallback way to retrieve the original unoptimized code.)

12y agoHN ↗

This is how Go's test coverage tool works, except in the Go case it was easy to do because there are libraries for reading and writing Go source code in the standard library.

Details: http://blog.golang.org/cover

12y agoHN ↗

GCC can do it as well, compile your code with --coverage and `gcov -c` will tell you how often each branch was taken.

12y agoHN ↗

This brings back fond memories of trying to get a 4k under the magic 4096 bytes. You get really good at reusing data.