Show HN: Weft – A reactive and interactive Python experience

5 pointsposted 3 days ago
by zeapo

4 Comments

Simplita

3 days ago

This looks nicely aligned with Bret Victor’s ideas around tight feedback loops. One thing I’m curious about is how you’re thinking about debugging and state visibility as programs grow beyond small examples.

In reactive systems, we’ve found the learning experience improves a lot when users can inspect how a value changed over time, not just its current output. Do you see Weft moving toward any kind of execution history or state timeline, or are you intentionally keeping it minimal for teaching?

zeapo

3 days ago

Thanks for the feedback. You're right, it's part of the long term goals.

I'd like to keep the center of the screen clutter free and add side-bars later on with tooling. Among them, an inspector just like what PyCharm has when opening a notebook. For globals it's quite simple to add, however to inspect the content of a single compound statement it might be a bit tricky (if you've got ideas I'd love to learn more).

Some of the next "urgent" features are improving the code state management (history), having multiple sessions, being able to save them, etc. Maybe adding a way to bring the data online somehow.

shkooppy

2 days ago

Love it. I'm definitely using it with my nieces.

I didn't quite understand the role of Rust here? Mind explain? (thanks)

zeapo

2 days ago

Glad you like it.

I used rust 'cause of Ruff. They have an outstanding set of crates https://github.com/astral-sh/ruff/tree/main/crates

The ones I use: - python_parser, allows me to load the python source code and detect any parsing errors (returned to the frontend) - python_ast, allows me to extract the identifiers (variable names, function names, etc) - python_semantic, allows to do scope analysis and understand relationships between identifiers

In the first prototype I used Python's ast and symtable libs. However, I really wanted to rely on the speed of Ruff's implementation and Rust's speed.