HNHacker News
TopNewBestAskShowJobs

buibuibui

159 karma · joined July 2, 2023

submissionscomments
buibuibui··on The Synology End Game
I actually like their software offerings like Synology Drive and Synology Moments. Their backup solution also seem to "just work" with Hyper Backup. I'm using a Mac und tried to use Nextcloud, but my conclusion with the Nextcloud Desktop Client is, that it is buggy as hell. Especially the VFS implementation. Synology Drive in opposite just works (for me).
buibuibui··on The Missing Manual for Signals: State Management for Python Developers
The Signals libraries I know of (including reaktiv) are throwing an exception if a dependency cycle is detected in the computation step. But that doesn‘t solve infinite executation loops completely because the user still can define an Effect that updates its (in)direct dependencies - that means User caution is still needed. Angular tried to prevent that in their older versions by not allowing to set other Signals in Effects. But they reverted that decision.
buibuibui··on The Missing Manual for Signals: State Management for Python Developers
You can use normal names function instead of lambdas if you prefer! In Javascript anonymous functions are used normally for things, where defining named functions are considered too verbose - I use lambdas for that in Python.

The Signals evaluation are topologically ordered and are running synchronously. Effects are running in the order they are defined.

buibuibui··on The Missing Manual for Signals: State Management for Python Developers
I actually created the library after being exposed to Angular Signals starting from the v16 release. I watched some talks and read articles about Signals, just to know about Ryan Carniato from SolidJS. He did an excellent job teaching the world about Signals!
buibuibui··on The Missing Manual for Signals: State Management for Python Developers
I am using the standard Python library `contextvars.ContextVar` as the foundation of my reactivity system's dependency tracking mechanism. In the computation step, when Signals get accessed, I track them as dependencies.
buibuibui··on Ditching Obsidian and building my own
Just solved my problem. The slowness came from using iCloud Drive. It removes my notes / unsyncs my notes when I don't use it regularly. I have to set the Obsidian folder to "Keep Downloaded" and then everything is fine!
buibuibui··on LiveStore: State management based on reactive SQLite and built-in sync engine
Interesting to see Signal-based reactivity on the backend! I wrote a Signal library for Python [1] and was thinking about what could be done with it.

[1] https://github.com/buiapp/reaktiv

buibuibui··on Ditching Obsidian and building my own
I am also searching for an alternative to Obsidian, that also works well on iOS and macOS. Obsidian is currently really slow somehow although all extensions are disabled, e.g. rendering the content when switching between notes is not instant. I really really like Outline, but I don't want to access the web just to write and read notes.
buibuibui··on Reaktiv: Reactive Signals for Python
Hi HN! I created reaktiv, a Python library that brings reactive Signals to the backend world.

The frontend ecosystem has already embraced Signal-based reactivity (Angular, SolidJS, React) with tremendous success. It's time for Python developers to enjoy these same benefits. My breakthrough came when I stopped describing it as "Angular signals for Python" and started calling it "Excel-like computation graphs" - suddenly Python developers understood the value.

reaktiv automatically tracks dependencies between computations, only recalculating values when dependencies change. This eliminates manual dependency tracking, prevents synchronization bugs, and reduces cognitive load when managing complex state - benefits that are just as valuable on the backend as they are in UI frameworks.

I'm seeing initial interest from data scientists and believe the Home Assistant/IoT communities could benefit greatly from this approach. Python deserves the same modern reactivity patterns that have revolutionized frontend development.

Would love your thoughts on bringing Signals to the Python ecosystem!

buibuibui··on reaktiv: Reactive Signals for Python
Hi HN! I created reaktiv, a Python library that brings reactive Signals to the backend world.

The frontend ecosystem has already embraced Signal-based reactivity (Angular, SolidJS, React) with tremendous success. It's time for Python developers to enjoy these same benefits. My breakthrough came when I stopped describing it as "Angular signals for Python" and started calling it "Excel-like computation graphs" - suddenly Python developers understood the value.

reaktiv automatically tracks dependencies between computations, only recalculating values when dependencies change. This eliminates manual dependency tracking, prevents synchronization bugs, and reduces cognitive load when managing complex state - benefits that are just as valuable on the backend as they are in UI frameworks.

I'm seeing initial interest from data scientists and believe the Home Assistant/IoT communities could benefit greatly from this approach. Python deserves the same modern reactivity patterns that have revolutionized frontend development.

Would love your thoughts on bringing Signals to the Python ecosystem!

