frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Advent of Code 2026

https://adventofcode.com/2026
404•meffmadd•2h ago•190 comments

Fake Meta Ads Manager apps passed App Store review; two ran as Apple's top ad

https://husseinsaleh.com/2026/12/01/fake-meta-ads-manager-apps-pass-app-store-review-apple-ads/
195•itshusseinsaleh•2h ago•89 comments

Micromorts – visualizing your chances of dying doing everyday activities

https://hugo0.com/micromorts
97•montenegrohugo•2h ago•42 comments

Goals don't work. Rely on your values

https://adam.ci/train/goals-do-not-work/
203•adamci•5h ago•76 comments

Show HN: A GUI for polishing the text your coding agent writes

https://draftmux.raine.dev/
129•rane•4h ago•49 comments

Bob's Company

https://lucumr.pocoo.org/2026/11/28/bob/
381•BerislavLopac•7h ago•210 comments

Roald Dahl's contribution to neurosurgery: the Wade-Dahl-Till shunt

https://pmc.ncbi.nlm.nih.gov/articles/PMC3029661/
49•thunderbong•2d ago•5 comments

Nuclear magnetic resonance on a single atom with a local probe

https://www.nature.com/articles/s41467-026-78801-5
52•Cilan798•1d ago•4 comments

Initial Assessment of Anthropic's Findings on Lattice Cryptography

https://cirg.org/statements/1/
752•nwcs•17h ago•400 comments

Best Buy Putting 4K UHD Discs Back on Store Shelves

https://www.mediaplaynews.com/the-odyssey-was-not-a-one-off-best-buy-putting-4k-uhd-discs-back-on...
596•kartik147•17h ago•448 comments

Baggins End

https://www.bagginsend.net/
54•tosh•4h ago•18 comments

'Big fat lady' hawk who ate too many chickens to fly soars free once again

https://www.cbc.ca/radio/asithappens/hefty-hawk-released-9.7439479
107•randycupertino•2d ago•35 comments

Cloudflare Clairic System One Extraction Models Are Now Open-Weight

https://blog.cloudflare.com/open-clairic/
248•reddmachine•13h ago•49 comments

Red heads are linked to a mutation that makes them resistant to anesthesia (2024)

https://health.clevelandclinic.org/why-do-redheads-need-more-anesthesia
264•illidan1000•15h ago•157 comments

Squashfs: Fix a lot of AI issues and AI style issues

https://lkml.iu.edu/hypermail/linux/kernel/2611.2/22806.html
186•gpi•4h ago•137 comments

Adhesive coatings in naval archaeology: Materials from Roman Republican wreck

https://www.frontiersin.org/journals/materials/articles/10.3389/fmats.2026.1758862/full
24•bookofjoe•2d ago•0 comments

CrowdGPT – A Collaboratively Trained AI

https://www.crowdgpt.net/
551•Vxtzq•20h ago•209 comments

The Exponential Rise of Agent Instruction Files

https://homes.cs.washington.edu/~reshabh/posts/exponential-rise-of-agent-instruction-files.html
56•reshabh•2d ago•36 comments

Galactic quasi-polynomial quantum algorithms for integral and module lattices [pdf]

https://github.com/anthropics/formal-math/blob/main/lattices/papers/01-quasi-polynomial-quantum-a...
298•Skrillor•17h ago•155 comments

Hetzner Inference API

https://www.hetzner.com/ai/inference-api/
418•PaoloBarbolini•7h ago•141 comments

Advent of Puzzles – An advent calendar with 25 logic puzzles

https://adventofpuzzles.io/
327•ruslan5t•16h ago•75 comments

Usb2shell: Root on Linux from a USB Plug-In

https://usb2shell.com/
336•matanyall•18h ago•149 comments

Finding and fixing Android memory leaks with Perfetto, SQL, and AI agents

https://perfetto.dev/blog/hunting-android-memory-leaks
10•lalitmaganti•1d ago•1 comments

Satmux: 3.6x faster inflight Wi-Fi via BBR TCP multiplexing

https://github.com/Th0rgal/satmux
151•joshcsimmons•2d ago•27 comments

Writing a paper is no longer a signal

https://lemire.me/blog/2026/11/30/writing-a-paper-is-no-longer-a-signal/
349•zdw•18h ago•273 comments

Homomorphic encrypted Llama 3.1 8B at 1.7 tokens per second

https://bel.belfortlabs.com/
242•solyin•17h ago•93 comments

Post-quantum cryptography is still safe

https://blog.cloudflare.com/pq-is-still-safe/
199•soheilpro•14h ago•35 comments

Show HN: GoModel – an open-source AI gateway – LiteLLM alternative

https://gomodel.enterpilot.io/
5•santiago-pl•1h ago•1 comments

Reading unreadable tapes: A universal reader for mini QIC cartridges

https://dmitrybrant.com/2026/11/28/mini-qic-universal-reader
54•zdw•2d ago•6 comments

Why is the keyboard and telephone numbers in a different order? (2020)

https://retrocomputing.stackexchange.com/questions/15611
136•Skyfall106•15h ago•50 comments
Open in hackernews

Understanding Java's Asynchronous Journey

https://amritpandey.io/understanding-javas-asynchronous-journey/
17•hardasspunk•1y ago

Comments

Neywiny•1y ago
I don't get it. The first example in JS vs Java looks very similar. Now all those other code blocks, they certainly have more going on but idk how that compares to JS. And to answer the questions:

