Hacker News

Subscribe to Hacker News feed
Hacker News RSS
Updated: 3 min 51 sec ago

A Paradigm Shift?

Sat, 04/05/2025 - 11:23pm
Categories: Hacker News

Sonic sound laser, speech jammer [video]

Sat, 04/05/2025 - 10:58pm
Categories: Hacker News

Lightweight threads and channels are better than async/await syntax

Sat, 04/05/2025 - 10:49pm

# The pros of lightweight threads and channels

Lightweight threads don't have the cost of OS threads. You can launch a lot of them cheaply fast. Lightweight threads and OS threads can communicate with each other via channels. Lightweight threads can be freed from OS threads during IO/GPU-bound operations.

If you communicate between (lightweight) threads via channels, you get synchronous coding experience. There is no function color(async color + sync color).

Good examples of this synchronous concurrenct programming model are goroutine, clojure core.async, JVM virtual thread, janet fiber, and so on. Clojure core.async go block state machine doesn't require changes to runtime environment.

# The cons of lightweight threads and channels

Synchronous concurrency has a few trade-offs. I read that the changes required for built-in lightweight threads may make it difficult for other languages to interact with the affected language via FFI(foreign function interface). I suspect this can be overcome with future research?

Errors cannot be propagated outside threads, so you have to take care of errors in threads or pass error values to other threads. Go is famous for not having exceptions. Go only has panics like out-of-memory errors.

# The pros of async/await syntax

Unless you want to poll regularly as you would in C language, async/await syntax doesn't require runtime environment changes that make it difficult for other languages to interact with the affected language via FFI.

However, core.async go blocks are macro-based state machines which don't require changes to runtime environment although macro-based state machines require some care.

# The cons of async/await syntax

Async and await are contagious. Whatever touches async code becomes async.

# My comparison

Handling exceptions in isolated threads and passing error values to other threads is better than contagious async/await syntax. Error handling becomes a bit tedious with (lightweight) threads and channels, but handling exceptions as early as possible in each isolated thread reduces the possibility that unhandled exceptions crash the program.

Comments URL: https://news.ycombinator.com/item?id=43598567

Points: 2

# Comments: 0

Categories: Hacker News

Agent Engineering

Sat, 04/05/2025 - 10:49pm

Article URL: https://www.latent.space/p/agent

Comments URL: https://news.ycombinator.com/item?id=43598566

Points: 2

# Comments: 0

Categories: Hacker News

TripoSG – Text to 3D Model

Sat, 04/05/2025 - 9:56pm
Categories: Hacker News

Ask HN: Best AI IDE right now?

Sat, 04/05/2025 - 9:55pm

I've been using Cursor for the last couple of months but I'm feeling like I might be hitting the limits of Cursor. I'm seeing a lot of forgetting and problems with my codebase getting larger, and it having problems with my mono repo structure.

1. Is there a better AI IDE that remembers when I correct it about structural issues I have with it? 2. Is there an AI IDE that is test-first? helping me see if I break something over time? 3. Any IDEs you recommend me checking out? or tips on fixing cursor?

Comments URL: https://news.ycombinator.com/item?id=43598347

Points: 2

# Comments: 1

Categories: Hacker News

Pages