Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    88comments
  2. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    44comments
  3. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    45comments
  4. San Francisco Onion Futures Company(onionfutures.com ↗)
    65comments
  5. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    406comments
  6. Apple M6 Pro Achieves the Highest Single-Core CPU Score in Geekbench 7(geekbench.com ↗)
    27comments
  7. Typesafe-computer-use drives a Mac toward a goal for 1/50th of a cent per step(github.com/awlevin ↗)
    46comments
  8. Cloudflare Quick Tunnels(cloudflare.com ↗)
    279comments
  9. Science Is Open Software(jepedersen.dk ↗)
    37comments
  10. SDCC – Small Device C Compiler(sourceforge.net ↗)
    17comments
  11. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    14comments
  12. How to Write with an LLM(sockpuppet.org ↗)
    326comments
  13. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    32comments
  14. Saving another 100TB of RAM(cloudflare.com ↗)
    72comments
  15. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    86comments
  16. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    5comments
  17. "The Secret Life of Circuits" is here(coredump.cx ↗)
    2comments
  18. NASA-IBM Lunar Foundation open-Source Geospatial AI Model(usra.edu ↗)
    2comments
  19. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    104comments
  20. OpenJev(openjev.com ↗)
    264comments
  21. Goroutine Leak Profiles(go.dev ↗)
    2comments
  22. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    88comments
  23. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    70comments
  24. Veronese's Dogs(publicdomainreview.org ↗)
    discuss
  25. Minimal Phone 2(minimalcompany.com ↗)
    221comments
  26. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    13comments
  27. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    63comments
  28. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    99comments
  29. Cyclomatic Complexity in C#(ndepend.com ↗)
    19comments
  30. Suppress vulnerabilities applying Kubernetes context to scans(github.com/alegrey91 ↗)
    1comments

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.