A completable future is something that in the future may complete. I think that's self explanatory. A promise seems equally vague.

Boilerplate looks the same. JS is just a function, Java they put a class around it. Java requires exception handling which is annoying but having fought errors in async JS, I'll take all I can get.

API is eh. Sure. But that's not even shown in this example so I have no idea.

So JS saves like 3 lines? Is that really so much better?

cogman10•1y ago
> A completable future is something that in the future may complete. I think that's self explanatory.

But not the reason for the name :).

It's called "completable" because these futures have a method on them `future.complete("value")`. Before their introduction, there was a `Future` API that java had.

nogridbag•1y ago
Yeah that first example is rather poor. And it uses the word boilerpate to seemingly refer to the stuff unrelated to the async code (class declaration, exception handling, main method).

I don't use Java async much, but I guess if you have a utility method named "setTimeout" than the example can simply be:

    public CompletableFuture<String> fetchData() {
        return setTimeout(() -> "Data Fetched", 10000);
    }

    public void loadData() {
        fetchData().thenAccept(System.out::println);
    }
Which is simpler or equivalent to the JS example.
stevoski•1y ago
The Java 1 example uses lambdas, which were introduced in Java 8.

It’s probably intentional, because it allows showing the Java 1 Thread approach succinctly.

But as long-term Java person, I find it jarring.

philipwhiuk•1y ago
Java's had `var` since Java 10 but apparently the author deliberately ignored that to make the example as wordy as possible.

It's a little tiring to read a Java example with an entry-point (the public-static-void bit) and then a JavaScript example without one.

If you strip that out the original Java is:

  var future = CompletableFuture.supplyAsync(() -> {
        try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            return "Data Fetched";
        });
  future.thenAccept(result -> System.out.println(result));
  System.out.println("Prints first"); // prints before the async result
which is only obtuse due to checked exceptions.

Arguably it's still a different thing you're doing, because it's not scheduling a task on a pool, it's creating a thread which sleeps for 10 seconds.

elric•1y ago
`var` is very unhelpful in situations where the reader might not be entirely familiar with the context, especially when using factory methods.

I don't think the author was trying to make the example "wordy" so much as "clear".

cogman10•1y ago
Also, arguably, the wrong way to do something like this.

The author uses `setTimeout` for javascript. The equivalent for Java is either the `Timer` class or a `ScheduledExecutorService`. Doing a `Thread.sleep` simply isn't how you should approach this.

With that in mind, if you want to use both these things and keep the completable future interface you'd have to do soemthing like this.

    ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    var future = new CompletableFuture<String>();
    scheduler.schedule(()->future.complete("Data Fetched"), 10, TimeUnit.SECONDS);
    future.thenAccept(result -> System.out.println(result));
    System.out.println("Prints first"); // prints before the async result
    scheduler.shutdown();
AtlasBarfed•1y ago
Does no.js still limit you to a single core/CPU use?

Or as a node successfully been able to start utilizing more cores underneath its JavaScript single thread model. It presents the programmer?

I just remember early node.js from like 15 years ago and the single background task limitation of JavaScript running in a web page.

Cuz you got async code is nice, but what you really wanted to be able to harness in modern CPUs is multi-core

That said, I've been looking for an article like this for a while, although I think there are other associated libraries that also had steps in here. I do think the jvm adopted a lot of those, but I'm not sure if they actually are better than the original extension libraries.

msgilligan•1y ago
I simplified the first example to:

  void main() {
      CompletableFuture<String> future = CompletableFuture.supplyAsync(this::asyncMethod);
      future.thenAccept(result -> IO.println(result));
      IO.println("Prints first");             // prints before the async result
      future.join();                          // Wait for future to complete
  }

  String asyncMethod() {
      try {
          Thread.sleep(10000);
      } catch (InterruptedException e) {
          return "Interrupted";
      }
      return "Data Fetched";
  }
I made the following changes:

1. Move the asynchronous function called in the CompletableFuture to its own method

2. Use Java 25 "instance main method" (see JEP 25: https://openjdk.org/jeps/512)

3. Use Java 25 IO.println() to simplify console output

4. Instead of throwing a fatal exception on interruption, return "Interrupted" immediately.

5. Use future.join() so the main method waits for the future to complete and the "Data fetched" output is printed.

This program can be run directly from source with `java Example.java`. (If you're using Java 24 or a version of Java 25 prior to EA 22, you need to use `java --enable-preview Example.java`)

Here is a modified version of the example that interrupts the thread:

  void main() {
      ExecutorService executor = Executors.newSingleThreadExecutor();
      CompletableFuture<String> future = CompletableFuture.supplyAsync(this::asyncMethod, executor);
      future.thenAccept(result -> IO.println(result));
      IO.println("Prints first");             // prints before the async result
      executor.shutdownNow();
      future.join();                          // Wait for future to complete
  }

  String asyncMethod() {
      try {
          Thread.sleep(10000);
      } catch (InterruptedException e) {
          return "Interrrupted";
      }
      return "Data Fetched";
  }
wpollock•1y ago
In Java 24, new features support educational and demonstration use. You don't need a class to wrap your main method, which also has a simpler signature. To compare JavaScript with Java examples, one should make use of these features.

While the examples may need some work, I enjoyed this post, it nicely shows the evolution of Java concurrency.