Settings

Theme

Show HN: Weft – A reactive and interactive Python experience

play.weft.sh

6 points by zeapo 16 days ago · 4 comments · 1 min read

Reader

Hi HN,

I built Weft over the last two weeks of Christmas break. I was teaching my kids Python and noticed the lack of interactivity in some of their learning experiences. The feedback loop was too long.

I wanted to provide them with an experience similar to Bret Victor's concepts on Learnable Programming; i.e. an easier way to learn is to see immediately the reaction to your actions. Hence the reactivity ;)

It is currently in early alpha and I’m planning to open-source the repo under AGPLv3 soon once I clean up the prototype code.

I wrote up a short blog post with more details on the "Why" and the implementation here: https://zenadi.com/posts/weft-announcement

I’d love to hear your feedback or ideas on how to make this better.

Simplita 16 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?

  • zeapoOP 16 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 15 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)

  • zeapoOP 15 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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection