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 ↗)
    58comments
  2. Cloudflare Quick Tunnels(cloudflare.com ↗)
    190comments
  3. Apple releases iPhone Duo simulator and Xcode 27.1 beta(developer.apple.com ↗)
    14comments
  4. Saving another 100TB of RAM with math (and Rust)(cloudflare.com ↗)
    7comments
  5. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    33comments
  6. Cache-to-Cache: Direct Semantic Communication Between Large Language Models(arxiv.org ↗)
    3comments
  7. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    57comments
  8. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    6comments
  9. OpenJev(openjev.com ↗)
    231comments
  10. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    137comments
  11. Korea raises data breach fines to 10% of revenue(koreajoongangdaily.com ↗)
    discuss
  12. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    123comments
  13. Our brain evolved from two primitive nervous systems that merged: Study(newscientist.com ↗)
    30comments
  14. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    155comments
  15. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    13comments
  16. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    55comments
  17. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    193comments
  18. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    83comments
  19. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    192comments
  20. Show HN: Ax-check.com – Can agents use your product?(ax-check.com ↗)
    21comments
  21. "From Geometry to Algebra and Back Again: 4000 Years of Papers" by Jack Rusher [video](youtube.com ↗)
    discuss
  22. Minimal Phone 2(minimalcompany.com ↗)
    93comments
  23. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  24. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    10comments
  25. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    6comments
  26. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    6comments
  27. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    12comments
  28. How to Write with an LLM(sockpuppet.org ↗)
    211comments
  29. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    13comments
  30. Jemalloc 5.4.0(github.com/jemalloc ↗)
    82comments

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?