frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Farewell

https://github.com/p-e-w/heretic/issues/601
551•nolist_policy•3h ago•241 comments

Audible removes download option for purchased audiobooks

https://consumerrights.wiki/w/Audible_removes_download_option_for_purchased_audiobooks
204•DeepLogin•3h ago•81 comments

Claude Code sabotage: preliminary benchmarking

https://xinyadu.github.io/blog/claude-code-sabotage.html
300•abedelez•4h ago•100 comments

Physics Breakthrough Simulator

https://pages.ethanmdavidson.com/ai-physics-breakthrough
30•machinerychorus•35m ago•2 comments

Show HN: Luciole Mono – terminal font designed for legibility

https://scriptor-pro.github.io/luciole-mono/
64•BaudouinVH•2h ago•28 comments

GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims

https://malspark.com/blog/malicious-gguf-models-hugging-face/
81•homarp•3h ago•28 comments

AI Isn't That Dangerous

https://www.verysane.ai/p/ai-isnt-that-dangerous
25•pretext•45m ago•23 comments

Unkernel: Real Linux kernel, compiled to WebAssembly

https://unkernel.dev
463•nreece•12h ago•122 comments

Diablo II

https://www.filfre.net/2026/11/diablo-ii/
91•doppp•5h ago•31 comments

Loom seamlessly combines weaving, knitting and braiding

https://news.cornell.edu/stories/2026/11/loom-seamlessly-combines-weaving-knitting-and-braiding
217•PaulHoule•3d ago•28 comments

The AI-designed USB-C LTE Modem is built, and it makes calls

https://koppar.ai/blog/lte-modem-bring-up/
20•abijahkaj•1h ago•11 comments

Knuth: Moratorium on Error Reports

https://www-cs-faculty.stanford.edu/~knuth/moratorium.html
274•ultraficial•11h ago•143 comments

IBM MVS 3.8j Community Edition (52-year old OS)

https://github.com/MVS-sysgen/sysgen
17•emersonrsantos•2h ago•2 comments

Google's DeepCrossAttention achieves comparable model quality up to 3x faster

https://research.google/blog/supercharging-transformer-residual-connections/
506•ComputedCamp995•16h ago•176 comments

The Balatro Timeline

https://localthunk.com/blog/balatro-timeline-3aarh
472•sheepscreek•1d ago•140 comments

Why stop at Emacs? Native apps you or an AI reprogram in Clojure while they run

https://github.com/RiccardoSottini/AffrescoUI
13•RiccardoSottini•1h ago•7 comments

GPT 6.2 Astra Solves a Historical Mystery

https://generativehistory.substack.com/p/gpt-62-astra-solves-a-historical
485•dr_red_dog•3d ago•308 comments

Paolo Soleri built a utopian eco-city in the Arizona desert

https://www.worldofinteriors.com/story/paolo-soleri-arconsati-arizona
125•robtherobber•1d ago•38 comments

Credit card skimming scripts using WebRTC found on popular shopping sites

https://www.infohawk.com/news/2026-11-27-black-friday-webrtc-skimmer
568•scanr•23h ago•311 comments

Swapping Jolt's sorted collections to a B+tree

https://yogthos.net/posts/2026-11-23-b+trees.html
16•nefreat•4d ago•3 comments

Skala by Bjango

https://bjango.com/mac/skala/
11•qzervaas•3d ago•2 comments

Sydney Fire Ant Infestation

https://www.abc.net.au/news/2026-11-25/nsw-government-ramps-up-efforts-to-respond-to-fire-ants-/1...
86•altilunium•2d ago•52 comments

Convex skills send the user's app idea to a remote server without telling them

https://github.com/convex/convex-backend-skill/issues/64
343•MickyTheMouse•21h ago•115 comments

Signals

https://www.quarter--mile.com/Signals
41•surprisetalk•2d ago•27 comments

Tabernetes: A Kubernetes cluster whose nodes are browser tabs

https://tabernet.es/
179•mmcclure•16h ago•61 comments

What Is the Metabolism-First Theory for the Origin of Life?

https://www.quantamagazine.org/what-is-the-metabolism-first-theory-for-the-origin-of-life-20261111/
48•ibobev•2d ago•15 comments

Citroën Hydraulic System

https://www.citroenet.org.uk/miscellaneous/hydraulics/hydraulics-1.html
225•o4c•1d ago•74 comments

Show HN: bouncemarket – a live prediction market game for a bouncing ball

https://bouncemarket.minhanhday.com/
396•mday404•1d ago•135 comments

Build your own amp modeler: $78 DIY pedal kit from TONE3000

https://www.guitarworld.com/gear/guitar-pedals/tone3000-daisy-audio-diy-pedal-kit
110•gregsadetsky•3d ago•33 comments

Michael Nielsen took down his book on neural nets

https://neuralnetworksanddeeplearning.com/
614•brandonb•19h ago•437 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.