frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Not Cool

https://placesjournal.org/article/not-cool-paris-heatwave-climate-sustainability/
1•littlexsparkee•3m ago•0 comments

Pangram Has Emerged as the Gold Standard of AI Detection. Should You Trust It?

https://www.wired.com/story/pangram-has-emerged-as-the-gold-standard-of-ai-detection/
1•bko•6m ago•0 comments

Mammut vs. Arc'terx – Brand Comparisons

https://www.lydiascapes.com/mammut-vs-arcteryx-brand-comparison/
1•Cider9986•8m ago•0 comments

Simple Is Not Small

https://jyn.dev/simple-is-not-the-same-as-small/
1•zdw•10m ago•0 comments

Navigating Code Reviews as a Code Author [video]

https://www.youtube.com/watch?v=zygtgvHp_MM
1•BiraIgnacio•11m ago•0 comments

Stop obsessing about the goddamn robot

https://despairlabs.com/blog/posts/2026-09-03-stop-obsessing-about-the-robot/
2•zdw•15m ago•0 comments

Tell HN: The Thoughts and Woes of a Full-Time Founder Part 1

2•lcampbellsoup•15m ago•0 comments

Ant Group open-sources LingBot-Vision for dense spatial perception

https://github.com/Robbyant/lingbot-vision
1•fourfire•16m ago•0 comments

Balance of Power Geopolitics in the Nuclear Age (1985)

https://archive.org/details/msdos_Balance_of_Power_1985
1•Levitating•19m ago•0 comments

The Death of Educational Content on YouTube [video]

https://www.youtube.com/watch?v=-Gnrp_caPvo
4•jahnu•20m ago•0 comments

Microsoft to impose time limits on Xbox cloud gaming subscribers

https://www.cnbc.com/2026/09/03/microsoft-xbox-game-pass-cloud-limits.html
1•bluedino•21m ago•0 comments

Hugging Face is too important to fall into Nvidia's hands

https://www.theregister.com/ai-and-ml/2026/09/03/hugging-face-is-too-important-to-fall-into-nvidi...
5•mdp2021•24m ago•2 comments

18 Ways You Can Use a Domain Name

https://www.developeddomains.com/strategies/
1•bhartzer•30m ago•0 comments

Nvidia Personal AI Router (Pair)

https://www.nvidia.com/en-us/ai-on-rtx/personal-ai-router/
3•BiraIgnacio•30m ago•0 comments

Show HN: Photosynthesis – iPhone app captures from 2 lenses, stitches to 1 photo

https://apps.apple.com/us/app/photosynthesis-2-lens-camera/id6780102370
1•sajomes•30m ago•0 comments

Hanzi Writer: JavaScript library for Chinese stroke order animations and quizzes

https://hanziwriter.org/
1•rahimnathwani•31m ago•0 comments

56k.rip – the 1996 dial-up internet experience

https://56k.rip/
2•thunderbong•32m ago•0 comments

The Multiplayer AI Manifesto

https://multiplayer-ai.com/
4•ibrahima•34m ago•0 comments

Show HN: Chrome tab group cleaner for Claude Code created tab groups

https://github.com/franzenzenhofer/chrome-tab-group-cleaner
1•franze•42m ago•0 comments

NYC mayor Mamdani imposes 1 year ban on AI for schools through 8th grade

https://www.nyc.gov/mayors-office/news/2026/09/mayor-mamdani-and-chancellor-samuels-put-students-...
15•DeepLogin•43m ago•5 comments

GTP-6 Astra

https://www.youtube.com/watch?v=1QNsdr-Qx_I
2•htk•46m ago•0 comments

Show HN: If I had to design a nuclear fusion power plant(Idea Sketch)

https://github.com/PJHkorea/discrete-filament-router
2•PJHkorea•46m ago•0 comments

4K Analog Video Feedback Device

https://www.youtube.com/watch?v=koDCabeh5kQ
1•CharlesW•46m ago•0 comments

macOS 27 Simulator by OpenAI Astra

https://macos-27-simulator.mweinbach.chatgpt.site/
2•tristanj•47m ago•2 comments

Coder's registry infrastructure compromised to push malicious modules

https://www.bleepingcomputer.com/news/security/coders-registry-infrastructure-compromised-to-push...
2•sbulaev•50m ago•0 comments

(George) Lucas Museum of Narrative Arts

https://lucasmuseum.org
3•rawgabbit•50m ago•0 comments

Star Trek S01e20 "Court Marshall"

https://en.wikipedia.org/wiki/Court_Martial_(Star_Trek:_The_Original_Series)
2•Jimmc414•52m ago•0 comments

Protecting Engineers' Skills in the AI Era

https://spectrum.ieee.org/ai-engineer-skills
20•rbanffy•57m ago•12 comments

There are many agent harnesses, but this one is mine

https://earendil.com/posts/there-are-many-agent-harnesses-but-this-one-is-mine/
1•zdw•1h ago•0 comments

Anxious or outgoing? Study links Big Five personality traits to genetic variants

https://www.nature.com/articles/d41586-026-02761-5
2•geneticdrifts•1h ago•0 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.