buibuibui··on PlainBudget – Minimalist Plain Text Budgeting
I also wrote a small napkin buget calc script with my Python `reaktiv` library so I can use REPL and commit it to GIT. Here is a small example: https://github.com/buiapp/reaktiv/blob/main/examples/napkin_...
buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
As an Angular/RxJS developer, RxPY was the first library I tried in my projects (about two years ago, I think). However, it had too many footguns that I didn’t encounter with RxJS. Because of that, I opted for simple asyncio Queues instead. Now that Angular is transitioning from RxJS to Signals, I was curious if something similar exists in the Python ecosystem.
buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
I updated the README.md of my repository to make it clearer what the purpose of my library is.
buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
Ah, I didn't knew about that. I assumed HN also used Markdown.
buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
I don’t know how to edit my submission, but after reading the comments, I realize the example code didn’t do a good job of demonstrating what my code does. Here’s a more verbose example showing a stock ticker:

  import asyncio
  from reaktiv import Signal, ComputeSignal, Effect
  
  async def main():
      # Real-time stock prices
      apple_price = Signal(195.00)
      google_price = Signal(2750.00)
  
      # User's portfolio
      shares = Signal({
          'AAPL': 100,
          'GOOGL': 50
      })
  
      # Computed total portfolio value
      portfolio_value = ComputeSignal(lambda: (
          shares.get()['AAPL'] * apple_price.get() +
          shares.get()['GOOGL'] * google_price.get()
      ))
  
      # Price alert system
      async def check_alerts():
          if apple_price.get() > 200:
              print("AAPL alert: Above $200!")
          if google_price.get() < 2700:
              print("GOOGL alert: Below $2700!")
  
      # Automatic updates
      async def live_updates():
          while True:
              await asyncio.sleep(1)
              apple_price.set(apple_price.get() * 1.01)  # +1%
              google_price.set(google_price.get() * 0.995)  # -0.5%
              print(f"AAPL: ${apple_price.get():,.2f}  GOOGL: ${google_price.get():,.2f}")
  
      # Track portfolio value
      async def monitor_portfolio():
          print(f"Current value: ${portfolio_value.get():,.2f}")
  
      # Set up effects
      alerts_effect = Effect(check_alerts)
      updates_effect = Effect(live_updates)
      portfolio_effect = Effect(monitor_portfolio)
  
      alerts_effect.schedule()
      updates_effect.schedule()
      portfolio_effect.schedule()
  
      # Run for 5 seconds
      await asyncio.sleep(5)
  
  asyncio.run(main())
Example output:

  Current value: $157,000.00
  AAPL: $196.95  GOOGL: $2,736.25
  Current value: $156,507.50
  AAPL: $198.92  GOOGL: $2,722.57
  Current value: $156,020.39
  AAPL: $200.91  GOOGL: $2,708.96
  AAPL alert: Above $200!
  Current value: $155,538.66
  AAPL: $202.92  GOOGL: $2,695.41
  AAPL alert: Above $200!
  GOOGL alert: Below $2700!
buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
Haha, I actually used RxPY a lot in the past! Back when I was more into Angular/RxJS and less familiar with Python, I thought I could apply the same concurrency patterns using RxPY. But I burned myself pretty badly. RxPY is powerful, but it’s also complex, and getting it to play nicely with asyncio (especially with typing) was frustrating enough that I eventually moved away from it.

RxPY is a full reactive programming toolkit with observables, operators, and complex stream processing, while Signals are a more lightweight and declarative way to track state dependencies. RxPY is great for handling event streams, but for simple state management and reactive updates, Signals are much easier to reason about.

buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
In my case, I’ve built Python applications that poll multiple sensor data, perform calculations, and push results to the frontend. The frontend is also allowed to configure the measurements on the fly, so I needed some form of reactivity in my backend to handle dynamic changes smoothly.

Could you share an example of the problem you’re referring to?

buibuibui··on Show HN: Reactive Signals for Python – inspired by Angular's reactivity model
I’ve seen how the frontend world solved state management with reactivity, but I couldn’t find anything similar for backend development in Python. So I built reaktiv to bring the same automatic dependency tracking and state propagation to async Python code.

In frontend frameworks, Signals eliminate the need for manual subscriptions and event handling, making state updates more efficient. I wanted the same benefits for backend systems where changes to shared state should propagate automatically, without polling, callbacks, or race conditions.

For example, if a config value or cached result updates, anything depending on it should react immediately. With Signals, you don’t have to manually notify consumers or keep track of what depends on what. It just works (hopefully).

About `asyncio.sleep(0)`: it’s just there to keep the example concise. Normally, you’d be inside an async function that naturally yields control, like handling a request or waiting for I/O.

buibuibui··on MarkItDown: Python tool for converting files and office documents to Markdown
Wow that is magic! I just installed uv because of your comment.
buibuibui··on I designed a Dieter Rams-inspired iPhone dock
3 Weeks ago Scott Yu-Jan posted his version of the iPhone Stand By Dock: https://www.youtube.com/watch?v=L3nWw8qSYgk There is a nifty mechanism to take the iPhone out. Model: https://makerworld.com/en/models/615378#profileId-538769
buibuibui··on Show HN: We built a FOSS documentation CMS with a pretty GUI
We self-hosted Outline like two weeks ago in our company (15 people) and the acceptance is overwhelming positive. We tried different tools in the past: WikiJS, XWiki, docuwiki, Bookstack and there was quite a big resistance in using it. Main reasons where like, missing core functions e.g. no live collaboration, no e-mail notifications on commenting, no diagram functions, strange rules regarding page organisation, etc. Outline feels mentally really lightweight but checks all boxes that we searched for. Some people says its quite similar to Notion, but without the automatisation stuff (I have no experience with Notion).
← PreviousPage 2 of 2