Here's some quick impressions -- I haven't looked at any of this deeply, and I might be off base in some respect or another:
I imagine that a j playground progress spinner would exploit 2!:0 to drive a callback which was specifically designed to update a j playground progress spinner. I also imagine that it should be possible to selectively disable an existing "paren matching" routine for the case where the parens are not parenthesis. That said, given our rather unique {{ }} matching which ignores single curly braces (and which requires the }} which matches {{)n to immediately follow a linefeed), we should eventually think about implementing our own routine for this purpose. I am imagining a mix of UI work and algorithmic work here. And... about double slashes -- I imagine that the "Path Name Resolution" section of https://pubs.opengroup.org/onlinepubs/009604499/xrat/xbd_chap04.html might have something to do with that? I hope some of this helps, -- Raul On Wed, Jul 6, 2022 at 11:48 PM Joe Bogner <joebog...@gmail.com> wrote: > > Hi Jan-Pieter, > > Thanks for all the feedback and the pull request. I merged it in. > > Below are some comments on your excellent feedback: > > On Sun, Jul 3, 2022 at 5:45 PM Jan-Pieter Jacobs <janpieter.jac...@gmail.com> > wrote: > > > I saw the progress spinner, it certainly is an improvement over the > > previous behavior, especially since now it shows at least progress of > > different lines in the editor. However, progress lines of successive lines > > in echo'd in a function are only shown at the end (e.g. see > > > > https://jsoftware.github.io/j-playground/bin/html2/#code=NB.%20SHOWPROGRESS%3D1%0A%0Aecho%20'fine'%0A0%200%246!%3A3%5D%201%0Aecho%20'good'%0A0%200%246!%3A3%5D%201%0Aecho%20'Also%20fine'%0A%0Afoo%20%3D%3A%20%7B%7B%0Aecho%20'shown%20at%20the%20end%201'%0A0%200%246!%3A3%5D%201%0Aecho%20'shown%20at%20the%20end%202'%0A0%200%246!%3A3%5D%201%0Aecho%20'shown%20at%20the%20end%203'%0A%7D%7D%0A%0Afoo''%0A > > ). > > Especially in this last case it would be handy for long-running functions > > to be able to give updates (like for instance in the NN demo's sgd). > > > > > I see... I'm not entirely sure what to do about this yet so I will add it > to a github issue to track it > > > > I think the progress spinner could become more something like the kernel > > indicator of the Jupyter notebooks, i.e. an indication on the toolbar. > > Perhaps it would be handy to make the icon function as "break" as well. > > The icon would have 4 states: idle, running, clicked once (waiting for > > soft-break to take effect), clicked twice (waiting for hard-break to take > > effect), and could be accompanied by a textual hint/tool tip when not idle. > > > > > I like the idea of adding something like the kernel indicator of Jupyter > notebooks. I'm not sure yet what it would take to implement, but it seems > like a great way to add the functionality you mentioned. I will log it > > > > Aside of this, I noticed a few other things (unsorted): > > - The SystemFolders_j_ variable seems to have a wrong value for the addons > > field, and the system folder could be added, allowing users to use e.g. jpm > > as well. > > I tried SystemFolders_j_=: |: ('temp';'') ,. ('addons';'addons') ,. > > ('system';'jlibrary/system') (in emj.ijs). While this seems to work, trying > > to load a non-existent module, it gives an odd message I can't pinpoint, > > e.g.: > > load '~addons/graphics/plot' > > not found: //addons/addons/graphics/plot.ijs > > Here, I don't see where the extra //addons/ is coming from. > > > > > With some trial and error and digging into getscripts_j_, I think it's > supposed to be > > SystemFolders_j_=: |: ('temp';'') ,. ('addons';'//addons/') > > NB. works as expected > load '~addons/graphics/plot' > > NB. shows a more sensible error messages > load '~addons/graphics/foo' > not found: //addons//graphics/foo > |file name error: script > | 0!:0 y[4!:55<'y' > |[-0] > > It looks like that behavior comes from isroot which is called by > getscripts_j_ > > isroot_j_ > ('\\' -: 2&{.) +. ('//' -: 2&{.) +. ':' = {.@}. > > I'm not entirely sure why it expects // to be root on a linux/posix system, > but it seems to work with double slashes at the beginning > > Does this seem like a suitable solution? If so, I can add it to > https://github.com/jsoftware/j-playground/blob/j903_wasm/source/base/init.ijs#L5 > > - The highlighting of matching parentheses, brackets and braces does not > > work with J's syntax; it would be better disabled, since it considers [] > > and {} should be paired. > > > > Hmm, I am on the fence on this one. I don't mind the matching parentheses > and it was part of the original playground that chris burke developed. I'd > look for more community input on this one before removing it > > > > - Ctrl - clicking anywhere in the currently focused pane results in a > > second cursor; typing afterwards results in text added at both (actually > > all) cursors. This is quite handy, I would love to have it in JQT as well, > > and saw this before in other advanced editors! So I was wondering whether > > this was a feature or a bug :). > > > > I can't take any credit for this! It looks like it's built into the > codemiror editor we are using (https://codemirror.net/) > > > > - It would be very handy to have an option to upload / download the > > contents of the editor window, in some cases. For instance, on my company > > laptop, as security policy, apparently the browser storage is cleared at > > every shutdown of Chrome, so I can't use the recent File(s) tools. > > > > I agree! I also just found a neat trick that you can drag/drop a file onto > the editor pane and it will paste the contents in. This may be a temporary > workaround until we add the upload capability. > > > > - In comparison with JQT, I'm missing Run Selection and Load (i.e. run all, > > but don't display). Especially load would be nice for longer scripts. > > > > > Good suggestion. I will add it to github issues as an easy enhancement > > > Thanks again! > Joe > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm