Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh that's cool I thought there were special hooks with D3. The native inputs demo seems really compelling especially in a learning environment. I'll definitely play with this and bring it into my next mentoring group meeting. (They'll be so glad to get away from scratch!)

One cool thing that Swift playgrounds let you do is advance program state through loops and other flow-control line-by-line using a slider. I think they have to have cooperation with the compiler/runtime to make this happen. (I'm also not sure how truly useful it is after a few days of learning the basics.)

I suppose you could do something similar with the native inputs but not using native syntax. What I'm thinking would be a massive undertaking I realize - it's cool that this offering generates so many "ooh and what else" ideas.



Yes, it's absolutely worth exploring further — and we definitely have notions for ways to further expose and make interactive the running state of the notebook.

But for starters: You can do something similar to expose the internal state of loops and flow-control constructs by just using JavaScript's generators.

Here's an extremely simple example that slowly yields the value of a loop's `i` variable:

https://beta.observablehq.com/@jashkenas/flow-control-demo-w...

If you remove the delay, it'll instead yield `i` at 60fps.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: