frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

MSCI Pressure Mounts on Billionaire-Held Indonesia Shares

https://www.bloomberg.com/news/articles/2026-02-05/billionaire-stranglehold-on-indonesian-shares-...
1•salkahfi•6m ago•0 comments

Show HN: A free model to measure digital-first work performance in 3 minutes

https://www.globalworkinnovationreports.com/
1•nboggian•6m ago•0 comments

Xcode 26 system prompts and internal documentation

https://github.com/artemnovichkov/xcode-26-system-prompts
1•ingve•9m ago•0 comments

Ready for another quick game break? Try HTTPS://szthx.xyz

https://szthx.xyz/
1•TrendSpotterPro•11m ago•0 comments

Show HN: ChatVault – Search your Claude conversations locally with RAG

https://github.com/rajz3006/ChatVault
1•nekrajes•13m ago•0 comments

Show HN: CLI tool to convert Markdown to rich HTML clipboard content

https://github.com/letientai299/md2cb
2•letientai299•14m ago•1 comments

I built Prethub – a collective memory where AI agents share execution experience

https://prethub.com/
1•punyd•14m ago•1 comments

China's population is projected to halve by the end of the century

https://messaging-custom-newsletters.nytimes.com/dynamic/render
2•doener•14m ago•0 comments

Teleporting into the future and robbing yourself of retirement projects

https://ghuntley.com/teleport/
1•ghuntley•14m ago•0 comments

Data Center Demand Story Doesn't Add Up

https://www.bloomberg.com/news/audio/2026-02-02/odd-lots-the-data-center-demand-story-doesn-t-add...
1•zerosizedweasle•19m ago•0 comments

Show HN: Toku.agency – Where AI agents hire each other for real USD

https://www.toku.agency/
1•lilyevesinclair•19m ago•0 comments

Modernizing Linux swapping: introducing the swap table

https://lwn.net/SubscriberLink/1056405/e728d95dd16f5e1b/
2•chmaynard•20m ago•0 comments

OpenClaw 101 – Guide to OpenClaw AI Assistant

https://openclaw101.online
1•EllaAILab•22m ago•0 comments

Braids and Open Book Decompositions [pdf]

https://www2.math.upenn.edu/grad/dissertations/ElenaPavelescuThesis.pdf
1•marysminefnuf•24m ago•0 comments

CIPS Stack – 5 memory systems that give your AI agents persistent memory

https://cipscorps.io/#
1•Opus_Warrior•26m ago•1 comments

Show HN: A system that monitors portfolio risk and warns when it gets dangerous

1•NoahJiang•30m ago•1 comments

Show HN: Outcrop – Contextual Knowledge Base

https://outcrop.app/
1•imedadel•35m ago•0 comments

Show HN: Pipeline and datasets for data-centric AI on real-world floor plans

https://archilyse.standfest.science
1•standfest•36m ago•0 comments

Sequential Attention Making models leaner and fast without sacrificing accuracy

https://research.google/blog/sequential-attention-making-ai-models-leaner-and-faster-without-sacr...
1•binsquare•37m ago•0 comments

My MBA taught me "Lean", but Reality taught me "Survival"

https://www.indiehackers.com/post/my-mba-taught-me-lean-but-reality-taught-me-survival-3-things-b...
1•rosiehong•39m ago•0 comments

Show HN: Mirror private work contributions to your GitHub profile

https://github.com/yuvrajangadsingh/private-work-contributions-mirror
1•yuvrajangads•40m ago•0 comments

Testing CLIs with Scrut

https://cgamesplay.com/post/2026/testing-clis-with-scrut/
1•CGamesPlay•42m ago•0 comments

Slint 1.15 Released

https://slint.dev/blog/slint-1.15-released
1•jandeboevrie•44m ago•0 comments

BMW's Newest "Innovation" Is a Logo-Shaped Middle Finger to Right to Repair

https://www.ifixit.com/News/115528/bmws-newest-innovation-is-a-logo-shaped-middle-finger-to-right...
5•gnabgib•45m ago•0 comments

Show HN: SwiftFiles – 100% private, browser-based file tools (WASM)

https://www.swiftfiles.org
1•deusrazen•45m ago•0 comments

Trillion-Dollar Tech Wipeout Ensnares All Stocks in AI's Path

https://www.bloomberg.com/news/articles/2026-02-04/trillion-dollar-tech-wipeout-ensnares-all-stoc...
2•petethomas•47m ago•0 comments

You can just tell codex to port the codex app to Linux (and it works apparently)

https://old.reddit.com/r/codex/comments/1qw8oat/you_can_just_tell_codex_to_port_the_codex_app_to/
1•AlexCoventry•49m ago•0 comments

A way to get out of debt

https://www.solosuit.com/pages/unifiedflow
2•Simonga25•51m ago•2 comments

Show HN: ValRequest – Turn Feelings into Words

https://valrequest.net
2•QingWu•52m ago•0 comments

Free online Heic to PNG converter

https://heic2png.net
1•windyan•54m ago•0 comments
Open in hackernews

Understanding Java's Asynchronous Journey

https://amritpandey.io/understanding-javas-asynchronous-journey/
17•hardasspunk•8mo ago

Comments

Neywiny•8mo 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•8mo 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•8mo 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•8mo 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•8mo 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•8mo 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•8mo 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();
wpollock•8mo 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.

AtlasBarfed•8mo 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•8mo 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";
  }