frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Chemical process produces critical battery metals with no waste

https://spectrum.ieee.org/nmc-battery-aspiring-materials
39•stubish•2h ago•3 comments

Fast and cheap bulk storage: using LVM to cache HDDs on SSDs

https://quantum5.ca/2025/05/11/fast-cheap-bulk-storage-using-lvm-to-cache-hdds-on-ssds/
47•todsacerdoti•3h ago•11 comments

Smallest particulate matter sensor revolutionizes air quality measurement

https://www.bosch-sensortec.com/news/worlds-smallest-particulate-matter-sensor-bmv080.html
26•Liftyee•3h ago•3 comments

A low power 1U Raspberry Pi cluster server for inexpensive colocation

https://github.com/pawl/raspberry-pi-1u-server
16•LorenDB•3d ago•6 comments

Resizable structs in Zig

https://tristanpemble.com/resizable-structs-in-zig/
108•rvrb•9h ago•48 comments

Show HN: QuickTunes: Apple Music player for Mac with iPod vibes

https://furnacecreek.org/quicktunes/
70•albertru90•7h ago•18 comments

How we rooted Copilot

https://research.eye.security/how-we-rooted-copilot/
289•uponasmile•14h ago•110 comments

Purple Earth hypothesis

https://en.wikipedia.org/wiki/Purple_Earth_hypothesis
211•colinprince•3d ago•58 comments

Low cost mmWave 60GHz radar sensor for advanced sensing

https://www.infineon.com/part/BGT60TR13C
56•teleforce•3d ago•22 comments

Personal aviation is about to get interesting (2023)

https://www.elidourado.com/p/personal-aviation
81•JumpCrisscross•7h ago•80 comments

16colo.rs: ANSI/ASCII art archive

https://16colo.rs/
20•debo_•3d ago•4 comments

Rust running on every GPU

https://rust-gpu.github.io/blog/2025/07/25/rust-on-every-gpu/
520•littlestymaar•20h ago•176 comments

Paul Dirac and the religion of mathematical beauty (2011) [video]

https://www.youtube.com/watch?v=jPwo1XsKKXg
55•magnifique•8h ago•4 comments

Coronary artery calcium testing can reveal plaque in arteries, but is underused

https://www.nytimes.com/2025/07/26/health/coronary-artery-calcium-heart.html
65•brandonb•8h ago•57 comments

What went wrong for Yahoo

https://dfarq.homeip.net/what-went-wrong-for-yahoo/
155•giuliomagnifico•12h ago•146 comments

Getting decent error reports in Bash when you're using 'set -e'

https://utcc.utoronto.ca/~cks/space/blog/programming/BashGoodSetEReports
100•zdw•3d ago•30 comments

The natural diamond industry is getting rocked. Thank the lab-grown variety

https://www.cbc.ca/news/business/lab-grown-diamonds-1.7592336
182•geox•18h ago•221 comments

Teach Yourself Programming in Ten Years (1998)

https://norvig.com/21-days.html
70•smartmic•9h ago•24 comments

Torqued Accelerator Using Radiation from the Sun (Tars) for Interstellar Payload

https://arxiv.org/abs/2507.17615
47•virgildotcodes•8h ago•4 comments

Tinyio: A tiny (~200 line) event loop for Python

https://github.com/patrick-kidger/tinyio
66•tehnub•4d ago•14 comments

Where are vacation homes located in the US?

https://www.construction-physics.com/p/where-are-vacation-homes-located
86•rufus_foreman•12h ago•69 comments

Arvo Pärt at 90

https://www.theguardian.com/music/2025/jul/24/the-god-of-small-things-celebrating-arvo-part-at-90
65•merrier•9h ago•19 comments

Shallow water is dangerous too

https://www.jefftk.com/p/shallow-water-is-dangerous-too
108•surprisetalk•3d ago•63 comments

Janet: Lightweight, Expressive, Modern Lisp

https://janet-lang.org
17•veqq•5h ago•1 comments

Test Results for AMD Zen 5

https://www.agner.org/forum/viewtopic.php?t=287&start=10
220•matt_d•11h ago•42 comments

Large ancient Hawaiian petroglyphs uncovered by waves on Oahu

https://www.sfgate.com/hawaii/article/hawaii-petroglyphs-uncovered-20780579.php
79•c420•4d ago•23 comments

Asyncio: A library with too many sharp corners

https://sailor.li/asyncio
84•chubot•7h ago•67 comments

Millet mystery: A staple crop failed to take root in ancient Japanese kitchens

https://phys.org/news/2025-07-millet-mystery-staple-crop-root.html
25•PaulHoule•3d ago•9 comments

Open Sauce is a confoundingly brilliant Bay Area event

https://www.jeffgeerling.com/blog/2025/open-sauce-confoundingly-brilliant-bay-area-event
328•rbanffy•3d ago•186 comments

