WATCH Dialect Is Back

For a while, the WATCH dialect wasn't working in the ReplPad. Fixing it actually turned out to be rather difficult, because ReplPad was changed to use FUNC and LET exclusively (no FUNCTION). So this was really the first complex dialect whose implementation depended fully on virtual LET-binding. Debugging in the browser is significantly harder, so that made it pretty mean.

But now that it's working, I have the headless browser test running the dialect.

It's a fun thing, so why not go ahead and load up the ReplPad and try it?

Interestingly, it loads the watch extension the first time you invoke WATCH.

>> watch x  ; (slot 1): ~unset~

This should show ~unset~ in watch slot 1. If you change the value of x, then you should see the slot update.

 >> x: 304
 == 304   ; (slot 1): 304

The way the updating works right now is by hooking the console's PRINT-RESULT function. After the result has been printed, it updates the slots. So you won't see the values change during the evaluation, only each time you get a console prompt.

If you want you can ask the watchlist to give you the value stored in a slot, by passing an integer.

>> watch 1
== 304

You can hide the watchlist

>> watch /off

And you can show the watchlist

>> watch /on

If you want to delete a watch, you can use a negative number

>> watch -1

It would be helpful if @rgchris could look over the splitter and see how sane the strategy is. What I would like is a way to make panels generically, so they can work in something like Golden Layouts. I don't want to require something that heavy to run a replpad instance...I'd actually like it to be possible to just kind of load a console on-demand and have it pop up for debugging an app that was using Ren-C as a library. But it would be great to be able to use Golden Layout (or similar).

Would it be enough for now to have a Ren Garden-like side panel? Would have some issues with layout on smaller screens, but otherwise wouldn't see it as being a major issue.

How do you mean different from how WATCH works now? (It has a splitter and a side panel modeled after Ren Garden)

The splitter being used currently is split.js. I don't actually remember where I got the table code, but it's not a library widget...those were all much too big, so I just cobbled something together from the thinnest examples I could find.

What I'd like is a framework so we can plug into basically anything. I'm really interested in a build that has no console in it...that can fetch the console and pop it up (e.g. on a page that ordinarily just does stuff like leverage PARSE behind the scenes, and it wouldn't need a console or watchlist for that).

Modularizing it so that the console code is pulled on-demand as a separate extension is interesting to me. This can be done with what are called Wasm "side modules" (the webassembly equivalent of a DLL)

Well I got as far as opening the console...

I could suggest a minimalist concept that would just involve managing DIVs and preset Flexbox/Grid layouts—less JavaScript, a little more CSS. Again, how much are you concerned about smaller screens? I notice it still has a split at phone widths?

I don't know about doing multiple panels at once on smaller screens. Certainly seems docking windows wouldn't be a good fit.

Watchlist might be something that could do a vertical split on a phone, showing you one or two watches.

But generally I would think that if you have multiple panels on a phone, you'd be swiping between them...maybe left and right swiping? I think it would be all right to assume each panel takes a full screen for starters if you use something in this abstract "panel model" on a phone.

Like I say, one of the more interesting panel models would be some kind of "zero panels to start with" model. So you could have a mostly JavaScript website with its own UI that wanted to use some Ren-C services...but, if you needed to, you could call something to pop up a ReplPad to debug with.

1 Like