frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

"AI is as big a deal as the internet or mobile–and only as big." Benedict Evans [video]

https://www.youtube.com/watch?v=BD3vLtWhT5A
1•nilen•1m ago•0 comments

The SpaceX IPO is great for Elon Musk and terrible for you

https://www.theverge.com/ai-artificial-intelligence/940001/elon-musk-spacex-ipo-ai
1•_tk_•1m ago•0 comments

Git-courer – A complete, JSON-first Git layer for LLM agents

https://github.com/Alejandro-M-P/git-courer
1•blakok14•2m ago•0 comments

Noroboto and the PDF that lied twice

https://www.legalquants.com/blog/noroboto-and-the-pdf-that-lied-twice
1•AlexiosvdSK•2m ago•0 comments

Don't manage your AWS ECS deployments with IaC

https://newsletter.masterpoint.io/p/deploying-your-apps-into-ecs
1•mooreds•3m ago•0 comments

United flight to Spain returns to Newark after Bluetooth security concern

https://www.aerotime.aero/articles/united-flight-newark-bluetooth-security-concern
1•SVI•4m ago•0 comments

Quantized

https://nicoadamo.com/quantized/
1•spectralseq•5m ago•0 comments

Sergey Brin told Google staff that working 60 hours a week is the 'sweet spot'

https://fortune.com/article/sergey-brin-60-hour-work-week-ai-rto/
3•randycupertino•7m ago•1 comments

A practical guide for llms.txt so agents can read your site

https://docsalot.dev/blog/what-is-llms-txt
1•fazkan•7m ago•0 comments

GrillKit – Self-hosted AI trainer for technical interviews with voice

https://github.com/GrillKit/grillkit
1•vitchenkokir•7m ago•0 comments

Check Startup Names for Availability

https://nameclaim.xyz
2•chaghighat•11m ago•0 comments

Learn SQL Once, Use It for 30 Years

https://fagnerbrack.com/learn-sql-once-use-it-for-30-years-9aceb0bdee03
2•karakoram•13m ago•0 comments

Show HN: NowServingTO – Zero-DB restaurant directory using city open data

https://nowservingto.com/
1•Joshua_Opolko•13m ago•0 comments

DDS Vibe Academy – 49 free AI coding classes (12 new masterclasses this week)

https://ddsboston.com/pages/dds-vibe-academy
2•robert_dds•14m ago•0 comments

Story Points: Explicit, Honest, Predictable. Already In Use.

https://bastrich.tech/story-points/
1•karakoram•14m ago•0 comments

They call it stupid hot for a reason: Heat muddles animal brains

https://arstechnica.com/science/2026/05/they-call-it-stupid-hot-for-a-reason-heat-muddles-animal-...
1•Qadriq•14m ago•1 comments

I built a free cross platform music/podcast/audiobook sharing app iOS/Android

https://mtshare.net
1•macsmax•19m ago•1 comments

AI guardrails stripped from Meta and Google models in minutes

https://www.ft.com/content/5630ed79-a263-41ed-9a1a-321617ae310e
1•bookofjoe•20m ago•1 comments

Disagreeing with Google, Postgres, Future Problems – Mike Stonebraker

https://www.youtube.com/watch?v=YPObBOwIrHk
2•tux1968•20m ago•0 comments

The Biggest Problem in Investing (By Ben Felix) [video]

https://www.youtube.com/watch?v=of9_wpOhGWw
2•Imustaskforhelp•20m ago•0 comments

Deflock hits 100k ALPRs Mapped in USA

https://deflock.org/
7•pilingual•25m ago•2 comments

Why AI safety researchers should consider a contract research manager position

https://www.lesswrong.com/posts/MjFArZa85KydKdivh/why-ai-safety-researchers-should-consider-a-con...
3•joozio•25m ago•0 comments

OpenJarvis: Personal AI, on Personal Devices

https://github.com/open-jarvis/OpenJarvis
3•simonpure•26m ago•0 comments

Meta launches Instagram, Facebook, and WhatsApp subscriptions

https://techcrunch.com/2026/05/27/meta-officially-launches-instagram-facebook-and-whatsapp-subscr...
11•tambourine_man•26m ago•2 comments

Cancer Progress: More Than You Wanted to Know (2018)

https://slatestarcodex.com/2018/08/01/cancer-progress-much-more-than-you-wanted-to-know/
1•downbad_•28m ago•0 comments

Polyhedral Compilation in MLIR

https://sajidzubair.substack.com/p/polyhedral-compilation-in-mlir
1•matt_d•29m ago•0 comments

Viking Lander Biological Experiments

https://en.wikipedia.org/wiki/Viking_lander_biological_experiments
1•root-parent•32m ago•0 comments

Fibbo: A modern, fast and universal note-taking app running on every device

https://codeberg.org/Nifou/fibbo
1•maxloh•32m ago•0 comments

Turning AI chatbot pages into malware delivery platforms

https://pushsecurity.com/blog/llmshare-malvertising-campaign
1•redbell•35m ago•0 comments

United flight forced to turn around because of a Bluetooth speaker name

https://www.theverge.com/transportation/940486/united-flight-236-bluetooth-speaker-name-bomb
2•droidjj•36m ago•1 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.