scijava / scijava-common

A plugin framework and application container with built-in extensibility mechanism :electric_plug:
BSD 2-Clause "Simplified" License
91 stars 52 forks source link

Script Interpreter issues #308

Open ctrueden opened 7 years ago

ctrueden commented 7 years ago

@acardona made an issue report on the ImageJ Forum about the Script Interpreter:

The issue of printing within the interpreter is easy to solve by redirecting stdout to a PrintWriter that writes to the interpreter.

Other issues:

  1. Fails to keep state, i.e. fails to write the executed commands to a file. The error is puzzling:

    WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: /home/albert/.java/.userPrefs/org/scijava/script/_!%g!a@"z!(@!bw"y!(k!.g"v!()!~w!u!(:!}w"p!'o!}@"2!'%!.g"w!'w!d@"n!'k!bg"z!#4!cw"j!()!a@"w!(@!a@"u!'c!.g"j!'w!bw"q!(`!cg"l!#4!@w"s!'8!ag"1!()!~@"^!':!cg"p!(!!d!"&!'4!~w"p!'4!~@== create failed.
  2. The cursor blinks.

  3. When I open a new interpreter, it doesn’t remember the last language that was chosen.

  4. Can’t select commands to re-execute them with e.g. a key binding or a popup menu. I have to select, copy-paste, then push return.

  5. Checking the “Show variable types” doesn’t seem to do anything.

  6. I can’t collapse the table of variables to nothing. Given its apparent uselessness, it is screen noise. In any case it should be fully collapsible.

  7. I have no idea what the list of variables is for or about. Typing the variable into the prompt and pushing return shows that the symbol is not bound to anything (at least in clojure).

  8. The built-in commands e.g. “:lang” should not be bound to a name that starts with “:” in clojure. These can collide with keys for dictionaries. I suggest using something that can’t be bound in any language, perhaps something like what psql (postgres prompt) does: use a leading backslash “\”.

acardona commented 6 years ago

It's been a year. The new Script Interpreter continues to be as limited and faulty, as far as I know. It remains difficult to understand why the old script interpreters were ditched into "legacy" when they actually work better: that was clearly a premature move, and it should be undone. It's surprising that, to get a functional script editor, one has to install the "legacy" ones. It seems that whoever ditched the old interpreters is not a heavy user of the new one, at least not with languages like clojure.

acardona commented 6 years ago

In addition, while open, the new Script Editor keeps printing this error:

WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: /home/albert/.java/.userPrefs/org/scijava/script/History/_!%g!a@"z!(@!bw"y!(k!.g"v!()!~w!u!(:!}w"p!'o!}@"2!'%!.g"w!'w!d@"n!'k!bg"z!#4!cw"j!()!a@"w!(@!a@"u!'c!.g"n!()!bw"v!(}!e@!u!%c!cg"v!'8!dg"5!&:!}w"y!'k!c!"0!%`!bg"n!'k!bg"l create failed.
ctrueden commented 6 years ago

I have literally over 1000 open issues to deal with. I would be a lot more likely to prioritize your pet favorites if you were able to maintain some semblance of civility in your attitude.

acardona commented 6 years ago

I'm afraid you misunderstand my tone. I am upset about functioning script interpreters having been ditched into a legacy package when the main Script Interpreter provided by default is broken. I am not upset at you, neither make you responsible for the brokenness of the new Script Interpreter. But you did ditch the prior script interpreters into legacy: at least you could undo that. It was a premature decision, given the issues with the new one and the lack of any interest in fixing them by part of the community or the original authors.

ctrueden commented 6 years ago

It has been a long time now, so memory has faded, but I recall that there were obstacles to keeping the existing script editors. Otherwise we would not have retired them so quickly. Certainly, the Maven projects were never updated to have reproducible builds. In order to restore them to the core update site, we would need to, for each individual language interpreter:

All with the intent that they will eventually be retired again once the new unified Script Interpreter component "catches up" in some qualitative way. But once the individual interpreters are back, any external impetus to improve the unified Script Interpreter would be much closer to zero.

Rather than going that route, I was hoping for some joint community effort to bring the new Script Interpreter forward more rapidly. As I wrote in the other thread: interested people can clone the scijava/script-editor repository and take a look at InterpreterPane and InterpreterWindow. Use ScriptInterpreterTestDrive to test out any changes in the IDE.

acardona commented 5 years ago

Hi @ctrueden,

The new Script Interpreter's issues are not "qualitative", they are well defined and addressable. Given the disinterest of the original authors to fix it, I'd ditch it into legacy: it is broken.

The old, language-specific script interpreters can either be rescued into main fiji--they do not collide or depend on anything present in Fiji--, or the new changes to the Script Editor at https://github.com/scijava/script-editor/pull/28 can be merged and announced as a replacement for both the old and the new script interpreters.

imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-console-message-repeating-every-few-seconds/66306/9