frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Jailbreaking my car's navigation system just so I can change the time

https://blog.nns.ee/2026/11/02/renault-hack/
167•xx_ns•1d ago•42 comments

Fujifilm to boost tape production 5x as AI fuels archiving demand

https://arstechnica.com/gadgets/2026/10/fujifilm-to-boost-tape-production-5x-as-ai-fuels-archivin...
170•bookofjoe•1d ago•70 comments

Mac at Any Scale

https://namespace.so/blog/mac-at-any-scale
78•anner_•2h ago•22 comments

The 'Astra can read and write weights to improve Qwen' post is misleading

https://honnibal.dev/blog/astra-read-write-misleading
651•syllogism•4h ago•148 comments

Writing seen in PHerc. 306B, for the first time in 2000 years

https://scrollprize.substack.com/p/writing-seen-in-pherc-306b-for-the
54•benbreen•21h ago•3 comments

Ashby (YC W19) Is Hiring EMs

https://www.ashbyhq.com/careers?ashby_jid=695b1ce6-c375-4fad-94ef-61b50a3fbd28&utm_source=hn
1•abhikp•6m ago

Schools that block Google’s A.I. will lose student access to its search engine

https://www.nytimes.com/2026/11/03/us/google-search-schools-restrict-ai.html
118•ceejayoz•1h ago•85 comments

Tiny Basic for Arduino

https://dilshan.github.io/tiny-basic/
22•AlexeyBrin•1h ago•3 comments

Charles Tandy, the mastermind behind Radio Shack

https://dfarq.homeip.net/charles-tandy-the-mastermind-behind-radio-shack/
77•ibobev•4h ago•51 comments

Show HN: HackerChurn – which SaaS tools HN wants to cancel

https://hissingkitty.com/hacker-churn
26•drewlem•1h ago•9 comments

OpenAI seems to be silently re-enabling model training on Codex chats

90•user052919•2h ago•31 comments

Antimony: CAD Software Evolved from Lisp Machines and Not Drafting Tables

https://www.mattkeeter.com/projects/antimony/3/
33•pmkary•1d ago•7 comments

Could a modern chess engine on a Pentium have defeated Kasparov in 1996?

https://nicholas.carlini.com/writing/2026/algorithmic-improvements-chess.html
268•markusw•9h ago•130 comments

Kalshi and its co-founders face felony charges for violating Utah gambling laws

https://arstechnica.com/tech-policy/2026/10/trump-admin-sues-utah-to-save-kalshi-from-the-states-...
65•rbanffy•1h ago•33 comments

Gitbook Breached

10•punchmesan•21m ago•1 comments

Show HN: Interactive notes on RLHF, attention, LoRA and LLM evals

https://concepts.laxmena.com/
19•laxmena•1h ago•2 comments

Bear turns 10, and it still feels like day one

https://blog.bear.app/2026/11/bear-turns-10-and-it-still-feels-like-day-one/
16•psxuaw•1h ago•10 comments

Katamari Damacy but it's The Met collection

https://katamari.vaguespac.es/
112•thebigship•1d ago•34 comments

Study estimates 75% of NFL players who died over 15-year span had CTE

https://www.nbcnews.com/health/health-news/study-estimates-75-nfl-players-died-15-year-span-may-c...
39•gmays•1h ago•16 comments

Handles are the better pointers (2018)

https://floooh.github.io/2018/06/17/handles-vs-pointers.html
14•vinhnx•2h ago•7 comments

Embedding boolean circuits in a neural network

https://edwardbenson.com/2026/10/embedding-boolean-circuits-in-a-neural-network
5•eob•2d ago•0 comments

Quili AI

https://www.quili.ai/
72•Shugyousha•1h ago•40 comments

No brother of mine will play the flute

https://homosabiens.substack.com/p/no-brother-of-mine-will-play-the
24•surprisetalk•1h ago•24 comments

Why Don't We Live in an Art Nouveau World?

https://asteriskmag.com/issues/16/why-don-t-we-life-in-an-art-nouveau-world
54•shcallaway•1d ago•65 comments

DiscImageStudio: burn visible artwork onto CDs, DVDs and Blu-ray discs

https://github.com/JiaFeiMiao-K-Cat/DiscImageStudio
329•bpierre•15h ago•74 comments

Toit v2.0.0

https://toit.io/blog/toit-v2-0-0/
187•floitsch•2d ago•64 comments

Nvidia – open-source auto-ontology

https://github.com/NVIDIA/auto-ontology
235•campervans•10h ago•92 comments

Show HN: Hacker Times, a New York Times-inspired version of Hacker News

https://hackertimes.ca/
429•polpenn•15h ago•131 comments

Tell HN: Please Vote

23•cperciva•1h ago•4 comments

Octomind – open-source AI harness that saves your tokens, static rust

https://github.com/Muvon/octomind
40•donk8r•2h ago•32 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.