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 ↗)
    300comments
  2. Science Is Open Software(jepedersen.dk ↗)
    9comments
  3. SDCC – Small Device C Compiler(sourceforge.net ↗)
    2comments
  4. Cloudflare Quick Tunnels(cloudflare.com ↗)
    259comments
  5. Saving another 100TB of RAM(cloudflare.com ↗)
    55comments
  6. How to Write with an LLM(sockpuppet.org ↗)
    289comments
  7. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    73comments
  8. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    7comments
  9. The Farnese letter(simonklee.dk ↗)
    5comments
  10. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    60comments
  11. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    78comments
  12. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    72comments
  13. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    62comments
  14. OpenJev(openjev.com ↗)
    249comments
  15. Goroutine Leak Profiles(go.dev ↗)
    discuss
  16. Show HN: LiveWorld – Every 24/7 YouTube live camera on one globe(liveworld.info ↗)
    22comments
  17. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    12comments
  18. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    198comments
  19. Cyclomatic Complexity in C#(ndepend.com ↗)
    15comments
  20. Minimal Phone 2(minimalcompany.com ↗)
    194comments
  21. LispBM is a concurrent Lisp for microcontrollers with message passing(lispbm.com ↗)
    1comments
  22. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    35comments
  23. Gemini hacked three companies in first known breakout by Google's AI(reuters.com ↗)
    24comments
  24. Alibaba open-sources AI model that can detect cancer and nearly 150 conditions(scmp.com ↗)
    7comments
  25. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    94comments
  26. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    49comments
  27. Two parallel neural ectoderm progenitors contribute to the developing brain(newscientist.com ↗)
    60comments
  28. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    20comments
  29. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    210comments
  30. Size-Specialized Memory Allocation(go.dev ↗)
    3comments

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.