frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Nvidia announces native GPU programming in Rust

https://developer.nvidia.com/blog/introducing-cuda-rust-two-tracks-for-writing-gpu-kernels/
412•nonmaskable•16h ago•153 comments

Keys Not Included: recovering the signing keys for US driver's license barcodes

https://ryan.science/blog/keys-not-included
25•Ryan5453•55m ago•4 comments

Training a 4B model to produce 81% faster query plans than Postgres

https://rohanbansal.com/qorl
443•polyphilz•9h ago•91 comments

Xiaomi Mimo 2.6 live post-training dashboard

https://mimo.xiaomi.com/rl/
313•krackers•7h ago•83 comments

DeepSeek-v4.1 Flash: Pushing the Limits of KV Cache Compression

https://zartbot.github.io/blog/model_arch/dsv41flash_arch/en.html
46•mfiguiere•2h ago•5 comments

Breaking the 1.58-bit Barrier for Ternary LLMs

https://arxiv.org/abs/2609.16338
156•matt_d•6h ago•21 comments

Backups Aren't Simple

https://filipovski.net/2026/09/16/backups-arent-simple.html
122•afilipovski•7h ago•57 comments

Small programming tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
429•signa11•12h ago•196 comments

Developing provably correct Rust code with Verus

https://www.amazon.science/blog/developing-provably-correct-rust-code-with-verus
49•Betelbuddy•2d ago•4 comments

The engineering behind the US Strategic Petroleum Reserve

https://johnjwang.com/post/2026/09/15/engineering-behind-us-strategic-petroleum-reserve
141•johnjwang•1d ago•53 comments

OpenSpec – A lightweight and configurable AI spec framework

https://openspec.dev/
93•etoxin•4h ago•37 comments

The Return of Sail Power: Cargo Ships Are Turning Back to the Wind

https://gcaptain.com/the-return-of-sail-power-cargo-ships-are-turning-back-to-the-wind/
34•gumby•3h ago•14 comments

Performance Improvements in .NET 11

https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-11/
211•soheilpro•1d ago•38 comments

Reversing Factorio's RNG

https://gegell.github.io/posts/factorio-rng/
161•jheitmann•4d ago•20 comments

A 32-Year-Old Bug Walks into a Telnet Server

https://labs.watchtowr.com/a-32-year-old-bug-walks-into-a-telnet-server-gnu-inetutils-telnetd-cve...
6•paimapi•1d ago•0 comments

Part-human part-mouse brain developed in science breakthrough

https://www.bbc.com/news/articles/c60m3k28j81mo
9•marc__1•2h ago•6 comments

HarnessTax: How Much Does the Harness Matter for Coding Agents?

https://harnesstax.github.io/
63•matt_d•5h ago•18 comments

Japan's book scene is moving from bookstores to libraries

https://untranslatedjp.substack.com/p/japans-book-scene-is-quietly-moving
138•herbertl•4d ago•53 comments

Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations

https://github.com/arnegiacomo/fugleramme
2110•arnemunthekaas•1d ago•240 comments

Pangram – AI detector for text and images

https://www.pangram.com
16•doodlesdev•2h ago•9 comments

AWS says it can't restore some data from mideast facilities struck by Iran

https://www.wsj.com/world/middle-east/aws-says-it-cant-restore-some-data-from-mideast-facilities-...
270•berkeleyjunk•1d ago•234 comments

Mapsnap: Automated Georeferencing for Historic Sanborn Insurance Maps

https://www.danvk.org/2026/09/10/mapsnap.html
8•evakhoury•1d ago•1 comments

Anecdotally, programmers dislike "reduce"

https://evanhahn.com/posts/2026-09-13-programmers-dislike-reduce/
111•vinhnx•2d ago•174 comments

Reverse-engineered Jev-like model

https://github.com/vinnylarouge/jevlike
93•rochansinha•9h ago•14 comments

Why Does the Universe Expand?

https://cosmicave.org/2026/09/15/why-does-the-universe-expand/
45•the__alchemist•8h ago•28 comments

Dream-RSI: Recursive Self-Improvement through Evolving Worlds

https://arxiv.org/abs/2609.14858
187•bananaflag•14h ago•49 comments

Anatomy of a Texture

https://agentlien.github.io/texture/
80•Agentlien•13h ago•14 comments

Monsanto's Cruel, and Dangerous, Monopolization on American Farming (2008)

https://www.vanityfair.com/news/2008/05/monsanto200805
16•kamaraju•1h ago•2 comments

The DeepMind Institute

https://institute.deepmind.com/
156•vertigoruntime•13h ago•52 comments

Hackers Got Inside a Flock Camera

https://www.wired.com/story/hackers-flock-camera-data-shows-how-system-works/
492•driverdan•14h ago•229 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.