News for hackers. Stuff that matters.
Re:TypeCell, open source TypeScript notebooks live programmi... by oofsa on Wednesday June 14, 2023 @12:36PM (#36328503)
Cool. This may be a bit nitpicky, but every interactive JavaScript environment I have seen with auto-run ("evaluates as-you-type") freezes in the following case.

  for (let i = 0; i < 10;|) ...
                         ^ cursor
Re:TypeCell, open source TypeScript notebooks live programmi... by civilitty on Wednesday June 14, 2023 @01:23PM (#36329278)
An easy way to correct this is injecting a watchdog function call at the end of every for and while loop. It’s a trivial AST transformation that’s relatively fool proof as opposed to trying to figure out what condition would progress the loop. The semantics of the watchdog depend on the use case and ideally you can transform the evaled code in an async wrapper.
Re:TypeCell, open source TypeScript notebooks live programmi... by Timon3 on Wednesday June 14, 2023 @01:24PM (#36329288)
No problem, there's an NPM package for that!

(no, I'm not kidding: https://www.npmjs.com/package/halting-problem)