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 ↗)
    109comments
  2. Cloudflare Quick Tunnels(cloudflare.com ↗)
    197comments
  3. Saving another 100TB of RAM(cloudflare.com ↗)
    15comments
  4. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    41comments
  5. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    8comments
  6. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    36comments
  7. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    63comments
  8. How to Write with an LLM(sockpuppet.org ↗)
    217comments
  9. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    12comments
  10. OpenJev(openjev.com ↗)
    234comments
  11. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    2comments
  12. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    143comments
  13. Korea raises data breach fines to 10% of revenue(koreajoongangdaily.com ↗)
    40comments
  14. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    20comments
  15. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    82comments
  16. Our brain evolved from two primitive nervous systems that merged: Study(newscientist.com ↗)
    41comments
  17. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    167comments
  18. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    14comments
  19. From Geometry to Algebra and Back Again: 4000 Years of Papers (2023) [video](youtube.com ↗)
    discuss
  20. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    10comments
  21. Minimal Phone 2(minimalcompany.com ↗)
    115comments
  22. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    85comments
  23. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    138comments
  24. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  25. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    8comments
  26. Show HN: Ax-check.com – Can agents use your product?(ax-check.com ↗)
    23comments
  27. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    235comments
  28. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    15comments
  29. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    16comments
  30. The scourge of x86 emulation(fex-emu.com ↗)
    74comments

Morph C++ into Javascript

71 pointsby 15y agoblog.vjeux.com
13 comments
15y agoHN ↗

I don't see closures. That's one of the most powerful aspects of Javascript.

15y agoHN ↗

Good luck, last time I tried nested lambdas in VC10 they weren't able to capture local variables from any context except the immediate outer context.

This makes doing something like e.g. map(map(...)) extremely annoying.

Javascript (nor does, really, any other proper closure implementation) has no such issues.

15y agoHN ↗

I started developing with Visual Studio but their C++0x implementation is far from complete.

Indeed, the following easy code ( http://pastebin.com/bjFWBrJq ) does not compile under Visual Studio: "function returning function is not allowed"

It works fine in g++ though.

15y agoHN ↗

That's fantastic! I might finally be idly productive in C++ as I am in javascript.

In javascript, I find that you can just write code, while in C++ I feel that I need to plan out every design choice, need to protect against everything. While that's a good thing when writing production code, in certain situations (writing up proof-of-concept projects for example) it's just not what I want. I love that in javascript, half the time I don't need to give a crap - it just works.

Hopefully, as a side-effect of this project, I'll be able to do what I do in C++ as I do in Javascript - although in the long run that probably isn't a good thing. ;)

15y agoHN ↗

Now all we need is a gratuitous regular expression to get rid of the extra bits of syntax...

15y agoHN ↗

I'd rather be able to go the other way. js->c++. But that would be much harder, I think.

15y agoHN ↗

If C++0x is much closer to javascript CoffeScript to C++ is possible.

15y agoHN ↗

Why haven't I seen this blog before? Loads of interesting stuff....

I'll definitely be trying this out. Utterly awesome idea.

15y agoHN ↗

There was mention of a performance overhead of _ as a suggestion as to how to improve... How does JSPP, in its current state, compare with V8 execution speed?