Font-size-adjust Is Useful

https://matklad.github.io/2025/07/16/font-size-adjust.html
163•Bogdanp•3d ago•51 comments
Open in hackernews

Tinyio: A tiny (~200 line) event loop for Python

https://github.com/patrick-kidger/tinyio
66•tehnub•4d ago

Comments

codethief•8h ago
> Somewhat unusually, our syntax uses yield rather than await, but the behaviour is the same. Await another coroutine with yield coro. Await on multiple with yield [coro1, coro2, ...] (a 'gather' in asyncio terminology; a 'nursery' in trio terminology).

Why, though?

dmerrick•7h ago
> The reason is that await does not offer a suspension point to an event loop (it just calls `__await__` and maybe that offers a suspension point), so if we wanted to use that syntax then we'd need to replace `yield coro` with something like await `tinyio.Task(coro)`. The traditional syntax is not worth the extra class.
halfcat•7h ago
From the readme:

> ”Ever used asyncio and wished you hadn't?”

Yes, that’s me. I always found the yield-based approach to coroutines much easier to reason about. It’s just a generator function.

patrickkidger•7h ago
Oh neat! This is my library. Happy to answer any questions.

(Though it's really a pretty tiny library that just does what it says on the tin, not sure how many questions there can be. :D )

b33j0r•1h ago
I have a question. Why do you prefix your package files with an underscore?

In fact, you write all of your python like you really have something to hide ;) Like `_Todo`.

Where did you get this pattern?

(I’m way more curious than accusatory. Are people embracing private modules these days as a convention, and I just missed it?)

deathanatos•19m ago
I think _private has always been a convention in Python, though I'd say most Python is not so rigorous about it. I don't see why it couldn't be applied to modules.

I honestly love when I see a package do stuff like this: it's very clear then what is public interface, and I should consider usable (without sin) and what is supposed to be an internal detail.

Same with the modules: then it is very clear that the re-export of those names in __init__.py is where they're meant to be consumed, and the other modules are just for organizational purposes, not API purposes.

_Todo is then a private type.

Very clean.

moreati•7h ago
In https://github.com/patrick-kidger/tinyio/blob/main/tinyio/__... there's

    from ._core import (
        Loop as Loop,
        sleep as sleep,
        ...
    )
Does using `<name> as <name>` change the runtime behaviour at all? Or is it a stylistic choice?
patrickkidger•7h ago
This is how static type checkers are told that an imported object is part of the public API for that file. (In addition to anything else present in that file.)

C.f. "the intention here is that only names imported using the form X as X will be exported" from PEP484. [1]

I'm generally a fan of the style of putting all the implementation in private modules (whose names start with an underscore) and then using __init__.py files solely to declare the public API.

[1] https://peps.python.org/pep-0484/

tayo42•2h ago
That looks like its only for stub files not __init__.py
kstrauser•6h ago
This is a fun path to explore. Prior art was an earlier Python asynchronous experiment called Tulip, from GVR himself: https://www.dropbox.com/scl/fi/r3w0b50p3m26je12v93ww/SFMeetu...
unsnap_biceps•6h ago

  I have a function I want to be a coroutine, but it has zero yield statements, so it is just a normal function?
  
  You can distinguish it from a normal Python function by putting if False: yield somewhere inside its body. Another common trick is to put a yield statement after the final return statement. Bit ugly but oh well.
I'm fairly unfamiliar with python and I don't quite understand what this is actually doing. Does it change anything in the execution or is it just to mark it in a way for IDEs to do something with?
kstrauser•6h ago
Yes. If a function contains the yield statement, calling that function returns a generator instead of executing its body. For example, here's defining and calling a regular function:

  >>> def foo_function():
  ...     print('In a function!')
  ...     return
  ...
  >>> foo_function()
  In a function!
And here's defining and calling a generator:

  >>> def foo_generator():
  ...     print('In a generator!')
  ...     return
  ...     yield
  ...
  >>> foo_generator()
  <generator object foo_generator at 0x10321aa40>
  >>> next(foo_generator())
  In a generator!
  Traceback (most recent call last):
    File "<python-input-6>", line 1, in <module>
      next(foo_generator())
      ~~~~^^^^^^^^^^^^^^^^^
  StopIteration
Notice that the generator's body isn't evaluated until you consume the generator. StopIteration isn't actually an error in usual cases. It just says that the generator doesn't have any more values to return and has exited. For example, that's how Python's for-loop works:

  >>> for _ in foo_generator():
  ...     continue
  ...
  In bar!
Here it executes the generator's body (including the print() call) until it gets to the return statement. Because it's a generator, it returns as normal and then raises a StopIteration exception, which tells the loop to stop looping.
gjvc•6h ago
see also https://github.com/dabeaz/curio
jojohohanon•6h ago
Twisted, revisited?