Folks who are working on languages/tools with some...
# thinking-together
i
Folks who are working on languages/tools with some sort of rewind / reverse execution / reversible computing feature... what are you doing, how are you doing it, and why? (Edit) Additionally: if you are doing the above, do you allow the running system's data or code to be edited? For instance, some traditional debuggers allow you to edit the state of variables when execution is paused. If you offer anything like that, how does that interact with your rewind/reverse functionality? Does rewinding undo changes to data? How about code? Or does rewinding execute in reverse, using the just-edited code as if it had always existed? Bonus round: In traditional debuggers for some languages, you can insert some sort of "pause / debug" statement into your code that pauses execution and initiates debugging. In your reversible language, can user code control the flow of time backward/forward, or anything similarly wild like that? If so, what's your philosophy / approach to handling paradoxes?
d
Start with "why?", please. 😀
e
Time travel debugging was first demonstrated commercial in the C language "omniscient debugger", a brilliant work from 10 years ago that never got much attention. Now the mighty Microsoft has added this feature to their Visual Studio Enterprise product. It is also a commercial tool called "rr". I haven't used these other products so i can't comment on how well they work. Some functional languages like Elm offer time travel debugging to some degree, because they are already storing the history of variables so it is relatively easy to offer this feature. I designed my Beads system on the idea that enabling this feature would be the greatest improvement in the debugging process one can make. So that is the "why". It is very tricky to implement efficiently, especially if you plan to offer this in shipping end user products, not just inside the lab. It is in shipping products that it is most needed in reality, because the number of bug reports from end users can be 10x or 100x what your internal QA team can find. And the inability to reproduce (and then fix) bugs has become so impossible for the big companies to keep up, that the bug databases for Adobe, Apple and MS are in the millions, and basically nothing much gets fixed. I just yesterday found a bug in Chrome where the Emoji variation selector to turn off automatic emoji promotion is broken, and it is been known for years.
👍 2
i
@Edward de Jong / Beads Project I feel that "implement efficiently" pain, yep! In Beads, how does time travel work? What's the experience of using it like? Have you implemented it yet, or are you still working on the design?
e
Since the Beads language main purpose is to facilitate graphical interactive programs, merely rewinding the state doesn't cut it. You also have to show the state of the screen that corresponds to the internal state, so systems like Visual Studio which are tracking the minute changes to each memory address don't actually help that much. Most of the code in an interactive product revolves around drawing things, and responding to user input. For example, in a tic tac toe game, which is one of my shortest examples, the amount of computation is tiny; you have to check 8 different paths in the game to see if a play wins. So in my case the debugger is actually a second program in Beads watching the execution of a sub-program, the game. Not only is there reversal, but also time dilation and compression. Since i had this feature in mind at the start, i built the whole product around making sure that it would work. It is very easy to inject a feature which is non-reversible. A lot of the OOP paradigm works against you in reversible systems, which is why there is no NEW or DISPOSE in my language. The big payoff in time travel is when you can do it so efficiently that the shipping product can keep the feature on, and thus when the user encounters a bug, they can send their breadcrumb trail to the developers and now you have 100% repeatability on bug reports. Apple and the big companies spend a fortune on time wasted not being able to repeat a problem, and net result of the inability to recreate the user's exact situation is that products are bug-ridden today. Nobody can afford to chase down an intermittent error, so companies have taken the very cynical tactic of using their customer base as their final QA, and waiting for a statistically significant number of error reports before they investigate and try to fix. That's no way to run an airline if you ask me. I want people to make products that are near perfect, and the only way to get near perfection is to guarantee repeatability, even when you have random numbers, multiple players in a game, flaky networks, etc. But on the flip side, i hardly use the feature, because so far my sample programs are very small. The more animation your product does, the more you need slo-mo, reversing, etc. Flashy features like time travel debugging are very exciting, but it doesn't fix a bad design, or make a user interface clean and clear. A bad design is bad in both directions... I find that most of one's time in graphical products is spent making sure the design still looks good across a wide range of screen sizes. The Android space is mind-bogglingly broad in terms of hardware capabilities, with notches popping up in every odd location, and some wacky screen resolutions. I have spent 10 times more time on the screen layout features than time travel.
When you are debugging a sorting function, you want to see what i call sub-atomic levels of detail, like what is the value of a variable before and after, or see the condition codes of a branching instruction. So maybe we can call one "interaction rewind" and "instruction-level rewind". Both have their uses, but a lot of people confuse the two as they are not interchangeable.
w
@Edward de Jong / Beads Project baffles me that omniscient debugging didn't immediately become the next big thing. (And there was AOP too, so there's that.)
@Ivan Reese why? QA. When a tester sees something wrong, they click the "write a bug report" button, and it includes the current state as well as checkpoints. Not omniscient and more clunky than it should be, but it's the real deal rather than a demo.
i
http://dalsegno.ballingt.com/ by @ballingt might be interesting to check out
i
That is extremely cool and highly relevant. Thanks for the link!
b
(short bc on mobile) My motivation for dalsegno was generalizing the reactivity achieved by live reloading environments with a setup and a draw function (there's some ClojureScript wrapper on processing I think that does this?) to other program structures.
(thanks for the mentioned @irvin!)
I found gameloop-style programming to be a mediocre for for this - this rewind system was better for synchronous functions than geloop style "increment this agent" programs
so next I tried many agents running programs like this concurrently: http://missilecmd.ballingt.com/?simulator
I haven't written about this one yet, but I talk about it a bit in

https://www.youtube.com/watch?v=Zcg1Ku4YB4g

and http://ballingt.com/interactive-interpreter-undo/
👍 1
i
@ballingt Thanks for that additional context and those links.
j
👋 @ballingt
Firefox is working on RR in the browser (WebReplay). We hope launch and go to a small beta early next year. https://developer.mozilla.org/en-US/docs/Mozilla/Projects/WebReplayRoadmap
The nice thing is if you're curious, you can test it today in our Nightly release.
b
This is the most exciting thing
^ the second video shows how log points can be used to add logging after the fact.
The roadmap is basically 1. support local debugging 2. support cloud debugging where recordings are uploaded and shared 3. support ci environments where recordings are attached to failing tests 4. support production where recordings are attached to user exceptions
4 is the hardest and a ways off
@ballingt i love that your examples are actually embedded in the page. like i can use the slider
b
if folks are confused by this comment, on mobile they're just videos - on desktop they're interactive
I like that the Firefox project will be widely deployed and used and is going to fundamentally change our expectations of programming!!!