Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Cloudflare Quick Tunnels(cloudflare.com ↗)
    177comments
  2. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    24comments
  3. Saving another 100TB of RAM with math (and Rust)(cloudflare.com ↗)
    1comments
  4. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    49comments
  5. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    123comments
  6. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    110comments
  7. OpenJev(openjev.com ↗)
    227comments
  8. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    discuss
  9. Cache-to-Cache: Direct Semantic Communication Between Large Language Models(arxiv.org ↗)
    discuss
  10. Systemd is a suite of basic building blocks(systemd.io ↗)
    32comments
  11. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    131comments
  12. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    3comments
  13. Show HN: Ax-check.com – Can agents use your product?(ax-check.com ↗)
    14comments
  14. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    140comments
  15. Apple releases iPhone Duo simulator and Xcode 27.1 beta(developer.apple.com ↗)
    1comments
  16. Our brain evolved from two primitive nervous systems that merged: Study(newscientist.com ↗)
    11comments
  17. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    189comments
  18. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    4comments
  19. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    84comments
  20. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    5comments
  21. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  22. Minimal Phone 2(minimalcompany.com ↗)
    70comments
  23. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    11comments
  24. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    3comments
  25. How to Write with an LLM(sockpuppet.org ↗)
    204comments
  26. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    4comments
  27. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    9comments
  28. Jemalloc 5.4.0(github.com/jemalloc ↗)
    79comments
  29. I don't like passkeys(hawksley.dev ↗)
    629comments
  30. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    24comments

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?